# \[Bug #611\] loop { BEGIN {} } dumps core

**URL:** <https://www.ruby-forum.com/t/bug-611-loop-begin-dumps-core/149822>\
**Category:** Development\
**Created:** [September 30, 2008, 9:30am UTC](https://www.ruby-forum.com/t/bug-611-loop-begin-dumps-core/149822 "2008-09-30T09:30:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shyouhei\_U](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/94ad74/32.png) [@Shyouhei\_U](https://www.ruby-forum.com/u/Shyouhei_U)\
**Post date:** [September 30, 2008, 9:30am UTC](https://www.ruby-forum.com/t/bug-611-loop-begin-dumps-core/149822/1 "2008-09-30T09:30:06Z")

</div>

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

e$B5/I\<\<Te(B: Shyouhei U.  
e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal  
e$B%+%F%4%je(B: core

e$B\<!$N$h$&$K$9$k$He(B core e$B$rEG$-$^$9!#e(B

% 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,  
$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  
, 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)

---

<div class="post-metadata">

**Author:** ![Shyouhei\_U](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/94ad74/32.png) [@Shyouhei\_U](https://www.ruby-forum.com/u/Shyouhei_U)\
**Post date:** [September 30, 2008, 9:58am UTC](https://www.ruby-forum.com/t/bug-611-loop-begin-dumps-core/149822/2 "2008-09-30T09:58:15Z")

</div>

e$B%A%1%C%He(B #611 e$B$,99?7$5$l$^$7$?!#e(B (by Nobuyoshi N.)

e$B%9%F!\<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B  
e$B?JD=e(B % 0e$B$+$ie(B100e$B$KJQ99e(B

## Applied in changeset r19640.

[http://redmine.ruby-lang.org/issues/show/611](http://redmine.ruby-lang.org/issues/show/611)
