Project

General

Profile

Backport #2597

Crash in p248 while installing gem

Added by AlekSi (Aleksey Palazhchenko) over 9 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
[ruby-core:27561]

Description

=begin
This crash isn't always reproducible, but it hits me several times. It's doesn't looks like other filled issues, but maybe it's related to #2557.
Also it seems to be p248 specific.

(gdb) run -dv -S gem install metric_fu
Starting program: /Users/AlekSi/.rvm/ruby-1.8.7-p248/bin/ruby -dv -S gem install metric_fu
Reading symbols for shared libraries +++... done
ruby 1.8.7 (2009-12-24 patchlevel 248) [i686-darwin9.8.0]
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Exception LoadError' at /Users/AlekSi/.rvm/ruby-1.8.7-p248/lib/ruby/site_ruby/1.8/rubygems.rb:1113 - no such file to load -- rubygems/defaults/operating_system
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Exception
NoMethodError' at /Users/AlekSi/.rvm/ruby-1.8.7-p248/lib/ruby/1.8/rational.rb:78 - undefined method gcd' for Rational(1, 2):Rational
Exception
LoadError' at /Users/AlekSi/.rvm/ruby-1.8.7-p248/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:34 - no such file to load -- Win32API
Exception NameError' at /Users/AlekSi/.rvm/ruby-1.8.7-p248/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:161 - uninitialized constant Gem::Commands::InstallCommand
Reading symbols for shared libraries ... done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
/Users/AlekSi/.rvm/ruby-1.8.7-p248/lib/ruby/1.8/pathname.rb:263: warning:
*' interpreted as argument prefix
Reading symbols for shared libraries .. done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Exception `Gem::LoadError' at /Users/AlekSi/.rvm/ruby-1.8.7-p248/lib/ruby/site_ruby/1.8/rubygems.rb:827 - Could not find RubyGem test-unit (>= 0)

Exception Errno::EEXIST' at /Users/AlekSi/.rvm/ruby-1.8.7-p248/lib/ruby/1.8/fileutils.rb:243 - File exists - /Users/AlekSi/.gem/specs/gemcutter.org%80
Exception
Errno::EEXIST' at /Users/AlekSi/.rvm/ruby-1.8.7-p248/lib/ruby/1.8/fileutils.rb:243 - File exists - /Users/AlekSi/.gem/specs/gems.rubyforge.org%80
Exception `Errno::EEXIST' at /Users/AlekSi/.rvm/ruby-1.8.7-p248/lib/ruby/1.8/fileutils.rb:243 - File exists - /Users/AlekSi/.gem/specs/gemcutter.org%80

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0xc000000f
0x0008da01 in str_independent (str=3221225475) at string.c:486
486 if (RSTRING(str)->ptr == null_str) return 0;
(gdb) bt
#0 0x0008da01 in str_independent (str=3221225475) at string.c:486
#1 0x0008db11 in rb_str_modify (str=3221225475) at string.c:511
#2 0x0008dfcf in str_buf_cat (str=3221225475, ptr=0xbfff612c "U?\004", len=1) at string.c:727
#3 0x0004ae90 in w_nbyte (s=, n=, arg=0x1d2d510) at marshal.c:158
#4 0x0004af08 in w_byte (c=85 'U', arg=) at marshal.c:171
#5 0x0004cecd in w_class (type=85, obj=, arg=0x1d2d510, check=0) at marshal.c:432
#6 0x0004d0a5 in w_object (obj=30594320, arg=0x1d2d510, limit=-4) at marshal.c:539
#7 0x0004d49f in w_object (obj=, arg=0x1d2d510, limit=-3) at marshal.c:637
#8 0x0004d49f in w_object (obj=, arg=0x1d2d510, limit=-2) at marshal.c:637
#9 0x0004dc77 in marshal_dump (argc=2, argv=0xaa208) at marshal.c:796
#10 0x0001aa35 in call_cfunc (func=0x4db20 , recv=1223100, len=, argc=2, argv=0xbfff67a0) at eval.c:5778
#11 0x0002497e in rb_call0 (klass=1223040, recv=1223100, id=4577, oid=4577, argc=140556, argv=0xbfff67a0, body=0x12a96c, flags=) at eval.c:5928
#12 0x0002561c in rb_call (klass=1223040, recv=1223100, mid=4577, argc=2, argv=0xbfff67a0, scope=0, self=6966860) at eval.c:6176
#13 0x00022fd7 in rb_eval (self=6966860, n=) at eval.c:3506
#14 0x0002a321 in rb_yield_0 (val=, self=6966860, klass=0, flags=6379620, avalue=0) at eval.c:5095
#15 0x0002b4b1 in rb_yield (val=696840) at eval.c:5179
#16 0x0001a5c9 in rb_ensure (b_proc=0x2b490 , data1=46696460, e_proc=0x43720 , data2=46696460) at eval.c:5571
#17 0x000449d6 in rb_io_s_open (argc=696840, argv=0xaa208, klass=696840) at io.c:3469
#18 0x00044b36 in rb_f_open (argc=2, argv=0x2c8880c) at io.c:3611
#19 0x0001aa35 in call_cfunc (func=0x44af0 , recv=6966860, len=, argc=46696460, argv=0x2) at eval.c:5778
#20 0x0002497e in rb_call0 (klass=1293460, recv=6966860, id=7385, oid=7385, argc=6360080, argv=0xbfff6ef0, body=0x131ce4, flags=) at eval.c:5928
#21 0x0002561c in rb_call (klass=1293460, recv=6966860, mid=7385, argc=2, argv=0xbfff6ef0, scope=1, self=6966860) at eval.c:6176
#22 0x00021ff1 in rb_eval (self=, n=) at eval.c:3521
#23 0x000243d1 in rb_eval (self=6966860, n=) at eval.c:3236
#24 0x00023bcb in rb_eval (self=6966860, n=) at eval.c:3322
#25 0x000252c0 in rb_call0 (klass=6376580, recv=6966860, id=32273, oid=32273, argc=7447080, argv=0xbfff78c8, body=0x61641c, flags=) at eval.c:6079
#26 0x0002561c in rb_call (klass=6376580, recv=6966860, mid=32273, argc=2, argv=0xbfff78c0, scope=1, self=6966860) at eval.c:6176
#27 0x00021ff1 in rb_eval (self=, n=) at eval.c:3521
#28 0x0002191a in rb_eval (self=6966860, n=) at eval.c:3483
#29 0x0002a321 in rb_yield_0 (val=, self=6966860, klass=0, flags=6384640, avalue=0) at eval.c:5095
#30 0x0002b4b1 in rb_yield (val=696840) at eval.c:5179
#31 0x000026af in rb_ary_each (ary=6982780) at array.c:1261
#32 0x0002497e in rb_call0 (klass=1263240, recv=6982780, id=4001, oid=4001, argc=-1073774504, argv=0x0, body=0x134264, flags=) at eval.c:5928
#33 0x0002561c in rb_call (klass=1263240, recv=6982780, mid=4001, argc=0, argv=0x0, scope=0, self=6966860) at eval.c:6176
#34 0x00022fd7 in rb_eval (self=6966860, n=) at eval.c:3506
#35 0x000243d1 in rb_eval (self=6966860, n=) at eval.c:3236
#36 0x000252c0 in rb_call0 (klass=6376580, recv=6966860, id=5369, oid=5369, argc=26374280, argv=0xbfff8888, body=0x6172cc, flags=) at eval.c:6079
#37 0x0002561c in rb_call (klass=6376580, recv=6966860, mid=5369, argc=2, argv=0xbfff8880, scope=1, self=6966860) at eval.c:6176
#38 0x00021ff1 in rb_eval (self=, n=) at eval.c:3521
#39 0x00022eec in rb_eval (self=6966860, n=) at eval.c:3500
#40 0x000243d1 in rb_eval (self=6966860, n=) at eval.c:3236
#41 0x000252c0 in rb_call0 (klass=6376580, recv=6966860, id=13817, oid=13817, argc=1085864, argv=0xbfff9240, body=0x618348, flags=) at eval.c:6079
#42 0x0002561c in rb_call (klass=6376580, recv=6966860, mid=13817, argc=4, argv=0xbfff9230, scope=1, self=6966860) at eval.c:6176
#43 0x00021ff1 in rb_eval (self=, n=) at eval.c:3521
#44 0x00022cea in rb_eval (self=6966860, n=) at eval.c:3691
#45 0x00023bcb in rb_eval (self=6966860, n=) at eval.c:3322
#46 0x000252c0 in rb_call0 (klass=6376580, recv=6966860, id=6609, oid=6609, argc=1586800, argv=0xbfff9bf0, body=0x619748, flags=) at eval.c:6079
#47 0x0002561c in rb_call (klass=6376580, recv=6966860, mid=6609, argc=4, argv=0xbfff9be0, scope=0, self=6968480) at eval.c:6176
#48 0x00022fd7 in rb_eval (self=6968480, n=) at eval.c:3506
#49 0x00022cea in rb_eval (self=6968480, n=) at eval.c:3691
#50 0x00023bcb in rb_eval (self=6968480, n=) at eval.c:3322
#51 0x000252c0 in rb_call0 (klass=6402480, recv=6968480, id=29129, oid=29129, argc=0, argv=0xbfffa594, body=0x670df4, flags=) at eval.c:6079
#52 0x0002561c in rb_call (klass=6402480, recv=6968480, mid=29129, argc=1, argv=0xbfffa590, scope=1, self=6968480) at eval.c:6176
#53 0x00021ff1 in rb_eval (self=, n=) at eval.c:3521
#54 0x00022eec in rb_eval (self=6968480, n=) at eval.c:3500
#55 0x00023356 in dvar_asgn_curr inlined at eval.c:3701
#56 0x00023356 in rb_eval (self=6968480, n=) at eval.c:3702
#57 0x0002a321 in rb_yield_0 (val=, self=6968480, klass=0, flags=6746860, avalue=0) at eval.c:5095
#58 0x0002b4b1 in rb_yield (val=696840) at eval.c:5179
#59 0x000026c3 in rb_ary_each (ary=27630040) at array.c:1261
#60 0x0002497e in rb_call0 (klass=1263240, recv=27630040, id=4001, oid=4001, argc=134283, argv=0x0, body=0x134264, flags=) at eval.c:5928
#61 0x0002561c in rb_call (klass=1263240, recv=27630040, mid=4001, argc=0, argv=0x0, scope=0, self=6968480) at eval.c:6176
#62 0x00022fd7 in rb_eval (self=6968480, n=) at eval.c:3506
#63 0x000243d1 in rb_eval (self=6968480, n=) at eval.c:3236
#64 0x00021471 in rb_eval (self=6968480, n=) at eval.c:3195
#65 0x000219ce in rb_eval (self=6968480, n=) at eval.c:2975
#66 0x000252c0 in rb_call0 (klass=6402480, recv=6968480, id=29185, oid=29185, argc=0, argv=0x0, body=0x66fddc, flags=) at eval.c:6079
#67 0x0002561c in rb_call (klass=6402480, recv=6968480, mid=29185, argc=0, argv=0x0, scope=2, self=6968480) at eval.c:6176
#68 0x00023188 in rb_eval (self=, n=) at eval.c:3527
#69 0x000252c0 in rb_call0 (klass=6402480, recv=6968480, id=20217, oid=20217, argc=-1073758056, argv=0xbfffc1a8, body=0x66d974, flags=) at eval.c:6079
#70 0x0002561c in rb_call (klass=6402480, recv=6968480, mid=20217, argc=2, argv=0xbfffc1a0, scope=0, self=7256140) at eval.c:6176
#71 0x00022fd7 in rb_eval (self=7256140, n=) at eval.c:3506
#72 0x00023bcb in rb_eval (self=7256140, n=) at eval.c:3322
#73 0x0002a321 in rb_yield_0 (val=, self=7256140, klass=0, flags=6969420, avalue=0) at eval.c:5095
#74 0x0002b4b1 in rb_yield (val=696840) at eval.c:5179
#75 0x000026af in rb_ary_each (ary=6968500) at array.c:1261
#76 0x0002497e in rb_call0 (klass=1263240, recv=6968500, id=4001, oid=4001, argc=7012180, argv=0x0, body=0x134264, flags=) at eval.c:5928
#77 0x0002561c in rb_call (klass=1263240, recv=6968500, mid=4001, argc=0, argv=0x0, scope=0, self=7256140) at eval.c:6176
#78 0x00022fd7 in rb_eval (self=7256140, n=) at eval.c:3506
#79 0x000243d1 in rb_eval (self=7256140, n=) at eval.c:3236
#80 0x000252c0 in rb_call0 (klass=7265220, recv=7256140, id=21281, oid=21281, argc=5543840, argv=0x0, body=0x6a6404, flags=) at eval.c:6079
#81 0x0002561c in rb_call (klass=7265220, recv=7256140, mid=21281, argc=0, argv=0x0, scope=2, self=7256140) at eval.c:6176
#82 0x00023188 in rb_eval (self=, n=) at eval.c:3527
#83 0x000252c0 in rb_call0 (klass=7012280, recv=7256140, id=21009, oid=21009, argc=6984200, argv=0xbfffd5a0, body=0x6de598, flags=) at eval.c:6079
#84 0x0002561c in rb_call (klass=7012280, recv=7256140, mid=21009, argc=1, argv=0xbfffd5a0, scope=0, self=6984060) at eval.c:6176
#85 0x00022fd7 in rb_eval (self=6984060, n=) at eval.c:3506
#86 0x000252c0 in rb_call0 (klass=7009680, recv=6984060, id=20969, oid=20969, argc=31, argv=0xbfffda24, body=0x6e66e4, flags=) at eval.c:6079
#87 0x0002561c in rb_call (klass=7009680, recv=6984060, mid=20969, argc=1, argv=0xbfffda20, scope=1, self=6984060) at eval.c:6176
#88 0x00021ff1 in rb_eval (self=, n=) at eval.c:3521
#89 0x00023bcb in rb_eval (self=6984060, n=) at eval.c:3322
#90 0x000252c0 in rb_call0 (klass=7009680, recv=6984060, id=5393, oid=5393, argc=7245440, argv=0xbfffe134, body=0x6e6a90, flags=) at eval.c:6079
#91 0x0002561c in rb_call (klass=7009680, recv=6984060, mid=5393, argc=1, argv=0xbfffe130, scope=0, self=6984200) at eval.c:6176
#92 0x00022fd7 in rb_eval (self=6984200, n=) at eval.c:3506
#93 0x000252c0 in rb_call0 (klass=7009080, recv=6984200, id=5393, oid=5393, argc=-1073748760, argv=0xbfffe5d4, body=0x6e9df8, flags=) at eval.c:6079
#94 0x0002561c in rb_call (klass=7009080, recv=6984200, mid=5393, argc=1, argv=0xbfffe5d0, scope=0, self=1288520) at eval.c:6176
#95 0x00022fd7 in rb_eval (self=1288520, n=) at eval.c:3506
#96 0x00023bcb in rb_eval (self=1288520, n=) at eval.c:3322
#97 0x00032f57 in ruby_exec_internal () at eval.c:1654
#98 0x00032f96 in ruby_exec () at eval.c:1674
#99 0x00032fca in ruby_run () at eval.c:1684
#100 0x000018ed in main (argc=696840, argv=0xaa208, envp=0xbfffecf4) at main.c:48

=end


Related issues

Is duplicate of Backport187 - Backport #2557: Segmentation fault in Marshal.load in Rails' ActiveSupport in 1.8.7-p248 onlyClosed01/05/2010Actions

History

#1

Updated by AlekSi (Aleksey Palazhchenko) over 9 years ago

=begin
It's called from
rubygems/spec_fetcher.rb:245

Marshal.dump specs, io

=end

#2

Updated by AlekSi (Aleksey Palazhchenko) over 9 years ago

=begin
Can confirm this bug with p249.
=end

#3

Updated by hvolkmer (Hendrik Volkmer) over 9 years ago

=begin
I can also confirm this in p249.

It doesn't occur if I use this:

require 'rubygems'
require 'activesupport'
ActiveSupport::Multibyte::UnicodeDatabase.new.codepoints

However if I require the file directly the error occurs:

require '/opt/gems/activesupport-2.3.3/lib/active_support/multibyte/unicode_database.rb'

ActiveSupport::Multibyte::UnicodeDatabase.new.codepoints

This is just to reproduce the bug. It occures in a test run where it suddenly kills the rails server (mongrel).

I get this behaviour in the latest official 1.8.7 p243 as well the latest trunk (p249). p174 is fine.
=end

#4

Updated by nobu (Nobuyoshi Nakada) over 9 years ago

  • Status changed from Open to Assigned
  • Assignee set to shyouhei (Shyouhei Urabe)

=begin

=end

#5

Updated by lawrencepit (Lawrence Pit) over 9 years ago

=begin
I also confirm this in p249. I tried installing it from the tar ball and using rvm, both same result:

~> rvm install readline ; rvm remove 1.8.7 ; rvm install 1.8.7 -C --with-readline-dir=$rvm_path/usr

~ > gem install chronic
/Users/copawaves/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:245: [BUG] Segmentation fault
ruby 1.8.7 (2010-01-10 patchlevel 249) [i686-darwin9.8.0]

Abort trap
~ >

I installed p174 instead now which seems to work fine so far.
=end

#6

Updated by igal (Igal Koshevoy) over 9 years ago

=begin
Can confirm the segmentation faults using "ruby-1.8.7-p248". No segmentation faults using "ruby-1.8.7-p174". Running "i686-darwin8.11.1".
=end

#7

Updated by shyouhei (Shyouhei Urabe) over 9 years ago

  • Status changed from Assigned to Closed

=begin
This issue was solved with changeset r27408.
Rhett, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Also available in: Atom PDF