Bugs item #6369, was opened at 2006-10-27 22:55
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1698&aid=6369&group_id=426

Category: Core
Group: 1.9.x
Status: Open
Resolution: None
Priority: 3
Submitted By: Paul Brannan (cout)
Assigned to: Nobody (None)
Summary: core dump using mkmf

Initial Comment:
I have a script extconf.rb:

cout@bean:~$ cat extconf.rb 
require 'mkmf'

And when I run it I get a core dump:

cout@bean:~$ ruby1.9 extconf.rb 
extconf.rb:1: [BUG] not a node 0x07 (0x40218ac8)
ruby 1.9.0 (2006-10-20) [i686-linux]

Aborted (core dumped)

The bug seems to be due to memory corruption.  Changing the name of the script from extconf.rb to test.rb causes the script to run correctly.

I'm not sure exactly when I started seeing the problem, but I believe it was no earlier than a few months ago.

The backtrace:

(gdb) bt
#0  0x400a483b in raise () from /lib/tls/libc.so.6
#1  0x400a5fa2 in abort () from /lib/tls/libc.so.6
#2  0x0810fa02 in rb_bug (fmt=0x8113307 "not a node 0x%02lx (%p)") at error.c:167
#3  0x080596ac in unknown_node (node=0x40218ac8) at eval.c:2687
#4  0x0805e2e5 in rb_eval (self=1075708260, n=0x40218ac8) at eval.c:3956
#5  0x0805ff2c in rb_yield_0 (val=1075826580, self=1075708260, klass=0, flags=3) at eval.c:4851
#6  0x08068944 in proc_invoke (proc=1075826640, args=1075826580, self=6, klass=0, call=1) at eval.c:8495
#7  0x08066b0c in call_end_proc (data=1075826640) at eval.c:7691
#8  0x08066d79 in rb_exec_end_proc () at eval.c:7769
#9  0x08057156 in ruby_finalize_0 () at eval.c:1521
#10 0x08057243 in ruby_cleanup (ex=0) at eval.c:1551
#11 0x08057422 in ruby_stop (ex=0) at eval.c:1606
#12 0x08057471 in ruby_run () at eval.c:1618
#13 0x08054b5b in main (argc=2, argv=0xbffffaa4, envp=0xbffffab0) at main.c:43

Other relevant information:

(gdb) frame 6
#6  0x08068944 in proc_invoke (proc=1075826640, args=1075826580, self=6, klass=0, call=1) at eval.c:8495
8495		result = rb_yield_0(args, self, (self!=Qundef)?CLASS_OF(self):0, pcall);
(gdb) p *_block->body
$11 = {flags = 32775, nd_file = 0x401dcb7c "\003", u1 = {node = 0x73677261, id = 1936159329, value = 1936159329, 
    cfunc = 0x73677261, tbl = 0x73677261}, u2 = {node = 0x0, id = 0, argc = 0, value = 0}, u3 = {node = 0x0, id = 0, 
    state = 0, entry = 0x0, cnt = 0, value = 0}}
(gdb) frame 5
#5  0x0805ff2c in rb_yield_0 (val=1075826580, self=1075708260, klass=0, flags=3) at eval.c:4851
4851		    result = rb_eval(self, node);
(gdb) p *node
$12 = {flags = 32775, nd_file = 0x401dcb7c "\003", u1 = {node = 0x73677261, id = 1936159329, value = 1936159329, 
    cfunc = 0x73677261, tbl = 0x73677261}, u2 = {node = 0x0, id = 0, argc = 0, value = 0}, u3 = {node = 0x0, id = 0, 
    state = 0, entry = 0x0, cnt = 0, value = 0}}
(gdb) p node->flags>>15
$13 = 1
(gdb) p node->flags & (0x7f<<8)>>8
$14 = 7

Running ruby under valgrind does not appear to provide any additional information.

I tried building with optimizations disabled, but the problem did not go away.


----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1698&aid=6369&group_id=426