I have found a reproducible code snippet which causes a ruby core dump. It
doesn’t affect 1.7.3 and I can’t get it to happen on my linux box. Only ruby
1.6.8 running on FreeBSD 4.7-stable. I am attaching a sample code snippet
and a gdb backtrace. If you need any other info, please let me know.
In case you’re curious about the code snippet, I am working with FastCGI and
found the problem when testing multipart form POST’s. FWIW, if I change
cgi.rb around line 851 where it defines “def body.original_filename” so the
“filename” variable is defined before the eval() block, I no longer get a
core dump.
Thanks,
-Brad
P.S. Please CC me as I’m not subscribed to the ruby-talk list.
Ruby version: ruby 1.6.8 (2002-12-09) [i386-freebsd4]
Backtrace:
#0 0x2817d674 in kill () from /usr/lib/libc.so.4
#1 0x281be19e in abort () from /usr/lib/libc.so.4
#2 0x2807dc6a in rb_bug (fmt=0x280fe0d0 “Segmentation fault”) at error.c:179
#3 0x280da719 in sigsegv (sig=11) at signal.c:393
#4 0xbfbfffac in ?? ()
#5 0x28087f29 in rb_yield (val=135363904) at eval.c:3732
#6 0x280e01df in rb_str_sub_bang (argc=1, argv=0xbfbfc364, str=135363964)
at string.c:1172
#7 0x280e033b in rb_str_sub (argc=1, argv=0xbfbfc364, str=135364224)
at string.c:1207
#8 0x28089627 in call_cfunc (func=0x280e0308 <rb_str_sub>, recv=135364224,
len=-1, argc=1, argv=0xbfbfc364) at eval.c:4279
#9 0x28089c26 in rb_call0 (klass=134720684, recv=135364224, id=4233, argc=1,
argv=0xbfbfc364, body=0x807a3c4, nosuper=1) at eval.c:4416
#10 0x2808a494 in rb_call (klass=134720684, recv=135364224, mid=4233, argc=1,
argv=0xbfbfc364, scope=0) at eval.c:4640
#11 0x28084b08 in rb_eval (self=135367024, n=0x805d33c) at eval.c:2572
#12 0x28083a08 in rb_eval (self=135367024, n=0x805d0f8) at eval.c:2304
#13 0x28085523 in rb_eval (self=135367024, n=0x805d0e4) at eval.c:2724
#14 0x28082f87 in rb_eval (self=135367024, n=0x805e598) at eval.c:2053
#15 0x280837bf in rb_eval (self=135367024, n=0x805c450) at eval.c:2267
#16 0x28082f87 in rb_eval (self=135367024, n=0x805f218) at eval.c:2053
#17 0x2808a05b in rb_call0 (klass=135366944, recv=135367024, id=9209, argc=0,
argv=0xbfbfd63c, body=0x805f218, nosuper=0) at eval.c:4547
#18 0x2808a494 in rb_call (klass=135366944, recv=135367024, mid=9209, argc=2,
argv=0xbfbfd634, scope=1) at eval.c:4640
#19 0x28084b08 in rb_eval (self=135367024, n=0x805b578) at eval.c:2572
#20 0x280855f7 in rb_eval (self=135367024, n=0x805aed4) at eval.c:2744
#21 0x28082f87 in rb_eval (self=135367024, n=0x805ad30) at eval.c:2053
#22 0x2808a05b in rb_call0 (klass=135366944, recv=135367024, id=9321, argc=0,
argv=0x0, body=0x805ad30, nosuper=0) at eval.c:4547
#23 0x2808a494 in rb_call (klass=135366944, recv=135367024, mid=9321, argc=0,
argv=0x0, scope=1) at eval.c:4640
#24 0x28084b08 in rb_eval (self=135367024, n=0x81247d4) at eval.c:2572
#25 0x28082f87 in rb_eval (self=135367024, n=0x8124234) at eval.c:2053
#26 0x28082f87 in rb_eval (self=135367024, n=0x8124b30) at eval.c:2053
#27 0x2808a05b in rb_call0 (klass=135409004, recv=135367024, id=2865, argc=0,
argv=0x0, body=0x8124b30, nosuper=0) at eval.c:4547
#28 0x2808a494 in rb_call (klass=135409004, recv=135367024, mid=2865, argc=0,
argv=0x0, scope=1) at eval.c:4640
#29 0x2808a7a5 in rb_funcall2 (recv=135367024, mid=2865, argc=0, argv=0x0)
at eval.c:4724
#30 0x2808cc96 in rb_obj_call_init (obj=135367024, argc=0, argv=0x0)
at eval.c:5722
#31 0x2808cd0c in rb_class_new_instance (argc=0, argv=0x0, klass=135409004)
#32 0x28089627 in call_cfunc (func=0x2808ccb0 <rb_class_new_instance>,
recv=135409004, len=-1, argc=0, argv=0x0) at eval.c:4279
#33 0x28089c26 in rb_call0 (klass=134728944, recv=135409004, id=3177, argc=0,
argv=0x0, body=0x807bddc, nosuper=1) at eval.c:4416
#34 0x2808a494 in rb_call (klass=134728944, recv=135409004, mid=3177, argc=0,
argv=0x0, scope=0) at eval.c:4640
#35 0x28084b08 in rb_eval (self=134724824, n=0x806eb8c) at eval.c:2572
#36 0x2808558f in rb_eval (self=134724824, n=0x806ec04) at eval.c:2734
#37 0x28087c77 in rb_yield_0 (val=3, self=134724824, klass=0, acheck=0)
at eval.c:3644
#38 0x28087f29 in rb_yield (val=3) at eval.c:3732
#39 0x280abcc6 in fix_dotimes (num=5) at numeric.c:1535
#40 0x28089635 in call_cfunc (func=0x280abc98 <fix_dotimes>, recv=5, len=0,
argc=0, argv=0x0) at eval.c:4282
#41 0x28089c26 in rb_call0 (klass=134707504, recv=5, id=5625, argc=0,
argv=0x0, body=0x8077390, nosuper=1) at eval.c:4416
#42 0x2808a494 in rb_call (klass=134707504, recv=5, mid=5625, argc=0,
argv=0x0, scope=0) at eval.c:4640
#43 0x28084b08 in rb_eval (self=134724824, n=0x806ef24) at eval.c:2572
#44 0x28083a08 in rb_eval (self=134724824, n=0x806f474) at eval.c:2304
#45 0x280808bf in eval_node (self=134724824, node=0x806f474) at eval.c:1085
#46 0x28080d8a in ruby_run () at eval.c:1230
#47 0x80485ca in main (argc=2, argv=0xbfbffbb0, envp=0xbfbffbbc) at main.c:50
#48 0x8048509 in _start ()
expose-bug.rb.gz (535 Bytes)