ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:77161] [Ruby trunk Bug#12729] crash after refining private method to public
       [not found] <redmine.issue-12729.20160906182618@ruby-lang.org>
@ 2016-09-06 18:26 ` xkernigh
  2016-09-22 17:19 ` [ruby-core:77361] " the.codefolio.guy
  2016-12-08  4:41 ` [ruby-core:78537] " nobu
  2 siblings, 0 replies; 3+ messages in thread
From: xkernigh @ 2016-09-06 18:26 UTC (permalink / raw
  To: ruby-core

Issue #12729 has been reported by George Koehler.

----------------------------------------
Bug #12729: crash after refining private method to public
https://bugs.ruby-lang.org/issues/12729

* Author: George Koehler
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.4.0dev (2016-09-06 trunk 56078) [x86_64-openbsd6.0]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
If I am using a refinement to make a private method into a public one, and I call the method, then Ruby crashes. Here's a simple example:

~~~ ruby
class Cow
  private
  def moo() end
end

module PublicCows
  refine(Cow) {
    public :moo
  }
end

using PublicCows
Cow.new.moo
~~~

It segfaults:

~~~
$ ruby scratch.rb                                                              
scratch.rb:13: [BUG] Segmentation fault at 0x007f7fffbbdff8
ruby 2.4.0dev (2016-09-06 trunk 56078) [x86_64-openbsd6.0]

-- Control frame information -----------------------------------------------
c:0002 p:0049 s:0007 e:000005 EVAL   scratch.rb:13 [FINISH]
c:0001 p:0000 s:0003 E:001d50 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
scratch.rb:13:in `<main>'

-- Other runtime information -----------------------------------------------

* Loaded script: scratch.rb

* Loaded features:

    0 enumerator.so
    1 thread.rb
    2 rational.so
    3 complex.so
    4 /home/kernigh/prefix/lib/ruby/2.4.0/x86_64-openbsd6.0/enc/encdb.so
    5 /home/kernigh/prefix/lib/ruby/2.4.0/x86_64-openbsd6.0/enc/trans/transdb.so
    6 /home/kernigh/prefix/lib/ruby/2.4.0/unicode_normalize.rb
    7 /home/kernigh/prefix/lib/ruby/2.4.0/x86_64-openbsd6.0/rbconfig.rb
    8 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/compatibility.rb
    9 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/defaults.rb
   10 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/deprecate.rb
   11 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/errors.rb
   12 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/version.rb
   13 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/requirement.rb
   14 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/platform.rb
   15 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/basic_specification.rb
   16 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/stub_specification.rb
   17 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/util/list.rb
   18 /home/kernigh/prefix/lib/ruby/2.4.0/x86_64-openbsd6.0/stringio.so
   19 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/specification.rb
   20 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/exceptions.rb
   21 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/dependency.rb
   22 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/core_ext/kernel_gem.rb
   23 /home/kernigh/prefix/lib/ruby/2.4.0/monitor.rb
   24 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb
   25 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems.rb
   26 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/path_support.rb

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

Abort trap (core dumped) 
~~~

There's a small chance that I get a SystemStackError instead of a segfault:
~~~
$ ruby scratch.rb 
scratch.rb:13:in `<main>': stack level too deep (SystemStackError)
~~~

Feature #12697 had inspired me to try making a refinement where Module#attr_accessor and Module#define_method are public. That's how I found this bug.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:77361] [Ruby trunk Bug#12729] crash after refining private method to public
       [not found] <redmine.issue-12729.20160906182618@ruby-lang.org>
  2016-09-06 18:26 ` [ruby-core:77161] [Ruby trunk Bug#12729] crash after refining private method to public xkernigh
@ 2016-09-22 17:19 ` the.codefolio.guy
  2016-12-08  4:41 ` [ruby-core:78537] " nobu
  2 siblings, 0 replies; 3+ messages in thread
From: the.codefolio.guy @ 2016-09-22 17:19 UTC (permalink / raw
  To: ruby-core

Issue #12729 has been updated by Noah Gibbs.


On latest head of master I don't get this abort trap or core dump, but I also don't see it return. It hangs, using 100% CPU, for at least a full minute and can only be stopped with "kill 9".


----------------------------------------
Bug #12729: crash after refining private method to public
https://bugs.ruby-lang.org/issues/12729#change-60604

* Author: George Koehler
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.4.0dev (2016-09-06 trunk 56078) [x86_64-openbsd6.0]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
If I am using a refinement to make a private method into a public one, and I call the method, then Ruby crashes. Here's a simple example:

~~~ ruby
class Cow
  private
  def moo() end
end

module PublicCows
  refine(Cow) {
    public :moo
  }
end

using PublicCows
Cow.new.moo
~~~

It segfaults:

~~~
$ ruby scratch.rb                                                              
scratch.rb:13: [BUG] Segmentation fault at 0x007f7fffbbdff8
ruby 2.4.0dev (2016-09-06 trunk 56078) [x86_64-openbsd6.0]

-- Control frame information -----------------------------------------------
c:0002 p:0049 s:0007 e:000005 EVAL   scratch.rb:13 [FINISH]
c:0001 p:0000 s:0003 E:001d50 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
scratch.rb:13:in `<main>'

-- Other runtime information -----------------------------------------------

* Loaded script: scratch.rb

* Loaded features:

    0 enumerator.so
    1 thread.rb
    2 rational.so
    3 complex.so
    4 /home/kernigh/prefix/lib/ruby/2.4.0/x86_64-openbsd6.0/enc/encdb.so
    5 /home/kernigh/prefix/lib/ruby/2.4.0/x86_64-openbsd6.0/enc/trans/transdb.so
    6 /home/kernigh/prefix/lib/ruby/2.4.0/unicode_normalize.rb
    7 /home/kernigh/prefix/lib/ruby/2.4.0/x86_64-openbsd6.0/rbconfig.rb
    8 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/compatibility.rb
    9 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/defaults.rb
   10 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/deprecate.rb
   11 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/errors.rb
   12 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/version.rb
   13 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/requirement.rb
   14 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/platform.rb
   15 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/basic_specification.rb
   16 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/stub_specification.rb
   17 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/util/list.rb
   18 /home/kernigh/prefix/lib/ruby/2.4.0/x86_64-openbsd6.0/stringio.so
   19 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/specification.rb
   20 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/exceptions.rb
   21 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/dependency.rb
   22 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/core_ext/kernel_gem.rb
   23 /home/kernigh/prefix/lib/ruby/2.4.0/monitor.rb
   24 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb
   25 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems.rb
   26 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/path_support.rb

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

Abort trap (core dumped) 
~~~

There's a small chance that I get a SystemStackError instead of a segfault:
~~~
$ ruby scratch.rb 
scratch.rb:13:in `<main>': stack level too deep (SystemStackError)
~~~

Feature #12697 had inspired me to try making a refinement where Module#attr_accessor and Module#define_method are public. That's how I found this bug.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:78537] [Ruby trunk Bug#12729] crash after refining private method to public
       [not found] <redmine.issue-12729.20160906182618@ruby-lang.org>
  2016-09-06 18:26 ` [ruby-core:77161] [Ruby trunk Bug#12729] crash after refining private method to public xkernigh
  2016-09-22 17:19 ` [ruby-core:77361] " the.codefolio.guy
@ 2016-12-08  4:41 ` nobu
  2 siblings, 0 replies; 3+ messages in thread
From: nobu @ 2016-12-08  4:41 UTC (permalink / raw
  To: ruby-core

Issue #12729 has been updated by Nobuyoshi Nakada.

Description updated
Backport changed from 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN to 2.1: REQUIRED, 2.2: REQUIRED, 2.3: REQUIRED

----------------------------------------
Bug #12729: crash after refining private method to public
https://bugs.ruby-lang.org/issues/12729#change-61920

* Author: George Koehler
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.4.0dev (2016-09-06 trunk 56078) [x86_64-openbsd6.0]
* Backport: 2.1: REQUIRED, 2.2: REQUIRED, 2.3: REQUIRED
----------------------------------------
If I am using a refinement to make a private method into a public one, and I call the method, then Ruby crashes. Here's a simple example:

~~~ ruby
class Cow
  private
  def moo() end
end

module PublicCows
  refine(Cow) {
    public :moo
  }
end

using PublicCows
Cow.new.moo
~~~

It segfaults:

~~~
$ ruby scratch.rb                                                              
scratch.rb:13: [BUG] Segmentation fault at 0x007f7fffbbdff8
ruby 2.4.0dev (2016-09-06 trunk 56078) [x86_64-openbsd6.0]

-- Control frame information -----------------------------------------------
c:0002 p:0049 s:0007 e:000005 EVAL   scratch.rb:13 [FINISH]
c:0001 p:0000 s:0003 E:001d50 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
scratch.rb:13:in `<main>'

-- Other runtime information -----------------------------------------------

* Loaded script: scratch.rb

* Loaded features:

    0 enumerator.so
    1 thread.rb
    2 rational.so
    3 complex.so
    4 /home/kernigh/prefix/lib/ruby/2.4.0/x86_64-openbsd6.0/enc/encdb.so
    5 /home/kernigh/prefix/lib/ruby/2.4.0/x86_64-openbsd6.0/enc/trans/transdb.so
    6 /home/kernigh/prefix/lib/ruby/2.4.0/unicode_normalize.rb
    7 /home/kernigh/prefix/lib/ruby/2.4.0/x86_64-openbsd6.0/rbconfig.rb
    8 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/compatibility.rb
    9 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/defaults.rb
   10 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/deprecate.rb
   11 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/errors.rb
   12 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/version.rb
   13 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/requirement.rb
   14 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/platform.rb
   15 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/basic_specification.rb
   16 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/stub_specification.rb
   17 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/util/list.rb
   18 /home/kernigh/prefix/lib/ruby/2.4.0/x86_64-openbsd6.0/stringio.so
   19 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/specification.rb
   20 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/exceptions.rb
   21 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/dependency.rb
   22 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/core_ext/kernel_gem.rb
   23 /home/kernigh/prefix/lib/ruby/2.4.0/monitor.rb
   24 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb
   25 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems.rb
   26 /home/kernigh/prefix/lib/ruby/2.4.0/rubygems/path_support.rb

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

Abort trap (core dumped) 
~~~

There's a small chance that I get a `SystemStackError` instead of a segfault:

~~~
$ ruby scratch.rb 
scratch.rb:13:in `<main>': stack level too deep (SystemStackError)
~~~

Feature #12697 had inspired me to try making a refinement where `Module#attr_accessor` and `Module#define_method` are public. That's how I found this bug.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-12-08  4:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <redmine.issue-12729.20160906182618@ruby-lang.org>
2016-09-06 18:26 ` [ruby-core:77161] [Ruby trunk Bug#12729] crash after refining private method to public xkernigh
2016-09-22 17:19 ` [ruby-core:77361] " the.codefolio.guy
2016-12-08  4:41 ` [ruby-core:78537] " nobu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).