Issue #7589 has been updated by kosaki (Motohiro KOSAKI).


??????tarui????????? #7590???????????????????????????????????転???????????????
----------------------------------------
Bug #7589: parallel test-all ??? test_settracefunc ??? SEGV
https://bugs.ruby-lang.org/issues/7589#change-34846

Author: naruse (Yui NARUSE)
Status: Closed
Priority: Normal
Assignee: 
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-12-19 trunk 38456) [x86_64-linux]


while make TESTS='-qv -j1 ruby/test_settracefunc.rb' test-all;do done ?????????????以????????SEGV??????????

??????
TestSetTraceFunc#test_tracepoint_exception_at_line = 0.00 s = .
/home/naruse/ruby/lib/test/unit/parallel.rb:38: [BUG] Segmentation fault
ruby 2.0.0dev (2012-12-19 trunk 38456) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0002 p:0014 s:0005 e:000004 BLOCK  /home/naruse/ruby/lib/test/unit/parallel.rb:38 [FINISH]
c:0001 p:---- s:0002 e:000001 TOP    [FINISH]

-- Ruby level backtrace information ----------------------------------------
/home/naruse/ruby/lib/test/unit/parallel.rb:38:in `block in _run_suite'

-- C level backtrace information -------------------------------------------
/home/naruse/ruby/libruby.so.2.0.0(+0x1be874) [0x2b09de81b874] vm_dump.c:643
/home/naruse/ruby/libruby.so.2.0.0(+0x662a7) [0x2b09de6c32a7] error.c:306
/home/naruse/ruby/libruby.so.2.0.0(rb_bug+0x108) [0x2b09de6c33e5] error.c:325
/home/naruse/ruby/libruby.so.2.0.0(+0x1382f2) [0x2b09de7952f2] signal.c:649
/lib/libpthread.so.0(+0xf8f0) [0x2b09deb188f0] ../nptl/sysdeps/pthread/funlockfile.c:30
/home/naruse/ruby/libruby.so.2.0.0(+0x1c13e8) [0x2b09de81e3e8] vm_trace.c:263
/home/naruse/ruby/libruby.so.2.0.0(+0x1c160f) [0x2b09de81e60f] vm_trace.c:309
/home/naruse/ruby/libruby.so.2.0.0(+0x1aba95) [0x2b09de808a95]
/home/naruse/ruby/libruby.so.2.0.0(+0x1baaca) [0x2b09de817aca] vm.c:1169
/home/naruse/ruby/libruby.so.2.0.0(+0x1b9618) [0x2b09de816618] vm.c:636
/home/naruse/ruby/libruby.so.2.0.0(+0x1b9869) [0x2b09de816869] vm.c:684
/home/naruse/ruby/libruby.so.2.0.0(+0x1b9917) [0x2b09de816917] vm.c:703
/home/naruse/ruby/libruby.so.2.0.0(+0x1c56cf) [0x2b09de8226cf]
/home/naruse/ruby/libruby.so.2.0.0(+0x1c4111) [0x2b09de821111] thread_pthread.c:722
/lib/libpthread.so.0(+0x69ca) [0x2b09deb0f9ca] pthread_create.c:300
/lib/libc.so.6(clone+0x6d) [0x2b09df6d921d] parse.y:10551

-- Other runtime information -----------------------------------------------

* Loaded script: /home/naruse/ruby/lib/test/unit/parallel.rb: TestSetTraceFunc#test_tracepoint_thread

* Loaded features:


Some worker was crashed. It seems ruby interpreter's bug
or, a bug of test/unit/parallel.rb. try again without -j
option.

make: *** [yes-test-all] Error 1

以????????????????????????????????????????????読??込???????????????????????????????????

diff --git a/lib/test/unit/parallel.rb b/lib/test/unit/parallel.rb
index d189183..b044792 100644
--- a/lib/test/unit/parallel.rb
+++ b/lib/test/unit/parallel.rb
@@ -34,8 +34,13 @@ module Test

         th = Thread.new do
           begin
-            while buf = (self.verbose ? i.gets : i.read(5))
-              _report "p", buf
+            buf = i.read
+            if self.verbose
+              buf.each_line{|l|
+              _report "p", l
+              }
+            else
+              raise
             end
           rescue IOError
           rescue Errno::EPIPE


-- 
http://bugs.ruby-lang.org/