[GHC] #9379: Blocked STM transaction is not interruptible
#9379: Blocked STM transaction is not interruptible -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: simonmar Type: bug | Status: new Priority: normal | Milestone: Component: Runtime System | Version: 7.8.3 Keywords: | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Unknown | Type of failure: Blocked By: | None/Unknown Related Tickets: | Test Case: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- {{{#!hs import Control.Exception import Control.Concurrent import Control.Concurrent.STM import Foreign.StablePtr main :: IO () main = do tv <- atomically $ newTVar True _ <- newStablePtr tv t <- mask_ $ forkIO (blockSTM tv) killThread t blockSTM :: TVar Bool -> IO () blockSTM tv = do atomically $ do v <- readTVar tv check $ not v }}} This code blocks forever. As I understand it, since the transaction blocks, it should be interruptible even despite the mask, and so killThread must succeed here, and the program should finish promptly. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9379> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9379: Blocked STM transaction is not interruptible -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: simonmar Type: bug | Status: new Priority: normal | Milestone: Component: Runtime | Version: 7.8.3 System | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: | https://phabricator.haskell.org/D104| -------------------------------------+------------------------------------- Changes (by simonmar): * differential: => https://phabricator.haskell.org/D104 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9379#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9379: Blocked STM transaction is not interruptible -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: simonmar Type: bug | Status: new Priority: normal | Milestone: Component: Runtime | Version: 7.8.3 System | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: | https://phabricator.haskell.org/D104| -------------------------------------+------------------------------------- Comment (by Simon Marlow <marlowsd@…>): In [changeset:"9d9a55469719908bbd5cd3277e0ac79c0588dc55/ghc"]: {{{ #!CommitTicketReference repository="ghc" revision="9d9a55469719908bbd5cd3277e0ac79c0588dc55" interruptible() was not returning true for BlockedOnSTM (#9379) Summary: There's an knock-on fix in HeapStackCheck.c which is potentially scary, but I'm pretty confident is OK. See comment for details. Test Plan: I've run all the STM tests I can find, including libraries/stm/tests/stm049 with +RTS -N8 and some of the constants bumped to make it more of a stress test. Reviewers: hvr, rwbarton, austin Subscribers: simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D104 GHC Trac Issues: #9379 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9379#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9379: Blocked STM transaction is not interruptible -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: simonmar Type: bug | Status: merge Priority: normal | Milestone: 7.8.4 Component: Runtime | Version: 7.8.3 System | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: | https://phabricator.haskell.org/D104| -------------------------------------+------------------------------------- Changes (by simonmar): * status: new => merge * milestone: => 7.8.4 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9379#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9379: Blocked STM transaction is not interruptible -------------------------------------+------------------------------------- Reporter: Feuerbach | Owner: simonmar Type: bug | Status: closed Priority: normal | Milestone: 7.8.4 Component: Runtime | Version: 7.8.3 System | Keywords: Resolution: fixed | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: | https://phabricator.haskell.org/D104| -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: merge => closed * resolution: => fixed Comment: Merged. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9379#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC