On Jul 19, 2006, at 2:02 AM, [email protected] wrote:
This is a bug of ruby, not of irb. Could you show the
backtrace?
% gdb ./miniruby
GNU gdb 6.3.50-20050815 (Apple version gdb-477) (Sun Apr 30 20:01:44
GMT 2006)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type “show copying” to see the conditions.
There is absolutely no warranty for GDB. Type “show warranty” for
details.
This GDB was configured as “i386-apple-darwin”…Reading symbols for
shared libraries … done
(gdb) r ./runruby.rb --extout=.ext – ./bin/irb
Starting program: /Users/ryan/Work/cvs/ruby-lang/ruby18/miniruby ./
runruby.rb --extout=.ext – ./bin/irb
Reading symbols for shared libraries … done
Program received signal SIGTRAP, Trace/breakpoint trap.
0x8fe01010 in __dyld__dyld_start ()
(gdb) c
Continuing.
Reading symbols for shared libraries … done
irb(main):001:0> require ‘date’; def Date.name(explode);end; a=[]
=> []
irb(main):002:0> a.to_a.
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
0x00000000 in ?? ()
(gdb) bt
#0 0x00000000 in ?? ()
#1 0x001f6a0e in readline_readline (argc=2, argv=0xbfff5bb0,
self=1913860) at readline.c:86
#2 0x00004123 in call_cfunc (func=0x1f687a <readline_readline>,
recv=1913860, len=-1073784648, argc=2, argv=0xbfff5bb0) at eval.c:5620
#3 0x0000caab in rb_call0 (klass=3206620, recv=1913860, id=7057,
oid=7057, argc=2, argv=0xbfff5bb0, body=0x30f444, flags=2) at eval.c:
5776
#4 0x0000d540 in rb_call (klass=3206620, recv=1913860, mid=7057,
argc=2, argv=0xbfff5bb0, scope=1) at eval.c:6006
#5 0x0000a4f1 in rb_eval (self=1913860, n=0x4) at eval.c:3450
#6 0x0000adc5 in rb_eval (self=1913860, n=0x4) at eval.c:3616
#7 0x0000b60d in rb_eval (self=1913860, n=0x4) at eval.c:2994
#8 0x0000d1fb in rb_call0 (klass=3206720, recv=1913860, id=7049,
oid=7049, argc=0, argv=0x0, body=0x30fe58, flags=0) at eval.c:5912
#9 0x0000d540 in rb_call (klass=3206720, recv=1913860, mid=7049,
argc=0, argv=0x0, scope=0) at eval.c:6006
#10 0x0000b4e1 in rb_eval (self=1927380, n=0x4) at eval.c:3435
#11 0x0000ad88 in rb_eval (self=1927380, n=0x4) at eval.c:3626
#12 0x0000b60d in rb_eval (self=1927380, n=0x4) at eval.c:2994
#13 0x0001138b in rb_yield_0 (val=6, self=1927380, klass=0, flags=0,
avalue=0) at eval.c:4953
#14 0x0000b531 in rb_eval (self=1927380, n=0x4) at eval.c:3239
#15 0x0000c118 in rb_eval (self=1927380, n=0x4) at eval.c:3299
#16 0x0000d1fb in rb_call0 (klass=3185580, recv=1927380, id=10529,
oid=10529, argc=1, argv=0xbfff7550, body=0x1dea5c, flags=0) at eval.c:
5912
#17 0x0000d540 in rb_call (klass=3185580, recv=1927380, mid=10529,
argc=1, argv=0xbfff7550, scope=1) at eval.c:6006
#18 0x0000a4f1 in rb_eval (self=1927380, n=0x4) at eval.c:3450
#19 0x0000c3e9 in rb_eval (self=1927380, n=0x4) at eval.c:3163
#20 0x0001138b in rb_yield_0 (val=5787740, self=1927380, klass=0,
flags=0, avalue=2) at eval.c:4953
#21 0x00011d77 in proc_invoke (proc=3505740, args=5787740, self=6,
klass=0) at eval.c:8471
#22 0x0000caab in rb_call0 (klass=1993900, recv=3505740, id=5217,
oid=5217, argc=0, argv=0x0, body=0x1e6bf8, flags=0) at eval.c:5776
#23 0x0000d540 in rb_call (klass=1993900, recv=3505740, mid=5217,
argc=0, argv=0x0, scope=0) at eval.c:6006
#24 0x0000b4e1 in rb_eval (self=1913700, n=0x4) at eval.c:3435
#25 0x0000adc5 in rb_eval (self=1913700, n=0x4) at eval.c:3616
#26 0x0000d1fb in rb_call0 (klass=3314700, recv=1913700, id=13257,
oid=13257, argc=0, argv=0x0, body=0x34fa6c, flags=2) at eval.c:5912
#27 0x0000d540 in rb_call (klass=3314700, recv=1913700, mid=13257,
argc=0, argv=0x0, scope=2) at eval.c:6006
#28 0x0000b259 in rb_eval (self=1913700, n=0x4) at eval.c:3456
#29 0x0000b60d in rb_eval (self=1913700, n=0x4) at eval.c:2994
#30 0x0000957f in rb_eval (self=1913700, n=0x4) at eval.c:3087
#31 0x0000d1fb in rb_call0 (klass=3314700, recv=1913700, id=6993,
oid=6993, argc=0, argv=0x0, body=0x351a74, flags=0) at eval.c:5912
#32 0x0000d540 in rb_call (klass=3314700, recv=1913700, mid=6993,
argc=0, argv=0x0, scope=0) at eval.c:6006
#33 0x0000b4e1 in rb_eval (self=1896440, n=0x4) at eval.c:3435
#34 0x0000adc5 in rb_eval (self=1896440, n=0x4) at eval.c:3616
#35 0x00009cdf in rb_eval (self=1896440, n=0x4) at eval.c:2905
#36 0x0000d1fb in rb_call0 (klass=3315280, recv=1896440, id=14249,
oid=14249, argc=1, argv=0xbfff98b0, body=0x3319f4, flags=0) at eval.c:
5912
#37 0x0000d540 in rb_call (klass=3315280, recv=1896440, mid=14249,
argc=1, argv=0xbfff98b0, scope=0) at eval.c:6006
#38 0x0000b4e1 in rb_eval (self=1896760, n=0x4) at eval.c:3435
#39 0x0000addb in rb_eval (self=1896760, n=0x4) at eval.c:3379
#40 0x0000d1fb in rb_call0 (klass=3320120, recv=1896760, id=4273,
oid=4273, argc=1, argv=0xbfff9fc0, body=0x335b80, flags=0) at eval.c:
5912
#41 0x0000d540 in rb_call (klass=3320120, recv=1896760, mid=4273,
argc=1, argv=0xbfff9fc0, scope=0) at eval.c:6006
#42 0x0000b4e1 in rb_eval (self=1913700, n=0x4) at eval.c:3435
#43 0x0000adc5 in rb_eval (self=1913700, n=0x4) at eval.c:3616
#44 0x0000bc58 in rb_eval (self=1913700, n=0x4) at eval.c:3250
#45 0x0000957f in rb_eval (self=1913700, n=0x4) at eval.c:3087
#46 0x0000d1fb in rb_call0 (klass=3314700, recv=1913700, id=13385,
oid=13385, argc=0, argv=0x0, body=0x34d9b0, flags=0) at eval.c:5912
#47 0x0000d540 in rb_call (klass=3314700, recv=1913700, mid=13385,
argc=0, argv=0x0, scope=2) at eval.c:6006
#48 0x0000b259 in rb_eval (self=1913700, n=0x4) at eval.c:3456
#49 0x0000adc5 in rb_eval (self=1913700, n=0x4) at eval.c:3616
#50 0x0000b3fe in rb_eval (self=1913700, n=0x4) at eval.c:3429
#51 0x000092ef in rb_eval (self=1913700, n=0x4) at eval.c:3602
#52 0x00009238 in rb_eval (self=1913700, n=0x4) at eval.c:3596
#53 0x000092ef in rb_eval (self=1913700, n=0x4) at eval.c:3602
#54 0x0000966e in rb_eval (self=1913700, n=0x4) at eval.c:3118
#55 0x0000d1fb in rb_call0 (klass=3314700, recv=1913700, id=13369,
oid=13369, argc=0, argv=0x0, body=0x34dd70, flags=0) at eval.c:5912
#56 0x0000d540 in rb_call (klass=3314700, recv=1913700, mid=13369,
argc=0, argv=0x0, scope=2) at eval.c:6006
#57 0x0000b259 in rb_eval (self=1913700, n=0x4) at eval.c:3456
#58 0x0000ad88 in rb_eval (self=1913700, n=0x4) at eval.c:3626
#59 0x0000b60d in rb_eval (self=1913700, n=0x4) at eval.c:2994
#60 0x0000bc58 in rb_eval (self=1913700, n=0x4) at eval.c:3250
#61 0x0001138b in rb_yield_0 (val=6, self=1913700, klass=0, flags=0,
avalue=0) at eval.c:4953
#62 0x0001246a in rb_f_loop () at eval.c:5097
#63 0x0000caab in rb_call0 (klass=2055320, recv=1913700, id=3929,
oid=3929, argc=0, argv=0x0, body=0x1f412c, flags=2) at eval.c:5776
#64 0x0000d540 in rb_call (klass=2055320, recv=1913700, mid=3929,
argc=0, argv=0x0, scope=1) at eval.c:6006
#65 0x0000a4f1 in rb_eval (self=1913700, n=0x4) at eval.c:3450
#66 0x0000c3e9 in rb_eval (self=1913700, n=0x4) at eval.c:3163
#67 0x0001138b in rb_yield_0 (val=3421454, self=1913700, klass=0,
flags=0, avalue=0) at eval.c:4953
#68 0x00012413 in rb_f_catch (dmy=1913700, tag=3421454) at eval.c:12927
#69 0x0000caab in rb_call0 (klass=2055320, recv=1913700, id=3993,
oid=3993, argc=1, argv=0xbfffd5f0, body=0x1f3ed4, flags=2) at eval.c:
5776
#70 0x0000d540 in rb_call (klass=2055320, recv=1913700, mid=3993,
argc=1, argv=0xbfffd5f0, scope=1) at eval.c:6006
#71 0x0000a4f1 in rb_eval (self=1913700, n=0x4) at eval.c:3450
#72 0x0000c3e9 in rb_eval (self=1913700, n=0x4) at eval.c:3163
#73 0x0000d1fb in rb_call0 (klass=3314700, recv=1913700, id=10585,
oid=10585, argc=0, argv=0x0, body=0x34e0e0, flags=0) at eval.c:5912
#74 0x0000d540 in rb_call (klass=3314700, recv=1913700, mid=10585,
argc=0, argv=0x0, scope=0) at eval.c:6006
#75 0x0000b4e1 in rb_eval (self=1927380, n=0x4) at eval.c:3435
#76 0x0000c3e9 in rb_eval (self=1927380, n=0x4) at eval.c:3163
#77 0x0000d1fb in rb_call0 (klass=3185580, recv=1927380, id=10265,
oid=10265, argc=0, argv=0x0, body=0x1e1a90, flags=0) at eval.c:5912
#78 0x0000d540 in rb_call (klass=3185580, recv=1927380, mid=10265,
argc=0, argv=0x0, scope=0) at eval.c:6006
#79 0x0000b4e1 in rb_eval (self=1906100, n=0x4) at eval.c:3435
#80 0x0001138b in rb_yield_0 (val=2626830, self=1906100, klass=0,
flags=0, avalue=0) at eval.c:4953
#81 0x00012413 in rb_f_catch (dmy=1906100, tag=2626830) at eval.c:12927
#82 0x0000caab in rb_call0 (klass=2055320, recv=1906100, id=3993,
oid=3993, argc=1, argv=0xbfffe9f0, body=0x1f3ed4, flags=2) at eval.c:
5776
#83 0x0000d540 in rb_call (klass=2055320, recv=1906100, mid=3993,
argc=1, argv=0xbfffe9f0, scope=1) at eval.c:6006
#84 0x0000a4f1 in rb_eval (self=1906100, n=0x4) at eval.c:3450
#85 0x0000c3e9 in rb_eval (self=1906100, n=0x4) at eval.c:3163
#86 0x0000d1fb in rb_call0 (klass=1906020, recv=1906100, id=5033,
oid=5033, argc=1, argv=0xbffff140, body=0x1e4128, flags=0) at eval.c:
5912
#87 0x0000d540 in rb_call (klass=1906020, recv=1906100, mid=5033,
argc=1, argv=0xbffff140, scope=0) at eval.c:6006
#88 0x0000b4e1 in rb_eval (self=2050540, n=0x4) at eval.c:3435
#89 0x00019c83 in ruby_exec_internal () at eval.c:1595
#90 0x00019cb4 in ruby_exec () at eval.c:1615
#91 0x00019cdf in ruby_run () at eval.c:1625
#92 0x000027e4 in main (argc=2, argv=0xbffff548, envp=0xbffff554) at
main.c:46
(gdb) f 1
#1 0x001f6a0e in readline_readline (argc=2, argv=0xbfff5bb0,
self=1913860) at readline.c:86
86 (rl_deprep_term_function)();
(gdb) l
81 #if defined HAVE_RL_CLEANUP_AFTER_SIGNAL
82 / restore terminal mode and signal handler*/
83 rl_cleanup_after_signal();
84 #elif defined HAVE_RL_DEPREP_TERM_FUNCTION
85 /* restore terminal mode */
86 (*rl_deprep_term_function)();
87 #else
88 rl_deprep_terminal();
89 #endif
90 rb_jump_tag(status);