Bug #7589

parallel test-all で test_settracefunc が SEGV

Added by Yui NARUSE over 1 year ago. Updated over 1 year ago.

[ruby-dev:46763]
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] Backport:

Description

while make TESTS='-qv -j1 ruby/test_settracefunc.rb' test-all;do done としていると以下の通りSEGVします。

前略
TestSetTraceFunc#testtracepointexceptionatline = 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 runsuite'

-- C level backtrace information -------------------------------------------
/home/naruse/ruby/libruby.so.2.0.0(+0x1be874) [0x2b09de81b874] vmdump.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] vmtrace.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] threadpthread.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#testtracepointthread

  • 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

Related issues

Related to ruby-trunk - Bug #7590: parallel test-all で test_settracefunc が cfp consistency e... Closed 12/19/2012

Associated revisions

Revision 38464
Added by Masaya Tarui over 1 year ago

  • vmtrace.c (rbthreadptrexecevent_hooks): get rid of race condition. [Bug #7589]

History

#1 Updated by Masaya Tarui over 1 year ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r38464.
Yui, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • vmtrace.c (rbthreadptrexecevent_hooks): get rid of race condition. [Bug #7589]

#2 Updated by Motohiro KOSAKI over 1 year ago

あれ、まだ起きるような。
うちのx8664 linuxだと以下のように vmcallcfunc - cfp consistency error でrbbugして、その延長でsegv.
ところで、一般論としてcfp consistency errorが起きてる時に ruby level backtraceが採取できる可能性はないんじゃないですかね。

#0 0x00007f0bedb7fec3 in filllines (numtraces=23,
traces=0x7f0bede50060, syms=0x7f0bee141eb0, checkdebuglink=1,
current
line=0x7f0bee1427a0, lines=0x7f0bee1427a0)
at ../addr2line.c:513
#1 0x00007f0bedb80219 in rbdumpbacktracewithlines (numtraces=23,
trace=0x7f0bede50060, syms=0x7f0bee141eb0) at ../addr2line.c:605
#2 0x00007f0bedb6b97f in rb
vmbugreport () at ../vmdump.c:648
#3 0x00007f0beda11f79 in reportbug (
file=0x7f0bee203fe0 "/home/kosaki/ruby/git/lib/minitest/unit.rb",
line=912, fmt=0x7f0bedba37ff "Segmentation fault",
args=0x7f0bee068880) at ../error.c:306
#4 0x00007f0beda120b7 in rb
bug (fmt=0x7f0bedba37ff "Segmentation fault")
at ../error.c:325
#5 0x00007f0bedae3c39 in sigsegv (sig=11, info=0x7f0bee068af0,
ctx=0x7f0bee0689c0) at ../signal.c:649
#6
#7 0x00007f0bedb7fec3 in filllines (numtraces=16,
traces=0x7f0bede50060, syms=0x7f0bee66ab00, checkdebuglink=1,
current
line=0x7f0bee66b150, lines=0x7f0bee66b150)
at ../addr2line.c:513
#8 0x00007f0bedb80219 in rbdumpbacktracewithlines (numtraces=16,
trace=0x7f0bede50060, syms=0x7f0bee66ab00) at ../addr2line.c:605
#9 0x00007f0bedb6b97f in rb
vmbugreport () at ../vmdump.c:648
#10 0x00007f0beda11f79 in reportbug (
file=0x7f0bee203fe0 "/home/kosaki/ruby/git/lib/minitest/unit.rb",
line=912, fmt=0x7f0bedba9aa8 "vm
callcfunc - cfp consistency error",
args=0x7fff16fcf500) at ../error.c:306
#11 0x00007f0beda120b7 in rb
bug (
fmt=0x7f0bedba9aa8 "vmcallcfunc - cfp consistency error")
at ../error.c:325
#12 0x00007f0bedb53530 in vmcallcfuncwithframe (th=0x7f0bedffe5b0,
regcfp=0x7f0bed99eeb0, ci=0x7f0bee17b750) at ../vminsnhelper.c:1422
#13 0x00007f0bedb537cc in vmcallcfunc (th=0x7f0bedffe5b0,
regcfp=0x7f0bed99eeb0, ci=0x7f0bee17b750) at ../vminsnhelper.c:1509
#14 0x00007f0bedb545b6 in vmcallmethod (th=0x7f0bedffe5b0,
cfp=0x7f0bed99eeb0, ci=0x7f0bee17b750) at ../vminsnhelper.c:1683
#15 0x00007f0bedb54d71 in vm
callgeneral (th=0x7f0bedffe5b0,
reg
cfp=0x7f0bed99eeb0, ci=0x7f0bee17b750) at ../vminsnhelper.c:1832
#16 0x00007f0bedb58951 in vm
execcore (th=0x7f0bedffe5b0, initial=0)
at ../insns.def:996
#17 0x00007f0bedb67785 in vm
exec (th=0x7f0bedffe5b0) at ../vm.c:1169
#18 0x00007f0bedb6879b in rbiseqevalmain (iseqval=139689214591600)
at ../vm.c:1417
#19 0x00007f0beda178c8 in ruby
execinternal (n=0x7f0bee03c270)
at ../eval.c:250
#20 0x00007f0beda179db in ruby
execnode (n=0x7f0bee03c270)
at ../eval.c:315
#21 0x00007f0beda179ae in ruby
run_node (n=0x7f0bee03c270)
at ../eval.c:307
#22 0x00007f0bed9d8ef9 in main (argc=6, argv=0x7fff16fd0898)
at ../main.c:36

#3 Updated by Motohiro KOSAKI over 1 year ago

あ、taruiさんが #7590としてすでに報告済みでした。そちらに転記しておきます

Also available in: Atom PDF