Bug #611: loop { BEGIN {} } dumps core
http://redmine.ruby-lang.org/issues/show/611

起票者: Shyouhei Urabe
ステータス: Open, 優先度: Normal
カテゴリ: core

次のようにすると core を吐きます。

% gdb --args ~/target/trunk/bin/ruby -e'loop{BEGIN{}}'
GNU gdb 6.4.90-debian
Copyright (C) 2006 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 "x86_64-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".

(gdb) run
Starting program: /home/shyouhei/target/trunk/bin/ruby -eloop\{BEGIN\{\}\}
[Thread debugging using libthread_db enabled]
[New Thread 47661522453936 (LWP 18756)]
[New Thread 1073756512 (LWP 18759)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 47661522453936 (LWP 18756)]
0x00000000004565ff in ruby_yyparse (parser=0x7bfef0) at /home/shyouhei/ruby/trunk/parse.y:3617
3617                            nd_set_line($$->nd_body->nd_body, $<num>2);
(gdb) bt
#0  0x00000000004565ff in ruby_yyparse (parser=0x7bfef0) at /home/shyouhei/ruby/trunk/parse.y:3617
#1  0x0000000000459200 in yycompile0 (arg=8126192, tracing=0) at /home/shyouhei/ruby/trunk/parse.y:4987
#2  0x0000000000510a49 in ruby_suppress_tracing (func=0x4590f3 <yycompile0>, arg=8126192, always=2) at /home/shyouhei/ruby/trunk/thread.c:3592
#3  0x00000000004593bf in yycompile (parser=0x7bfef0, f=0x6f5b18 "-e", line=1) at /home/shyouhei/ruby/trunk/parse.y:5021
#4  0x00000000004596e5 in rb_parser_compile_string (vparser=8143240, f=0x6f5b18 "-e", s=7297840, line=1) at /home/shyouhei/ruby/trunk/parse.y:5082
#5  0x00000000004a0e58 in process_options (arg=140735786351248) at /home/shyouhei/ruby/trunk/ruby.c:1113
#6  0x0000000000508c3e in rb_vm_call_cfunc (recv=7572320, func=0x4a070b <process_options>, arg=140735786351248, blockptr=0x0, filename=7298080) at /home/shyouhei/ruby/trunk/vm.c:1323
#7  0x00000000004a20ee in ruby_process_options (argc=2, argv=0x7fff9a8d7ce8) at /home/shyouhei/ruby/trunk/ruby.c:1541
#8  0x0000000000416236 in ruby_options (argc=2, argv=0x7fff9a8d7ce8) at /home/shyouhei/ruby/trunk/eval.c:99
#9  0x000000000041509f in main (argc=2, argv=0x7fff9a8d7ce8) at /home/shyouhei/ruby/trunk/main.c:35
(gdb)


----------------------------------------
http://redmine.ruby-lang.org