[GHC] #10759: don't throw BlockedIndefinitelyOn... in main thread

#10759: don't throw BlockedIndefinitelyOn... in main thread -------------------------------------+------------------------------------- Reporter: yokto | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | -------------------------------------+------------------------------------- In the main thread UserInterrupt can be thrown to unblock a thread. So the following program should wait for such an interrupt instead of throwing a BlockedIndefinitelyOnMVar exception {{{ main = do var <- newEmptyMVar takeMVar var `catch` (const $ putStrLn "UserInterrupt caught" :: AsyncException -> IO ()) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10759 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10759: don't throw BlockedIndefinitelyOn... in main thread -------------------------------------+------------------------------------- Reporter: yokto | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by bgamari): * cc: simonmar (added) Comment: Bringing in Simon Marlow on this one. Simon, is there any way to handle this case in RTS? It sounds like this might get a bit yucky. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10759#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10759: don't throw BlockedIndefinitelyOn... in main thread -------------------------------------+------------------------------------- Reporter: yokto | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Resolution: wontfix | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by simonmar): * status: new => closed * resolution: => wontfix Comment: It's a tradeoff - if we made it so that the main thread never got `BlockedIndefinitely` exceptions, then we would never catch deadlock or infinite loops in the main thread. There's a workaround for the case above: {{{ t <- myThreadId newStablePtr t }}} will make the main thread impervious to `BlockedIndefinitely` exceptions. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10759#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC