Long line may dump core

e$B1sF#$H?=$7$^$9!#e(B

e$BD9$$9T$G%Q!<%9%(%i!<$9$k$He(B SEGV e$B$9$k$3$H$,$"$k$h$&$G$9!#e(B

$ ./ruby -e ‘eval(%q(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx =
while true; [1, break]))’
-e:1: [BUG] Segmentation fault
ruby 1.9.0 (2007-12-29 revision 0) [i686-linux]

– control frame ----------
c:0004 p:---- s:0010 b:0010 l:000009 d:000009 CFUNC :eval
c:0003 p:0009 s:0006 b:0006 l:000005 d:000005 TOP -e:1
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH :inherited
c:0001 p:0000 s:0002 b:0002 l:000001 d:000001 TOP :17

DBG> : “-e:1:in `’”
– backtrace of native function call (Use addr2line) –
0x80eda35
0x810c3de
0x810c43b
0x80bdf50
0xffffe440
0x8106e11
0x8089645
0x808c8c3
0x809a50b
0x80efd69
0x8087da0
0x8087faf
0x80e21b6
0x80e2348
0x805ca2d
0x805ce95
0x80e3fae
0x80ec273
0x80e7bae
0x80eb474
0x80eb7ab
0x805a3f9
0x805e2e0
0x8057f51
0xb7d44ea8
0x8057e61

e$B%"%!<%H$7$^$7$?e(B

e$B%(%i!<9T$N>JN,I=<(e(B ("…line…" e$B$$?$$$J$Ne(B)
e$B$r$9$k;~$Ke(B M17N e$B$,$i$
$Ne(B
e$BLdBj$,5/$-$F$$$k$h$&$J5$$,$7$^$9!#4{[email protected]$C$?$i$4$a$s$J$5$$!#e(B

M17N e$B$K$O$"$^$j6=L#$,[email protected]$1!#!#!#e(B

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1210410112 (LWP 20858)]
rb_enc_get_index (obj=0) at encoding.c:397
397 switch (BUILTIN_TYPE(obj)) {
(gdb) bt
#0 rb_enc_get_index (obj=0) at encoding.c:397
#1 0x08106e11 in rb_enc_get (obj=0) at encoding.c:499
#2 0x08089645 in parser_yyerror (parser=0x81bd1a0, msg=) at parse.y:4607
#3 0x0808c8c3 in ruby_yyparse (parser=0x81bd1a0) at parse.c:9380
#4 0x0809a50b in yycompile0 (arg=136040864, tracing=0) at parse.y:4681
#5 0x080efd69 in ruby_suppress_tracing (func=0x809a4a0 ,
arg=136040864, always=2)
at thread.c:2990
#6 0x08087da0 in yycompile (parser=0x81bd1a0, f=, line=1) at parse.y:4712
#7 0x08087faf in rb_parser_compile_string (vparser=3081884080,
f=0xb7b1d1cc “(eval)”,
s=3081884120, line=1) at parse.y:4770
#8 0x080e21b6 in rb_iseq_compile_with_option (src=3081884120,
file=3081884100, line=3, opt=4)
at iseq.c:420
#9 0x080e2348 in rb_iseq_compile (src=3081884120, file=3081884100,
line=3) at iseq.c:450
#10 0x0805ca2d in eval (self=, src=3081884120,
scope=4,
file=0x8120d37 “(eval)”, line=1) at eval.c:1725
#11 0x0805ce95 in rb_f_eval (argc=1, argv=0xb7b48024, self=3082049100)
at eval.c:1826
#12 0x080e3fae in call_cfunc (func=0x805cdc0 <rb_f_eval>,
recv=3082049100, len=136041096,
argc=0, argv=0xb7b48024) at vm_insnhelper.c:281
#13 0x080ec273 in vm_call_method (th=0x816e990, cfp=0xb7bc7f60, num=1,
blockptr=0x1, flag=2145,
id=2728, mn=0xb7b40fac, recv=3082049100, klass=3082049080) at
vm_insnhelper.c:371
#14 0x080e7bae in vm_eval (th=0x816e990, initial=0) at insns.def:1050
#15 0x080eb474 in vm_eval_body (th=0x816e990) at vm.c:1148
#16 0x080eb7ab in rb_iseq_eval (iseqval=3081884240) at vm.c:1357
#17 0x0805a3f9 in ruby_exec_node (n=0xb7b1d2dc, file=0x81b4d11 “-e”)
at eval.c:229
#18 0x0805e2e0 in ruby_run_node (n=0xb7b1d2dc) at eval.c:259
#19 0x08057f51 in main (argc=3, argv=0xbfc66ef4, envp=0xbfc66f04) at
main.c:39

[email protected]$G$9!#e(B

At Sun, 30 Dec 2007 00:15:14 +0900,
Yusuke ENDOH wrote in [ruby-dev:32896]:

e$B%(%i!<9T$N>JN,I=<(e(B ("…line…" e$B$$?$$$J$Ne(B) e$B$r$9$k;~$Ke(B M17N e$B$,$i$$Ne(B
e$BLdBj$,5/$-$F$$$k$h$&$J5$$,$7$^$9!#4{[email protected]$C$?$i$4$a$s$J$5$$!#e(B

e$B$?$^$?$^e(Bencodinge$B$r<h$k$H$3$m$GMn$A$F$$$^$9$,!"e(BM17Ne$B$H$OL54X78$G$9!#e(B
fluent interfacee$B$N$?$a$Ke(Bread forward
buffere$B$rDI2C$7$?$H$-$N%P%0e(B
e$B$G$9!#e(B