From: Tanaka Akira Date: 2002-12-16T14:44:53+09:00 Subject: [ruby-dev:19075] Re: ruby 1.6.8 bug? on freebsd 4.7 stable In article <1040012181.758076.25648.nullmailer@picachu.netlab.jp>, matz@ruby-lang.org (Yukihiro Matsumoto) writes: > $B$7$+$7!"Mn$A$F$k$N$O(B > > return rb_yield_0(val, 0, 0, 0); > > $B$H$$$&$*$*$h$=LdBj$,5/$-$=$&$K$J$$>l=j$J$s$G$9$,!"$J$K$,$$$1(B > $B$J$$$s$G$9$+$M$(!#(B $B>/$7=L$a$k$H(B linux $B$G$b(B core $B$rEG$-$^$9$M!#(B Z:akr@coulee.a02.aist.go.jp% cat z.rb X = 'X' def m flag = true buf = "XX--BXXX--B--X" while flag body = Object.new head = false until head and /B(?:#{X}|--)/n.match(buf) buf = buf.sub(/\A.*?XX/n) do "" end head = true end buf = buf.sub(/B(X|--)/n) do if "--" == $1 flag = false end '' end eval <<-END def body.xxx #{x = ""} end END end end m m Z:akr@coulee.a02.aist.go.jp% ./ruby z.rb z.rb:20: [BUG] Segmentation fault ruby 1.6.8 (2002-12-13) [i686-linux] zsh: abort (core dumped) ./ruby z.rb Z:akr@coulee.a02.aist.go.jp% gdb ruby core GNU gdb 2002-04-01-cvs Copyright 2002 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-linux"... Core was generated by `./ruby z.rb'. Program terminated with signal 6, Aborted. Reading symbols from /lib/libdl.so.2...done. Loaded symbols for /lib/libdl.so.2 Reading symbols from /lib/libcrypt.so.1...done. Loaded symbols for /lib/libcrypt.so.1 Reading symbols from /lib/libm.so.6...done. Loaded symbols for /lib/libm.so.6 Reading symbols from /lib/libc.so.6...done. Loaded symbols for /lib/libc.so.6 Reading symbols from /lib/ld-linux.so.2...done. Loaded symbols for /lib/ld-linux.so.2 #0 0x40095781 in kill () from /lib/libc.so.6 (gdb) where #0 0x40095781 in kill () from /lib/libc.so.6 #1 0x40095464 in raise () from /lib/libc.so.6 #2 0x40096be1 in abort () from /lib/libc.so.6 #3 0x080b72d7 in rb_bug () at error.c:179 #4 0x0809e97f in sigsegv () at signal.c:393 #5 0x400956b8 in sigaction () from /lib/libc.so.6 #6 0x080585d8 in rb_yield (val=1075488180) at eval.c:3732 #7 0x080a3556 in rb_str_sub_bang (argc=1, argv=0xbfffd824, str=1075488240) at string.c:1172 #8 0x080a368b in rb_str_sub (argc=1, argv=0xbfffd824, str=1075488400) at string.c:1207 #9 0x08059948 in call_cfunc (func=0x80a3664 , recv=1075488400, len=-1, argc=1, argv=0xbfffd824) at eval.c:4279 #10 0x08059e51 in rb_call0 (klass=1075543220, recv=1075488400, id=4225, argc=1, argv=0xbfffd824, body=0x401b73cc, nosuper=1) at eval.c:4416 #11 0x0805a662 in rb_call (klass=1075543220, recv=1075488400, mid=4225, argc=1, argv=0xbfffd824, scope=0) at eval.c:4640 #12 0x080557bc in rb_eval (self=1075547360, n=0x401ab518) at eval.c:2572 #13 0x08054800 in rb_eval (self=1075547360, n=0x401ab360) at eval.c:2304 #14 0x0805611a in rb_eval (self=1075547360, n=0x401ab34c) at eval.c:2724 #15 0x08053df2 in rb_eval (self=1075547360, n=0x401ab8b0) at eval.c:2053 #16 0x08054474 in rb_eval (self=1075547360, n=0x401ab9c8) at eval.c:2237 #17 0x0805a25f in rb_call0 (klass=1075551520, recv=1075547360, id=9017, argc=0, argv=0x0, body=0x401ab9c8, nosuper=0) at eval.c:4547 #18 0x0805a662 in rb_call (klass=1075551520, recv=1075547360, mid=9017, argc=0, argv=0x0, scope=2) at eval.c:4640 #19 0x080557bc in rb_eval (self=1075547360, n=0x401ab07c) at eval.c:2572 #20 0x08051dc4 in eval_node (self=1075547360, node=0x401ab07c) at eval.c:1085 #21 0x080521bc in ruby_run () at eval.c:1230 #22 0x08050a22 in main (argc=2, argv=0xbffff874, envp=0xbffff880) at main.c:50 (gdb) -- [$BEDCf(B $BE/(B][$B$?$J$+(B $B$"$-$i(B][Tanaka Akira] $B!V$U$($m(B! $B$o$+$a$A$c$s:n@o$G$9$(C"=$B!W(B(Little Worker, $B7KM7@84](B)