なかだです。

At Sat, 2 Oct 2004 21:12:09 +0900,
Tanaka Akira wrote in [ruby-dev:24400]:
> 
> 次のようにすると core を吐きます。
> 
> % ./ruby -d -e '
> r, w = IO.pipe
> Thread.new {
>   Thread.pass;
>   ObjectSpace.each_object(String) {|s| s.replace "" if s.length == 4096 }
>   w << "a" * 4096 }
> r.read(4096)
> '
> -e:7: [BUG] Segmentation fault
> ruby 1.9.0 (2004-10-02) [i686-linux]
> 
> -e:7: [BUG] Segmentation fault
> ruby 1.9.0 (2004-10-02) [i686-linux]

二回目のは、ヒープが壊れているせいでライブラリの終了処理の中で
SEGVしてるようですね。


Index: io.c =================================================================== RCS file: /cvs/ruby/src/ruby/io.c,v retrieving revision 1.293 diff -u -2 -p -r1.293 io.c --- io.c 1 Oct 2004 15:56:04 -0000 1.293 +++ io.c 3 Oct 2004 17:20:33 -0000 @@ -1195,8 +1195,8 @@ io_read(argc, argv, io) rb_str_modify(str); rb_str_resize(str,len); - FL_SET(str, FL_FREEZE); } if (len == 0) return str; + FL_SET(str, FL_FREEZE); READ_CHECK(fptr->f); n = rb_io_fread(RSTRING(str)->ptr, len, fptr->f);
-- --- 僕の前にBugはない。 --- 僕の後ろにBugはできる。 中田 伸悦