Bug #9461

Segfault

Added by Agis Anastasopoulos over 1 year ago. Updated over 1 year ago.

[ruby-core:60208]
Status:Closed
Priority:Normal
Assignee:Koichi Sasada
ruby -v:ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin12.0] Backport:1.9.3: DONTNEED, 2.0.0: DONTNEED, 2.1: UNKNOWN

Description

The following causes a segfault in 2.1.0, but works fine in 2.0 and 1.9:

module A
  def require(_)
    super
  end
end

class Object
  include A
end

['foo'].map(&method(:require))

Stack trace:

[BUG] Segmentation fault at 0x00000000000018
ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin12.0]
-- 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.
-- Control frame information -----------------------------------------------
c:0005 p:0010 s:0015 e:000012 METHOD test.rb:3 [FINISH]
c:0004 p:---- s:0009 e:000008 IFUNC
c:0003 p:---- s:0007 e:000006 CFUNC  :map
c:0002 p:0033 s:0004 E:001308 EVAL   test.rb:11 [FINISH]
c:0001 p:0000 s:0002 E:002488 TOP    [FINISH]
test.rb:11:in `<main>'
test.rb:11:in `map'
test.rb:3:in `require'
-- C level backtrace information -------------------------------------------
0   ruby                                0x00000001002ea5ed rb_vm_bugreport + 141
1   ruby                                0x00000001001b571d report_bug + 285
2   ruby                                0x00000001001b55f3 rb_bug + 179
3   ruby                                0x0000000100273d69 sigsegv + 153
4   libsystem_c.dylib                   0x00007fff8396590a _sigtramp + 26
5   ruby                                0x00000001002d8435 rb_method_entry_get_without_cache + 181
6   ???                                 0x0000000100a080f0 0x0 + 4305486064
-- Other runtime information -----------------------------------------------
* Loaded script: test.rb
* Loaded features:
0 enumerator.so
1 enc/encdb.so
2 enc/trans/transdb.so
3 /Users/agis/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/x86_64-darwin12.0/rbconfig.rb
4 /Users/agis/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/compatibility.rb
5 /Users/agis/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/defaults.rb
6 /Users/agis/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/deprecate.rb
7 /Users/agis/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/errors.rb
8 /Users/agis/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/version.rb
9 /Users/agis/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/requirement.rb
10 /Users/agis/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/platform.rb
11 /Users/agis/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/basic_specification.rb
12 /Users/agis/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/stub_specification.rb
13 /Users/agis/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/util/stringio.rb
14 /Users/agis/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb
15 /Users/agis/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/exceptions.rb
16 /Users/agis/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_gem.rb
17 thread.rb
18 thread.so
19 /Users/agis/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/monitor.rb
20 /Users/agis/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb
21 /Users/agis/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems.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: 6

Related issues

Duplicates Ruby trunk - Bug #9309: Crash while running tests Closed 12/27/2013

History

#1 Updated by Agis Anastasopoulos over 1 year ago

As I found out this is already reported (https://gist.github.com/tmm1/8393897#file-gistfile1-txt-L29-L32), so feel free to delete this.

#2 Updated by Nobuyoshi Nakada over 1 year ago

  • Related to Bug #9310: inheritance.rb: 27: [BUG] Segmentation fault at 0x00000c added

#3 Updated by Nobuyoshi Nakada over 1 year ago

  • Related to deleted (Bug #9310: inheritance.rb: 27: [BUG] Segmentation fault at 0x00000c)

#4 Updated by Nobuyoshi Nakada over 1 year ago

  • Duplicates Bug #9309: Crash while running tests added

#5 Updated by Nobuyoshi Nakada over 1 year ago

  • Status changed from Open to Closed

#6 Updated by Usaku NAKAMURA over 1 year ago

  • Backport changed from 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN to 1.9.3: DONTNEED, 2.0.0: DONTNEED, 2.1: UNKNOWN

Also available in: Atom PDF