From: Hongli Lai Date: 2011-02-21T18:41:56+09:00 Subject: [ruby-core:35324] [Backport87-Backport#1471] "Mutual join" deadlock detection faulty in 1.8.6 and 1.8.7 Issue #1471 has been updated by Hongli Lai. This bug is still very much alive in Ruby 1.8.7-p334. mutual_join_bug.rb still triggers the bug. Though it is fixed in 1.9. John Carter's patches fixes the problem in mutual_join_bug.rb, but unfortunately causes a regression. Here's a test case: https://gist.github.com/836861 This test case spawns 50 threads. Each thread repeatedly downloads from microsoft.com, then grabs a lock, increases a counter and prints a progress message. If you let this script run for a few seconds, then interrupt it with Ctrl-C then sometimes it will crash with "[BUG] Internal consistency failure!". Sample session: $ ruby threaddownload.rb 80287834: Progress = 1 808b4a68: Progress = 2 808b35a0: Progress = 3 808b29fc: Progress = 4 808b1e30: Progress = 5 808735f4: Progress = 6 ^Cthreaddownload.rb:19: [BUG] Internal consistency failure! Expected thread to already be in waiting to join state 8, was in 0 This makes threading on Ruby 1.8 currently nearly useless. I don't have enough expertise to solve this problem unfortunately but I would like to request the core team to put more priority on this bug. ---------------------------------------- http://redmine.ruby-lang.org/issues/show/1471 ---------------------------------------- http://redmine.ruby-lang.org