[GHC] #5238: throwSTM+catchSTM pollutes the masking state

GHC cvs-ghc at haskell.org
Sat Jun 4 09:37:01 CEST 2011


#5238: throwSTM+catchSTM pollutes the masking state
-----------------------------------+----------------------------------------
    Reporter:  mikhail.vorozhtsov  |       Owner:                
        Type:  bug                 |      Status:  new           
    Priority:  normal              |   Component:  Runtime System
     Version:  7.1                 |    Keywords:  stm           
    Testcase:                      |   Blockedby:                
          Os:  Unknown/Multiple    |    Blocking:                
Architecture:  Unknown/Multiple    |     Failure:  None/Unknown  
-----------------------------------+----------------------------------------

Comment(by mikhail.vorozhtsov):

 And it actually escapes to IO:
 {{{
 $ cat E.hs
 {-# LANGUAGE UnicodeSyntax #-}
 {-# LANGUAGE ScopedTypeVariables #-}

 import Control.Exception
 import Control.Concurrent.STM

 main = do
   ms1 ← getMaskingState
   atomically $ (throwSTM Overflow) `catchSTM`
                (\(e ∷ SomeException) → return ())
   ms2 ← getMaskingState
   putStrLn $ show (ms1, ms2)

 $ runhaskell E.hs
 (Unmasked,MaskedInterruptible)
 }}}

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



More information about the Glasgow-haskell-bugs mailing list