Bug #4866

Macでmake checkするとIO.copy_streamでSEGV

Added by Motohiro KOSAKI almost 3 years ago. Updated almost 3 years ago.

[ruby-dev:43700]
Status:Closed
Priority:Normal
Assignee:Akira Tanaka
Category:core
Target version:1.9.3
ruby -v:- Backport:

Description

make checkが以下のように異常終了します。

.
#245 testio.rb:99:in `block in ':
at
exit { p :foo }

   megacontent = "abc" * 12345678
   #File.open("megasrc", "w") {|f| f << megacontent }

   Thread.new { sleep rand*0.2; Process.kill(:INT, $$) }

   r1, w1 = IO.pipe
   r2, w2 = IO.pipe
   t1 = Thread.new { w1 << megacontent; w1.close }
   t2 = Thread.new { r2.read; r2.close }
   IO.copy_stream(r1, w2) rescue nil
   w2.close
   r1.close
   t1.join
   t2.join
   #=> killed by SIGABRT (signal 6)

| bootstraptest.tmp.rb:13: [BUG] Segmentation fault
| ruby 1.9.3dev (2011-06-10 trunk 31985) [x8664-darwin10.7.4]
|
| -- Control frame information -----------------------------------------------
| c:0004 p:---- s:0019 b:0019 l:000018 d:000018 CFUNC :copy
stream
| c:0003 p:0145 s:0014 b:0013 l:002188 d:000b40 EVAL bootstraptest.tmp.rb:13
| c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
| c:0001 p:0000 s:0002 b:0002 l:002188 d:002188 TOP

|
| -- Ruby level backtrace information ----------------------------------------
| bootstraptest.tmp.rb:13:in <main>'
| bootstraptest.tmp.rb:13:in
copystream'
|
| -- See Crash Report log file under ~/Library/Logs/CrashReporter or ---------
| -- /Library/Logs/CrashReporter, for the more detail of ---------------------
| -- C level backtrace information -------------------------------------------
|
| -- Other runtime information -----------------------------------------------
|
| * Loaded script: bootstraptest.tmp.rb
|
| * Loaded features:
|
| 0 enumerator.so
| 1 /Users/kosaki/ruby/.ext/x86
64-darwin10.7.4/enc/encdb.bundle
| 2 /Users/kosaki/ruby/.ext/x8664-darwin10.7.4/enc/trans/transdb.bundle
| 3 /Users/kosaki/ruby/lib/rubygems/defaults.rb
| 4 /Users/kosaki/ruby/lib/tsort.rb
| 5 /Users/kosaki/ruby/lib/rubygems/deprecate.rb
| 6 /Users/kosaki/ruby/lib/rubygems/dependency
list.rb
| 7 /Users/kosaki/ruby/lib/rubygems/pathsupport.rb
| 8 /Users/kosaki/ruby/rbconfig.rb
| 9 /Users/kosaki/ruby/lib/rubygems/exceptions.rb
| 10 /Users/kosaki/ruby/lib/rubygems/custom
require.rb
| 11 /Users/kosaki/ruby/lib/rubygems/version.rb
| 12 /Users/kosaki/ruby/lib/rubygems/requirement.rb
| 13 /Users/kosaki/ruby/lib/rubygems/platform.rb
| 14 /Users/kosaki/ruby/lib/rubygems/specification.rb
| 15 /Users/kosaki/ruby/lib/rubygems.rb
|
| [NOTE]
| You may have encountered a bug in the Ruby interpreter or extension libraries.
| Bug reports are welcome.
| For details: http://www.ruby-lang.org/bugreport.html
|
megacontent-copy_stream
FAIL 1/925 tests failed
make: *** [yes-btest-ruby] Error 1
[1] 95841 exit 2 make check OPTS="-v" TESTS="-v -q -j8 "

Process: ruby-193 [96102]
Path: /Users/kosaki/ruby/ruby-193
Identifier: ruby-193
Version: ??? (???)
Code Type: X86-64 (Native)
Parent Process: ruby-193 [95844]

Date/Time: 2011-06-10 23:24:40.171 +0900
OS Version: Mac OS X 10.6.7 (10J4138)
Report Version: 6

Exception Type: EXCBADACCESS (SIGABRT)
Exception Codes: KERNINVALIDADDRESS at 0x000000079656e860
Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Application Specific Information:
abort() called

Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 libSystem.B.dylib 0x00007fff885225d6 _kill + 10
1 libSystem.B.dylib 0x00007fff885c2cde abort + 83
2 ruby-193 0x0000000100038262 rb
bugerrno + 0
3 ruby-193 0x00000001000fc442 signal
exec + 0
4 libSystem.B.dylib 0x00007fff8853466a sigtramp + 26
5 ruby-193 0x00000001000fc510 rb
signalexec + 51
6 ruby-193 0x000000010018556f rb
threadptrexecuteinterruptsrec + 211
7 ruby-193 0x0000000100185706 rb
threadexecuteinterrupts + 26
8 ruby-193 0x000000010006d4e7 execinterrupts + 29
9 ruby-193 0x00000001001853d3 rb
threadcallwithgvl + 162
10 ruby-193 0x000000010006d548 maygvl
copystreamcontinuep + 90
11 ruby-193 0x000000010006dc6a maygvl
copystreamread + 134
12 ruby-193 0x000000010006dfb7 nogvlcopystreamreadwrite + 443
13 ruby-193 0x000000010006e069 nogvlcopystreamfunc + 47
14 ruby-193 0x000000010018519b rb
threadblockingregion + 216
15 ruby-193 0x000000010006e919 copystreambody + 1457
16 ruby-193 0x000000010003e487 rbensure + 151
17 ruby-193 0x000000010006eb5d rb
ioscopystream + 378
18 ruby-193 0x00000001001754a0 call
cfunc + 282
19 ruby-193 0x0000000100175307 vmcallcfunc + 284
20 ruby-193 0x00000001001744d0 vmcallmethod + 373
21 ruby-193 0x000000010016f032 vmexeccore + 11449
22 ruby-193 0x000000010017ee0a vmexec + 147
23 ruby-193 0x000000010017f7dd rb
iseqevalmain + 45
24 ruby-193 0x000000010003d0cb rubyexecinternal + 193
25 ruby-193 0x000000010003d1ef rubyexecnode + 30
26 ruby-193 0x000000010003d1c2 rubyrunnode + 56
27 ruby-193 0x0000000100000d23 main + 79 (main.c:40)
28 ruby-193 0x0000000100000ccc start + 52

Thread 1:
0 libSystem.B.dylib 0x00007fff8850ef8a _semwaitsignal + 10
1 libSystem.B.dylib 0x00007fff88512da1 pthreadcondwait + 1286
2 ruby-193 0x0000000100182af6 native
condtimedwait + 37
3 ruby-193 0x00000001001834a5 thread
timer + 121
4 libSystem.B.dylib 0x00007fff8850d4f6 pthreadstart + 331
5 libSystem.B.dylib 0x00007fff8850d3a9 thread_start + 13

Thread 2:
0 libSystem.B.dylib 0x00007fff8850ef8a _semwaitsignal + 10
1 libSystem.B.dylib 0x00007fff88512da1 pthreadcondwait + 1286
2 ruby-193 0x0000000100182af6 native
condtimedwait + 37
3 ruby-193 0x00000001001831b5 native
sleep + 270
4 ruby-193 0x0000000100184b9d sleeptimeval + 129
5 ruby-193 0x0000000100184d31 sleep
forpolling + 44
6 ruby-193 0x0000000100184db2 rb
threadpolling + 78
7 ruby-193 0x00000001000fc061 rb
fkill + 703
8 ruby-193 0x00000001001754a0 call
cfunc + 282
9 ruby-193 0x0000000100175307 vmcallcfunc + 284
10 ruby-193 0x00000001001744d0 vmcallmethod + 373
11 ruby-193 0x000000010016f032 vmexeccore + 11449
12 ruby-193 0x000000010017ee0a vmexec + 147
13 ruby-193 0x000000010017d922 invoke
blockfromc + 584
14 ruby-193 0x000000010017daa8 rbvminvokeproc + 253
15 ruby-193 0x0000000100183da8 thread
startfunc2 + 512
16 ruby-193 0x0000000100182ec5 threadstartfunc1 + 51
17 libSystem.B.dylib 0x00007fff8850d4f6 _pthread
start + 331
18 libSystem.B.dylib 0x00007fff8850d3a9 thread_start + 13

Thread 3:
0 libSystem.B.dylib 0x00007fff8850ef8a _semwaitsignal + 10
1 libSystem.B.dylib 0x00007fff88512da1 pthreadcondwait + 1286
2 ruby-193 0x0000000100182ab7 native
condwait + 29
3 ruby-193 0x0000000100182772 gvl
acquire + 90
4 ruby-193 0x000000010018505b blockingregionend + 33
5 ruby-193 0x00000001001852be rbthreadioblockingregion + 207
6 ruby-193 0x000000010005d017 rbwriteinternal + 60
7 ruby-193 0x000000010005d941 iobinwrite + 852
8 ruby-193 0x000000010005dd41 io
fwrite + 158
9 ruby-193 0x000000010005de8f iowrite + 247
10 ruby-193 0x000000010005df31 io
writem + 34
11 ruby-193 0x00000001001754d7 call
cfunc + 337
12 ruby-193 0x000000010017895f vmcall0 + 685
13 ruby-193 0x0000000100179d9d rb
call0 + 171
14 ruby-193 0x0000000100179cf0 rbcall + 59
15 ruby-193 0x0000000100179fbd rb
funcall + 534
16 ruby-193 0x000000010005df61 rbiowrite + 46
17 ruby-193 0x000000010005df80 rbioaddstr + 29
18 ruby-193 0x00000001001754d7 callcfunc + 337
19 ruby-193 0x0000000100175307 vm
callcfunc + 284
20 ruby-193 0x00000001001744d0 vm
callmethod + 373
21 ruby-193 0x000000010017232e vm
execcore + 24501
22 ruby-193 0x000000010017ee0a vm
exec + 147
23 ruby-193 0x000000010017d922 invokeblockfromc + 584
24 ruby-193 0x000000010017daa8 rb
vminvokeproc + 253
25 ruby-193 0x0000000100183da8 threadstartfunc2 + 512
26 ruby-193 0x0000000100182ec5 thread
startfunc1 + 51
27 libSystem.B.dylib 0x00007fff8850d4f6 pthreadstart + 331
28 libSystem.B.dylib 0x00007fff8850d3a9 thread_start + 13

Thread 4:
0 libSystem.B.dylib 0x00007fff8850ef8a _semwaitsignal + 10
1 libSystem.B.dylib 0x00007fff88512da1 pthreadcondwait + 1286
2 ruby-193 0x0000000100182ab7 native
condwait + 29
3 ruby-193 0x0000000100182772 gvl
acquire + 90
4 ruby-193 0x000000010018505b blockingregionend + 33
5 ruby-193 0x00000001001852be rbthreadioblockingregion + 207
6 ruby-193 0x000000010005cfd9 rbreadinternal + 60
7 ruby-193 0x000000010005ec76 iobufread + 79
8 ruby-193 0x000000010005edfb io
fread + 160
9 ruby-193 0x000000010005f941 readall + 335
10 ruby-193 0x00000001000600fe io
read + 128
11 ruby-193 0x00000001001754a0 callcfunc + 282
12 ruby-193 0x0000000100175307 vm
callcfunc + 284
13 ruby-193 0x00000001001744d0 vm
callmethod + 373
14 ruby-193 0x000000010016f032 vm
execcore + 11449
15 ruby-193 0x000000010017ee0a vm
exec + 147
16 ruby-193 0x000000010017d922 invokeblockfromc + 584
17 ruby-193 0x000000010017daa8 rb
vminvokeproc + 253
18 ruby-193 0x0000000100183da8 threadstartfunc2 + 512
19 ruby-193 0x0000000100182ec5 thread
startfunc1 + 51
20 libSystem.B.dylib 0x00007fff8850d4f6 pthreadstart + 331
21 libSystem.B.dylib 0x00007fff8850d3a9 thread_start + 13

Thread 0 crashed with X86 Thread State (64-bit):
rax: 0x0000000000000000 rbx: 0x000000000000000d rcx: 0x000000010035c948 rdx: 0x0000000000000000
rdi: 0x0000000000017766 rsi: 0x0000000000000006 rbp: 0x000000010035c960 rsp: 0x000000010035c948
r8: 0x00007fff70f2da40 r9: 0x0000000000000000 r10: 0x00007fff8851e616 r11: 0xffffff80002e4730
r12: 0x0000000000000000 r13: 0x0000000000000000 r14: 0x000000010180c888 r15: 0x00000001005ffef8
rip: 0x00007fff885225d6 rfl: 0x0000000000000202 cr2: 0x000000010035afd8

Binary Images:
0x100000000 - 0x100225fe7 +ruby-193 ??? (???) /Users/kosaki/ruby/ruby-193
0x100362000 - 0x100363fff +encdb.bundle ??? (???) /Users/kosaki/ruby/.ext/x8664-darwin10.7.4/enc/encdb.bundle
0x100366000 - 0x100367fff +transdb.bundle ??? (???) /Users/kosaki/ruby/.ext/x86
64-darwin10.7.4/enc/trans/transdb.bundle
0x7fff5fc00000 - 0x7fff5fc3bdef dyld 132.1 (???) /usr/lib/dyld
0x7fff805a7000 - 0x7fff8065dfff libobjc.A.dylib 227.0.0 (compatibility 1.0.0) /usr/lib/libobjc.A.dylib
0x7fff862ec000 - 0x7fff862f0ff7 libmathCommon.A.dylib 315.0.0 (compatibility 1.0.0) /usr/lib/system/libmathCommon.A.dylib
0x7fff86677000 - 0x7fff866f4fef libstdc++.6.dylib 7.9.0 (compatibility 7.0.0) /usr/lib/libstdc++.6.dylib
0x7fff884d3000 - 0x7fff88694fff libSystem.B.dylib 125.2.10 (compatibility 1.0.0) /usr/lib/libSystem.B.dylib
0x7fff88789000 - 0x7fff887d5fff libauto.dylib ??? (???) /usr/lib/libauto.dylib
0x7fffffe00000 - 0x7fffffe01fff libSystem.B.dylib ??? (???) /usr/lib/libSystem.B.dylib

History

#1 Updated by Akira Tanaka almost 3 years ago

  • ruby -v changed from ruby 1.9.3dev (2011-06-10 trunk 31985) [x86_64-darwin10.7.4] to -

2011/6/10 Motohiro KOSAKI kosaki.motohiro@gmail.com:

make checkが以下のように異常終了します。

Mac のテスト環境は持っていないので、実際に直るかどうかはわかりませんが、
とりあえず問題付近にあからさまにおかしいコードがあったので直しておきました.
--
[田中 哲][たなか あきら][Tanaka Akira]

#2 Updated by Akira Tanaka almost 3 years ago

2011/6/10 Motohiro KOSAKI kosaki.motohiro@gmail.com:

make checkが以下のように異常終了します。

Mac のテスト環境は持っていないので、実際に直るかどうかはわかりませんが、
とりあえず問題付近にあからさまにおかしいコードがあったので直しておきました.
--
[田中 哲][たなか あきら][Tanaka Akira]

#3 Updated by Nobuyoshi Nakada almost 3 years ago

なかだです。

At Sat, 11 Jun 2011 11:23:32 +0900,
Tanaka Akira wrote in :

make checkが以下のように異常終了します。

Mac のテスト環境は持っていないので、実際に直るかどうかはわかりませんが、
とりあえず問題付近にあからさまにおかしいコードがあったので直しておきました.

直ってました。

--
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
中田 伸悦

#4 Updated by Nobuyoshi Nakada almost 3 years ago

なかだです。

At Sat, 11 Jun 2011 11:23:32 +0900,
Tanaka Akira wrote in :

make checkが以下のように異常終了します。

Mac のテスト環境は持っていないので、実際に直るかどうかはわかりませんが、
とりあえず問題付近にあからさまにおかしいコードがあったので直しておきました.

直ってました。

--
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
中田 伸悦

#5 Updated by Koichi Sasada almost 3 years ago

  • Status changed from Assigned to Closed

Also available in: Atom PDF