e$B1sF#$G$9!#e(B
e$B0J2<$N$h$&$Ke(B do_select e$B$Ne(B blocking region e$B$Ke(B
native_thread_yield e$B$re(B
e$BF~$l$?>e$G!"e(B
Index: thread.c
— thread.c (revision 18124)
+++ thread.c (working copy)
@@ -2004,6 +2004,7 @@
}
#else
BLOCKING_REGION({
- native_thread_yield();
result = select(n, read, write, except, timeout);
if (result < 0) lerrno = errno;
}, ubf_select, GET_THREAD());
e$B0J2<$r<B9T$9$k$H!"$?$^$KMn$A$^$9!#e(B
$ ./ruby
t = Thread.new do
loop do
w = IO.pipe.last
w.sync = false
w.write(“a” * 1000)
end
end
sleep 0.1
Thread.new { }
GC.start
-:3: [BUG] object allocation during garbage collection phase
ruby 1.9.0 (2008-07-18 revision 18124) [i686-linux]
– control frame ----------
c:0008 p:---- s:0015 b:0015 l:000014 d:000014 CFUNC :(null)
c:0007 p:---- s:0013 b:0013 l:000012 d:000012 CFUNC :pipe
c:0006 p:0013 s:0010 b:0010 l:000f88 d:000009 BLOCK -:3
c:0005 p:---- s:0009 b:0009 l:000008 d:000008 FINISH
c:0004 p:---- s:0007 b:0007 l:000006 d:000006 CFUNC :loop
c:0003 p:0007 s:0004 b:0004 l:000f88 d:000003 BLOCK -:2
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:---- s:0002 b:0002 l:000001 d:000001 TOP
DBG> : “-:3:in (null)'" DBG> : "-:3:in
pipe’”
DBG> : “-:3:in block (2 levels) in <main>'" DBG> : "-:2:in
loop’”
DBG> : “-:2:in `block in '”
– backtrace of native function call (Use addr2line) –
0x8102065
0x812948e
0x81294eb
0x8061b3a
0x806953c
0x80fdc90
0x80fe0f2
0x807e180
0x807e982
0x8066852
0x8059e20
0x806a768
0x80f2efe
0x80f4f4c
0x80f7eb9
0x80fbdcb
0x80fc414
0x80fc962
0x8059fec
0x80f4063
0x80f4f4c
0x80f7eb9
0x80fbdcb
0x80fc414
0x80fc784
0x8106b9c
0x8106be1
0xb7f6a240
0xb7e9e49e
e$B%"%!<%H$7$^$7$?e(B
e$B860x$O!"e(BT_FILE e$B$,e(B GC e$B$5$l$k$H$-e(B
fptr_finalize
-> io_fflush
-> rb_thread_fd_writable
-> rb_thread_wait_fd_rw
-> do_select
-> BLOCKING_REGION
e$B$H8F$S=P$7$,?J$s$G!"e(BGC
e$BCf$KB>$N%9%l%C%I$,F0$-=P$7$F$7$^$&$?$a$G$9!#e(B
e$B$3$NLdBj$,$J$+$C$?$H$7$F$b!“e(Bfptr_finalize e$B$Ge(B io_fflush
e$B$9$k$N$Oe(B
e$B%V%m%C%/$9$k2DG=@-$,$”$C$F$^$:$$5$$,$7$^$9!#$I$&$7$?$b$s$G$7$g$&!#e(B