Issue #11419 has been updated by Akira Matsuda.

File bug11419.patch added

Attached is a reproducing test case.

----------------------------------------
Bug #11419: super_method segfaults when looking for a super_method of Object's UnboundMethod
https://bugs.ruby-lang.org/issues/11419#change-53676

* Author: Akira Matsuda
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.3.0dev (2015-08-06 trunk 51500) [x86_64-darwin14]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
This code segfaults on 2.3 trunk (does not segfault on 2.2 stable):

~~~
% ruby -e 'Object.instance_method(:tap).super_method'
-e:1: [BUG] Segmentation fault at 0x00000000000010
ruby 2.3.0dev (2015-08-06 trunk 51500) [x86_64-darwin14]

-- Crash Report log information --------------------------------------------
   See Crash Report log file under the one of following:                    
     * ~/Library/Logs/CrashReporter                                         
     * /Library/Logs/CrashReporter                                          
     * ~/Library/Logs/DiagnosticReports                                     
     * /Library/Logs/DiagnosticReports                                      
   for more details.                                                        
Don't forget to include the above Crash Report log file in bug reports.     

-- Control frame information -----------------------------------------------
c:0003 p:---- s:0007 e:000006 CFUNC  :super_method
c:0002 p:0015 s:0004 E:001a30 EVAL   -e:1 [FINISH]
c:0001 p:0000 s:0002 E:001a10 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
-e:1:in `<main>'
-e:1:in `super_method'

-- Machine register context ------------------------------------------------
 rax: 0x00007ff61b0e05d8 rbx: 0x00007ff61afddb40 rcx: 0x0000000000000000
 rdx: 0x0000000000000000 rdi: 0x00007ff61c0aea28 rsi: 0x0000000101d95e18
 rbp: 0x00007fff5e094100 rsp: 0x00007fff5e0940d0  r8: 0x00007ff61ac094c8
  r9: 0x0000000000000dda r10: 0x0000000000000001 r11: 0x000000000000000d
 r12: 0x00007ff61c0aea28 r13: 0x0000000101f8ff80 r14: 0x00007ff61c0aea28
 r15: 0x00007ff61ac09120 rip: 0x0000000101bc0148 rfl: 0x0000000000010206

-- C level backtrace information -------------------------------------------
0   ruby                                0x0000000101d06474 rb_vm_bugreport + 388
1   ruby                                0x0000000101baf0a9 rb_bug_context + 473
2   ruby                                0x0000000101c7faa3 sigsegv + 83
3   libsystem_platform.dylib            0x00007fff965cff1a _sigtramp + 26
4   ruby                                0x0000000101bc0148 method_super_method + 40
5   ???                                 0x0000000000000000 0x0 + 0

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

* Loaded script: -e

* Loaded features:

    0 enumerator.so
    1 rational.so
    2 complex.so
    3 /Users/a_matsuda/.rbenv/versions/2.3.0-dev/lib/ruby/2.3.0/x86_64-darwin14/enc/encdb.bundle
    4 /Users/a_matsuda/.rbenv/versions/2.3.0-dev/lib/ruby/2.3.0/x86_64-darwin14/enc/trans/transdb.bundle
    5 /Users/a_matsuda/.rbenv/versions/2.3.0-dev/lib/ruby/2.3.0/unicode_normalize.rb
    6 /Users/a_matsuda/.rbenv/versions/2.3.0-dev/lib/ruby/2.3.0/x86_64-darwin14/rbconfig.rb
    7 thread.rb
    8 /Users/a_matsuda/.rbenv/versions/2.3.0-dev/lib/ruby/2.3.0/x86_64-darwin14/thread.bundle
    9 /Users/a_matsuda/.rbenv/versions/2.3.0-dev/lib/ruby/2.3.0/rubygems/compatibility.rb
   10 /Users/a_matsuda/.rbenv/versions/2.3.0-dev/lib/ruby/2.3.0/rubygems/defaults.rb
   11 /Users/a_matsuda/.rbenv/versions/2.3.0-dev/lib/ruby/2.3.0/rubygems/deprecate.rb
   12 /Users/a_matsuda/.rbenv/versions/2.3.0-dev/lib/ruby/2.3.0/rubygems/errors.rb
   13 /Users/a_matsuda/.rbenv/versions/2.3.0-dev/lib/ruby/2.3.0/rubygems/version.rb
   14 /Users/a_matsuda/.rbenv/versions/2.3.0-dev/lib/ruby/2.3.0/rubygems/requirement.rb
   15 /Users/a_matsuda/.rbenv/versions/2.3.0-dev/lib/ruby/2.3.0/rubygems/platform.rb
   16 /Users/a_matsuda/.rbenv/versions/2.3.0-dev/lib/ruby/2.3.0/rubygems/basic_specification.rb
   17 /Users/a_matsuda/.rbenv/versions/2.3.0-dev/lib/ruby/2.3.0/rubygems/stub_specification.rb
   18 /Users/a_matsuda/.rbenv/versions/2.3.0-dev/lib/ruby/2.3.0/rubygems/util/list.rb
   19 /Users/a_matsuda/.rbenv/versions/2.3.0-dev/lib/ruby/2.3.0/x86_64-darwin14/stringio.bundle
   20 /Users/a_matsuda/.rbenv/versions/2.3.0-dev/lib/ruby/2.3.0/rubygems/specification.rb
   21 /Users/a_matsuda/.rbenv/versions/2.3.0-dev/lib/ruby/2.3.0/rubygems/exceptions.rb
   22 /Users/a_matsuda/.rbenv/versions/2.3.0-dev/lib/ruby/2.3.0/rubygems/core_ext/kernel_gem.rb
   23 /Users/a_matsuda/.rbenv/versions/2.3.0-dev/lib/ruby/2.3.0/monitor.rb
   24 /Users/a_matsuda/.rbenv/versions/2.3.0-dev/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb
   25 /Users/a_matsuda/.rbenv/versions/2.3.0-dev/lib/ruby/2.3.0/rubygems.rb
~~~

Not only :tap but other instance methods defined on Object such as :object_id, :clone also segfaults in the same way.

OTOH, these **do not** segfault.

~~~
% ruby -e 'Object.new.method(:tap).super_method'
% ruby -e 'Object.instance_method(:==).super_method'
% ruby -e 'String.instance_method(:reverse).super_method'
% ruby -e 'Class.new { def foo() end }.instance_method(:foo).super_method'
~~~

---Files--------------------------------
bug11419.patch (933 Bytes)


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