Backport #3702
closedsegmentation fault while compiling 1.9.1-p430 on debian squeeze
Description
=begin
gcc -shared -Wl,-soname,libruby-1.9.1.so.1.9 dln.o encoding.o array.o bignum.o class.o compar.o complex.o dir.o enum.o enumerator.o error.o eval.o load.o proc.o file.o gc.o hash.o inits.o io.o marshal.o math.o numeric.o object.o pack.o parse.o process.o random.o range.o rational.o re.o regcomp.o regenc.o regerror.o regexec.o regparse.o regsyntax.o ruby.o safe.o signal.o sprintf.o st.o strftime.o string.o struct.o time.o transcode.o util.o variable.o version.o compile.o debug.o iseq.o vm.o vm_dump.o thread.o cont.o ascii.o us_ascii.o unicode.o utf_8.o newline.o strlcpy.o strlcat.o prelude.o dmyext.o -lpthread -lrt -ldl -lcrypt -lm -o libruby-1.9.1.so.1.9.1
objcopy -w -L 'Init_*' libruby-1.9.1.so.1.9.1
./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb ./tool/generic_erb.rb -c -o encdb.h ./template/encdb.h.tmpl ./enc enc
/srv/ruby/c/ruby1.9.1_1.9.1.p430/lib/optparse.rb:1258: [BUG] Segmentation fault
ruby 1.9.1p430 (2010-08-16 revision 28998) [i486-linux]
-- control frame ----------
c:0010 p:---- s:0048 b:0048 l:000047 d:000047 CFUNC :catch
c:0009 p:0062 s:0044 b:0044 l:0007d0 d:0007d0 METHOD /srv/ruby/c/ruby1.9.1_1.9.1.p430/lib/optparse.rb:1258
c:0008 p:0024 s:0034 b:0034 l:000033 d:000033 METHOD /srv/ruby/c/ruby1.9.1_1.9.1.p430/lib/optparse.rb:1252
c:0007 p:0066 s:0029 b:0029 l:0007ec d:0024d8 BLOCK ./tool/generic_erb.rb:12
c:0006 p:0116 s:0026 b:0026 l:000025 d:000025 METHOD /srv/ruby/c/ruby1.9.1_1.9.1.p430/lib/optparse.rb:793
c:0005 p:---- s:0020 b:0020 l:000019 d:000019 FINISH
c:0004 p:---- s:0018 b:0018 l:000017 d:000017 CFUNC :new
c:0003 p:0069 s:0015 b:0015 l:0007ec d:0021a8 EVAL ./tool/generic_erb.rb:8
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:0007ec d:0007ec TOP
-- Ruby level backtrace information-----------------------------------------
/srv/ruby/c/ruby1.9.1_1.9.1.p430/lib/optparse.rb:1258:in catch' /srv/ruby/c/ruby1.9.1_1.9.1.p430/lib/optparse.rb:1258:in
parse_in_order'
/srv/ruby/c/ruby1.9.1_1.9.1.p430/lib/optparse.rb:1252:in order!' ./tool/generic_erb.rb:12:in
block in '
/srv/ruby/c/ruby1.9.1_1.9.1.p430/lib/optparse.rb:793:in initialize' ./tool/generic_erb.rb:8:in
new'
./tool/generic_erb.rb:8:in `'
-- C level backtrace information -------------------------------------------
0x816c8a0 ./miniruby(rb_vm_bugreport+0x60) [0x816c8a0]
0x8086961 ./miniruby() [0x8086961]
0x80869fa ./miniruby(rb_bug+0x3a) [0x80869fa]
0x8112a4c ./miniruby() [0x8112a4c]
0x55572410 [0x55572410]
0x8159428 ./miniruby() [0x8159428]
0x8159794 ./miniruby() [0x8159794]
0x8165934 ./miniruby() [0x8165934]
0x8160013 ./miniruby() [0x8160013]
0x81634e6 ./miniruby() [0x81634e6]
0x815c3fd ./miniruby() [0x815c3fd]
0x815cac5 ./miniruby(rb_funcall2+0x55) [0x815cac5]
0x8088060 ./miniruby(rb_obj_call_init+0x50) [0x8088060]
0x80bd98a ./miniruby(rb_class_new_instance+0x3a) [0x80bd98a]
0x8159428 ./miniruby() [0x8159428]
0x8159794 ./miniruby() [0x8159794]
0x8165934 ./miniruby() [0x8165934]
0x8160013 ./miniruby() [0x8160013]
0x81634e6 ./miniruby() [0x81634e6]
0x816375b ./miniruby(rb_iseq_eval_main+0xab) [0x816375b]
0x8088cf7 ./miniruby(ruby_exec_node+0xb7) [0x8088cf7]
0x808a2f6 ./miniruby(ruby_run_node+0x56) [0x808a2f6]
0x805cee8 ./miniruby(main+0x68) [0x805cee8]
0x55612c76 /lib/i686/cmov/libc.so.6(__libc_start_main+0xe6) [0x55612c76]
0x805cde1 ./miniruby() [0x805cde1]
[NOTE]
You may encounter a bug of Ruby interpreter. Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
make[1]: *** [encdb.h] Aborted
make[1]: Leaving directory `/srv/ruby/c/ruby1.9.1_1.9.1.p430'
make: *** [debian/stamp-makefile-build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
I can reproduce this at any time, ping me with patches so we can solve this.
=end