Issue #6634 has been reported by meh. (meh. I don't care). ---------------------------------------- Bug #6634: Deadlock with join and ConditionVariable https://bugs.ruby-lang.org/issues/6634 Author: meh. (meh. I don't care) Status: Open Priority: Normal Assignee: Category: core Target version: ruby -v: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] I'm getting a fatal deadlock in one of my gems, it's a simple threadpool implementation. The library works both in Rubinius and JRuby, so I guess it's a bug. The gem is here: https://github.com/meh/ruby-threadpool The example that crashes is attached. Basically it raises a fatal deadlock if you join a thread and then call ConditionVariable#wait, I'm not 100% sure if the bug is in the ConditionVariable or what, all I know is that it happens in that situation and that it works on Rubinius and JRuby.
on 2012-06-23 16:49
on 2012-06-23 22:50
On Sat, Jun 23, 2012 at 11:49:14PM +0900, meh. (meh. I don't care) wrote: > Assignee: > > The example that crashes is attached. > > Basically it raises a fatal deadlock if you join a thread and then call ConditionVariable#wait, I'm not 100% sure if the bug is in the ConditionVariable or what, all I know is that it happens in that situation and that it works on Rubinius and JRuby. I can't seem to reproduce this error: http://www.youtube.com/watch?v=8J_eBXZ7ud4 Can you reduce the error to a self contained example that reliably fails?
on 2012-06-25 19:00
Issue #6634 has been updated by meh. (meh. I don't care). File reduced.rb added Always happens, on Arch Linux x86_64. > ruby reduced.rb reduced.rb:13:in `join': deadlock detected (fatal) from reduced.rb:13:in `<main>' ---------------------------------------- Bug #6634: Deadlock with join and ConditionVariable https://bugs.ruby-lang.org/issues/6634#change-27415 Author: meh. (meh. I don't care) Status: Open Priority: Normal Assignee: Category: core Target version: ruby -v: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] I'm getting a fatal deadlock in one of my gems, it's a simple threadpool implementation. The library works both in Rubinius and JRuby, so I guess it's a bug. The gem is here: https://github.com/meh/ruby-threadpool The example that crashes is attached. Basically it raises a fatal deadlock if you join a thread and then call ConditionVariable#wait, I'm not 100% sure if the bug is in the ConditionVariable or what, all I know is that it happens in that situation and that it works on Rubinius and JRuby.
on 2012-06-25 21:23
Issue #6634 has been updated by kosaki (Motohiro KOSAKI). Status changed from Open to Assigned Assignee set to kosaki (Motohiro KOSAKI) ---------------------------------------- Bug #6634: Deadlock with join and ConditionVariable https://bugs.ruby-lang.org/issues/6634#change-27425 Author: meh. (meh. I don't care) Status: Assigned Priority: Normal Assignee: kosaki (Motohiro KOSAKI) Category: core Target version: ruby -v: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] I'm getting a fatal deadlock in one of my gems, it's a simple threadpool implementation. The library works both in Rubinius and JRuby, so I guess it's a bug. The gem is here: https://github.com/meh/ruby-threadpool The example that crashes is attached. Basically it raises a fatal deadlock if you join a thread and then call ConditionVariable#wait, I'm not 100% sure if the bug is in the ConditionVariable or what, all I know is that it happens in that situation and that it works on Rubinius and JRuby.
on 2012-06-28 05:46
Issue #6634 has been updated by kosaki (Motohiro KOSAKI). Status changed from Assigned to Feedback >thread = Thread.new { > mutex.synchronize { > cond.wait(mutex) > } >} >thread.join This is true deadlock. The above thread.join has no chance to exit successfully. Can you please elaborate your point? ---------------------------------------- Bug #6634: Deadlock with join and ConditionVariable https://bugs.ruby-lang.org/issues/6634#change-27537 Author: meh. (meh. I don't care) Status: Feedback Priority: Normal Assignee: kosaki (Motohiro KOSAKI) Category: core Target version: ruby -v: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] I'm getting a fatal deadlock in one of my gems, it's a simple threadpool implementation. The library works both in Rubinius and JRuby, so I guess it's a bug. The gem is here: https://github.com/meh/ruby-threadpool The example that crashes is attached. Basically it raises a fatal deadlock if you join a thread and then call ConditionVariable#wait, I'm not 100% sure if the bug is in the ConditionVariable or what, all I know is that it happens in that situation and that it works on Rubinius and JRuby.
on 2012-06-29 19:04
Issue #6634 has been updated by meh. (meh. I don't care). Then I can't come up with a reduced testcase, I know that it triggers a fatal deadlock in my gem when it's actually not a deadlock. It works both in JRuby and Rubinius. ---------------------------------------- Bug #6634: Deadlock with join and ConditionVariable https://bugs.ruby-lang.org/issues/6634#change-27564 Author: meh. (meh. I don't care) Status: Feedback Priority: Normal Assignee: kosaki (Motohiro KOSAKI) Category: core Target version: ruby -v: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] I'm getting a fatal deadlock in one of my gems, it's a simple threadpool implementation. The library works both in Rubinius and JRuby, so I guess it's a bug. The gem is here: https://github.com/meh/ruby-threadpool The example that crashes is attached. Basically it raises a fatal deadlock if you join a thread and then call ConditionVariable#wait, I'm not 100% sure if the bug is in the ConditionVariable or what, all I know is that it happens in that situation and that it works on Rubinius and JRuby.
on 2012-06-29 22:43
Issue #6634 has been updated by kosaki (Motohiro KOSAKI). Unfortunately, we don't have an esp capability. "The library works both in Rubinius and JRuby, so I guess it's a bug." don't gave me any hint. sorry. ---------------------------------------- Bug #6634: Deadlock with join and ConditionVariable https://bugs.ruby-lang.org/issues/6634#change-27574 Author: meh. (meh. I don't care) Status: Feedback Priority: Normal Assignee: kosaki (Motohiro KOSAKI) Category: core Target version: ruby -v: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] I'm getting a fatal deadlock in one of my gems, it's a simple threadpool implementation. The library works both in Rubinius and JRuby, so I guess it's a bug. The gem is here: https://github.com/meh/ruby-threadpool The example that crashes is attached. Basically it raises a fatal deadlock if you join a thread and then call ConditionVariable#wait, I'm not 100% sure if the bug is in the ConditionVariable or what, all I know is that it happens in that situation and that it works on Rubinius and JRuby.
on 2012-06-30 11:43
Issue #6634 has been updated by meh. (meh. I don't care). The library is just ~250 lines. The issue is that it's thinking it's deadlocking when actually another thread is going to shutdown the threadpool (hence broadcasting on the cond and not being a deadlock). ---------------------------------------- Bug #6634: Deadlock with join and ConditionVariable https://bugs.ruby-lang.org/issues/6634#change-27588 Author: meh. (meh. I don't care) Status: Feedback Priority: Normal Assignee: kosaki (Motohiro KOSAKI) Category: core Target version: ruby -v: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] I'm getting a fatal deadlock in one of my gems, it's a simple threadpool implementation. The library works both in Rubinius and JRuby, so I guess it's a bug. The gem is here: https://github.com/meh/ruby-threadpool The example that crashes is attached. Basically it raises a fatal deadlock if you join a thread and then call ConditionVariable#wait, I'm not 100% sure if the bug is in the ConditionVariable or what, all I know is that it happens in that situation and that it works on Rubinius and JRuby.
on 2012-09-10 08:51
Issue #6634 has been updated by kosaki (Motohiro KOSAKI). Assignee deleted (kosaki (Motohiro KOSAKI)) ---------------------------------------- Bug #6634: Deadlock with join and ConditionVariable https://bugs.ruby-lang.org/issues/6634#change-29232 Author: meh. (meh. I don't care) Status: Feedback Priority: Normal Assignee: Category: core Target version: ruby -v: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] I'm getting a fatal deadlock in one of my gems, it's a simple threadpool implementation. The library works both in Rubinius and JRuby, so I guess it's a bug. The gem is here: https://github.com/meh/ruby-threadpool The example that crashes is attached. Basically it raises a fatal deadlock if you join a thread and then call ConditionVariable#wait, I'm not 100% sure if the bug is in the ConditionVariable or what, all I know is that it happens in that situation and that it works on Rubinius and JRuby.
on 2012-11-05 16:17
Issue #6634 has been updated by mame (Yusuke Endoh).
File lol2.rb added
Status changed from Feedback to Assigned
Assignee set to kosaki (Motohiro KOSAKI)
Target version set to 2.0.0
I succeeded to reproduce the issue, by adding set_trace_func to lol.rb,
redirecting the output to the file, and repeating the invocation until
the error occurs.
It looks very very timing sensitive issue.
$ gem install threadpool
$ ./ruby -v
ruby 2.0.0dev (2012-11-05 trunk 37474) [x86_64-linux]
$ ruby -e 'loop { system("./ruby lol2.rb > t") || break }'
/home/mame/work/local/lib/ruby/gems/2.0.0/gems/threadpool-0.1.2/lib/threadpool.rb:183:in
`join': No live threads left. Deadlock?
from
/home/mame/work/local/lib/ruby/gems/2.0.0/gems/threadpool-0.1.2/lib/threadpool.rb:183:in
`join'
from lol.rb:9:in `<main>'
$ ruby -e 'loop { system("./ruby lol2.rb > t") || break }'
<internal:prelude>:8:in `lock': deadlock; recursive locking
(ThreadError)
from <internal:prelude>:8:in `synchronize'
from /home/mame/work/local/lib/ruby/2.0.0/thread.rb:69:in
`wait'
from
/home/mame/work/local/lib/ruby/gems/2.0.0/gems/threadpool-0.1.2/lib/threadpool.rb:234:in
`block (3 levels) in spawn_thread'
from <internal:prelude>:10:in `synchronize'
from
/home/mame/work/local/lib/ruby/gems/2.0.0/gems/threadpool-0.1.2/lib/threadpool.rb:222:in
`block (2 levels) in spawn_thread'
from
/home/mame/work/local/lib/ruby/gems/2.0.0/gems/threadpool-0.1.2/lib/threadpool.rb:249:in
`loop'
from
/home/mame/work/local/lib/ruby/gems/2.0.0/gems/threadpool-0.1.2/lib/threadpool.rb:249:in
`block in spawn_thread'
I reviewed the source of threadpool gem, but I could find no problem.
Precisely, it may attempt to call undefined method named "reason"; it is
clearly irrelevant.
Kosaki-san, could you try to reproduce? The core behavior looks to me
indeed strange (too subtle to explain in English, sorry), but I failed
to find the bug.
面倒なので日本語で。
再現性が乏しく (うちの環境で 100 回実行に 1 回くらい?) 、gdb を使いこなせないので printf debug
で戦ってみたんですが、確かに core が怪しい挙動をしている気がしました。
CV 内の mutex を lock したはずなのになぜか threadpool 内の mutex が lock
されているような、そうでないような。
大物のタイミングバグの予感がする (GC issue かも知れませんが)
のですが、小崎さんの環境で再現できたら勝利だと思うので、試してみてもらえますでしょうか。
--
Yusuke Endoh <mame@tsg.ne.jp>
----------------------------------------
Bug #6634: Deadlock with join and ConditionVariable
https://bugs.ruby-lang.org/issues/6634#change-32435
Author: meh. (meh. I don't care)
Status: Assigned
Priority: Normal
Assignee: kosaki (Motohiro KOSAKI)
Category: core
Target version: 2.0.0
ruby -v: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
I'm getting a fatal deadlock in one of my gems, it's a simple threadpool
implementation.
The library works both in Rubinius and JRuby, so I guess it's a bug.
The gem is here: https://github.com/meh/ruby-threadpool
The example that crashes is attached.
Basically it raises a fatal deadlock if you join a thread and then call
ConditionVariable#wait, I'm not 100% sure if the bug is in the
ConditionVariable or what, all I know is that it happens in that
situation and that it works on Rubinius and JRuby.
on 2012-11-07 03:07
Issue #6634 has been updated by kosaki (Motohiro KOSAKI). Assignee changed from kosaki (Motohiro KOSAKI) to ko1 (Koichi Sasada) ---------------------------------------- Bug #6634: Deadlock with join and ConditionVariable https://bugs.ruby-lang.org/issues/6634#change-32529 Author: meh. (meh. I don't care) Status: Assigned Priority: Normal Assignee: ko1 (Koichi Sasada) Category: core Target version: 2.0.0 ruby -v: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] I'm getting a fatal deadlock in one of my gems, it's a simple threadpool implementation. The library works both in Rubinius and JRuby, so I guess it's a bug. The gem is here: https://github.com/meh/ruby-threadpool The example that crashes is attached. Basically it raises a fatal deadlock if you join a thread and then call ConditionVariable#wait, I'm not 100% sure if the bug is in the ConditionVariable or what, all I know is that it happens in that situation and that it works on Rubinius and JRuby.
on 2012-11-07 04:24
Issue #6634 has been updated by kosaki (Motohiro KOSAKI). Hi mame-san, ko1 found the second case (i.e. below) is a his regression since October. He told me he plan to fix soon. > $ ruby -e 'loop { system("./ruby lol2.rb > t") || break }' > <internal:prelude>:8:in `lock': deadlock; recursive locking (ThreadError) > from <internal:prelude>:8:in `synchronize' > from /home/mame/work/local/lib/ruby/2.0.0/thread.rb:69:in `wait' And I couldn't reproduce this issue at commit r37074 (Oct 3). So I think we haven't reproduce an original issue yet. ---------------------------------------- Bug #6634: Deadlock with join and ConditionVariable https://bugs.ruby-lang.org/issues/6634#change-32531 Author: meh. (meh. I don't care) Status: Assigned Priority: Normal Assignee: ko1 (Koichi Sasada) Category: core Target version: 2.0.0 ruby -v: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] I'm getting a fatal deadlock in one of my gems, it's a simple threadpool implementation. The library works both in Rubinius and JRuby, so I guess it's a bug. The gem is here: https://github.com/meh/ruby-threadpool The example that crashes is attached. Basically it raises a fatal deadlock if you join a thread and then call ConditionVariable#wait, I'm not 100% sure if the bug is in the ConditionVariable or what, all I know is that it happens in that situation and that it works on Rubinius and JRuby.
on 2012-11-13 11:00
Issue #6634 has been updated by ko1 (Koichi Sasada). Assignee changed from ko1 (Koichi Sasada) to mame (Yusuke Endoh) Maybe this second problem is fixed at r37647. mame-san, could you check it? ---------------------------------------- Bug #6634: Deadlock with join and ConditionVariable https://bugs.ruby-lang.org/issues/6634#change-32848 Author: meh. (meh. I don't care) Status: Assigned Priority: Normal Assignee: mame (Yusuke Endoh) Category: core Target version: 2.0.0 ruby -v: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] I'm getting a fatal deadlock in one of my gems, it's a simple threadpool implementation. The library works both in Rubinius and JRuby, so I guess it's a bug. The gem is here: https://github.com/meh/ruby-threadpool The example that crashes is attached. Basically it raises a fatal deadlock if you join a thread and then call ConditionVariable#wait, I'm not 100% sure if the bug is in the ConditionVariable or what, all I know is that it happens in that situation and that it works on Rubinius and JRuby.
on 2012-11-13 12:11
Issue #6634 has been updated by mame (Yusuke Endoh). Status changed from Assigned to Feedback Worked. Thank you! Then, anyone can reproduce the original problem? Meh, can you still reproduce? -- Yusuke Endoh <mame@tsg.ne.jp> ---------------------------------------- Bug #6634: Deadlock with join and ConditionVariable https://bugs.ruby-lang.org/issues/6634#change-32851 Author: meh. (meh. I don't care) Status: Feedback Priority: Normal Assignee: mame (Yusuke Endoh) Category: core Target version: 2.0.0 ruby -v: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] I'm getting a fatal deadlock in one of my gems, it's a simple threadpool implementation. The library works both in Rubinius and JRuby, so I guess it's a bug. The gem is here: https://github.com/meh/ruby-threadpool The example that crashes is attached. Basically it raises a fatal deadlock if you join a thread and then call ConditionVariable#wait, I'm not 100% sure if the bug is in the ConditionVariable or what, all I know is that it happens in that situation and that it works on Rubinius and JRuby.
on 2013-02-08 16:01
Issue #6634 has been updated by mame (Yusuke Endoh). Status changed from Feedback to Rejected Marking this as rejected due to lack of feedback by the submitter. -- Yusuke Endoh <mame@tsg.ne.jp> ---------------------------------------- Bug #6634: Deadlock with join and ConditionVariable https://bugs.ruby-lang.org/issues/6634#change-36059 Author: meh. (meh. I don't care) Status: Rejected Priority: Normal Assignee: mame (Yusuke Endoh) Category: core Target version: 2.0.0 ruby -v: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] I'm getting a fatal deadlock in one of my gems, it's a simple threadpool implementation. The library works both in Rubinius and JRuby, so I guess it's a bug. The gem is here: https://github.com/meh/ruby-threadpool The example that crashes is attached. Basically it raises a fatal deadlock if you join a thread and then call ConditionVariable#wait, I'm not 100% sure if the bug is in the ConditionVariable or what, all I know is that it happens in that situation and that it works on Rubinius and JRuby.
on 2013-04-29 17:12
Issue #6634 has been updated by we4tech (nhm tanveeer hossain khan). File thread_deadlock_error_test.rb added Hi there, I've faced similar problem with ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.1.0] (installed with rvm) Please checkout my attached code. Let me know if I could help you more. Or if i'm doing something dumb :) ---------------------------------------- Bug #6634: Deadlock with join and ConditionVariable https://bugs.ruby-lang.org/issues/6634#change-39043 Author: meh. (meh. I don't care) Status: Rejected Priority: Normal Assignee: mame (Yusuke Endoh) Category: core Target version: 2.0.0 ruby -v: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] Backport: I'm getting a fatal deadlock in one of my gems, it's a simple threadpool implementation. The library works both in Rubinius and JRuby, so I guess it's a bug. The gem is here: https://github.com/meh/ruby-threadpool The example that crashes is attached. Basically it raises a fatal deadlock if you join a thread and then call ConditionVariable#wait, I'm not 100% sure if the bug is in the ConditionVariable or what, all I know is that it happens in that situation and that it works on Rubinius and JRuby.
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.