M
me2faster
I reduced the sample/test.rb to just the test_check "exception"
section, and discovered that rb_raise_jump() in eval.c is trying to
assign from _frame.prev or _frame.prev->prev, which have not been
memory allocated correctly. With the original source in place, the seg
fault occurs at:
*ruby_frame = *_frame.prev->prev;
if I break it down into member-to-member assignments, the seg fault
occurs at:
ruby_frame->tmp = (*_frame.prev->prev).tmp;
Here's the stack trace:
....
:c
Continuing.
exception
Breakpoint 2, rb_raise_jump (mesg=134598224)
at /home/ruby-1.8.2/eval.c:4475
4475 ruby_frame->tmp =
(*_frame.prev->prev).tmp;
:c
Continuing.
mytest.rb:30: [BUG] Segmentation fault
ruby 1.8.2 (2004-12-25) [nsr-nsk]
Process (3,994) received signal/trap type: 1 (number: 6)
:bt
#0 0xffffffffe101d900 in $n_EnterPriv ()
#1 0xffffffffe5071ef0 in raise ()
#2 0xffffffffe5072da0 in PK_ABORT_ ()
#3 0xffffffffff7dc100 in abort ()
#4 0x704018e0:0 in rb_bug (fmt=0x700313b0 "Segmentation fault")
at /home/ruby-1.8.2/error.c:214
#5 0x702f7690:0 in sigsegv (sig=11) at /home/ruby-1.8.2/signal.c:446
#6 0xffffffffe4419710 in $UD_S__SigHandlerJacket ()
#7 0x7006b050:1 in rb_raise_jump (mesg=134598224)
at /home/ruby-1.8.2/eval.c:4475
#8 0x7006a080:0 in rb_f_raise (argc=1, argv=0x80a7f00)
at /home/ruby-1.8.2/eval.c:4408
#9 0x70078440:0 in call_cfunc (func=0x8018590 <_initz+15808>,
recv=134672144,
len=-1, argc=1, argv=0x80a7f00) at /home/ruby-1.8.2/eval.c:5408
#10 0x7007f3a0:0 in rb_call0 (klass=134677928, recv=134672144, id=3953,
oid=3953, argc=1, argv=0x80a7f00, body=0x806e400, nosuper=0)
at /home/ruby-1.8.2/eval.c:5543
#11 0x700832e0:0 in rb_call (klass=134677928, recv=134672144, mid=3953,
argc=1, argv=0x80a7f00, scope=1) at /home/ruby-1.8.2/eval.c:5764
#12 0x7005a690:0 in rb_eval (self=134672144, n=0x805c538)
at /home/ruby-1.8.2/eval.c:3249
#13 0x70055bc0:0 in rb_eval (self=134672144, n=0x805d240)
at /home/ruby-1.8.2/eval.c:3041
me2faster at excite dot com
section, and discovered that rb_raise_jump() in eval.c is trying to
assign from _frame.prev or _frame.prev->prev, which have not been
memory allocated correctly. With the original source in place, the seg
fault occurs at:
*ruby_frame = *_frame.prev->prev;
if I break it down into member-to-member assignments, the seg fault
occurs at:
ruby_frame->tmp = (*_frame.prev->prev).tmp;
Here's the stack trace:
....
:c
Continuing.
exception
Breakpoint 2, rb_raise_jump (mesg=134598224)
at /home/ruby-1.8.2/eval.c:4475
4475 ruby_frame->tmp =
(*_frame.prev->prev).tmp;
:c
Continuing.
mytest.rb:30: [BUG] Segmentation fault
ruby 1.8.2 (2004-12-25) [nsr-nsk]
Process (3,994) received signal/trap type: 1 (number: 6)
:bt
#0 0xffffffffe101d900 in $n_EnterPriv ()
#1 0xffffffffe5071ef0 in raise ()
#2 0xffffffffe5072da0 in PK_ABORT_ ()
#3 0xffffffffff7dc100 in abort ()
#4 0x704018e0:0 in rb_bug (fmt=0x700313b0 "Segmentation fault")
at /home/ruby-1.8.2/error.c:214
#5 0x702f7690:0 in sigsegv (sig=11) at /home/ruby-1.8.2/signal.c:446
#6 0xffffffffe4419710 in $UD_S__SigHandlerJacket ()
#7 0x7006b050:1 in rb_raise_jump (mesg=134598224)
at /home/ruby-1.8.2/eval.c:4475
#8 0x7006a080:0 in rb_f_raise (argc=1, argv=0x80a7f00)
at /home/ruby-1.8.2/eval.c:4408
#9 0x70078440:0 in call_cfunc (func=0x8018590 <_initz+15808>,
recv=134672144,
len=-1, argc=1, argv=0x80a7f00) at /home/ruby-1.8.2/eval.c:5408
#10 0x7007f3a0:0 in rb_call0 (klass=134677928, recv=134672144, id=3953,
oid=3953, argc=1, argv=0x80a7f00, body=0x806e400, nosuper=0)
at /home/ruby-1.8.2/eval.c:5543
#11 0x700832e0:0 in rb_call (klass=134677928, recv=134672144, mid=3953,
argc=1, argv=0x80a7f00, scope=1) at /home/ruby-1.8.2/eval.c:5764
#12 0x7005a690:0 in rb_eval (self=134672144, n=0x805c538)
at /home/ruby-1.8.2/eval.c:3249
#13 0x70055bc0:0 in rb_eval (self=134672144, n=0x805d240)
at /home/ruby-1.8.2/eval.c:3041
me2faster at excite dot com