[GHC] #2910: throwTo can block indefinitely when target thread finishes with exceptions blocked

GHC trac at galois.com
Sat Jan 3 12:40:08 EST 2009


#2910: throwTo can block indefinitely when target thread finishes with exceptions
blocked
-------------------+--------------------------------------------------------
Reporter:  int-e   |          Owner:                
    Type:  bug     |         Status:  new           
Priority:  normal  |      Component:  Runtime System
 Version:  6.10.1  |       Severity:  normal        
Keywords:          |       Testcase:                
      Os:  Linux   |   Architecture:  x86           
-------------------+--------------------------------------------------------
 {{{throwTo}}} can block indefinitely when the target thread has exceptions
 blocked at thread creation time. The following test program demonstrates
 this problem.

 {{{
 import Control.Exception
 import GHC.Conc

 main = do
     t1 <- block $ forkIO yield
     t2 <- forkIO $ killThread t1
     threadDelay 1000000
     threadStatus t1 >>= print
     threadStatus t2 >>= print
 }}}
 can print (and does fairly reliably for me)
 {{{
 ThreadFinished
 ThreadBlocked BlockedOnException
 }}}
 See also
 http://www.haskell.org/pipermail/reactive/2009-January/000197.html

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2910>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list