[GHC] #8684: hWaitForInput cannot be interrupted by async exceptions on unix

GHC ghc-devs at haskell.org
Mon Jan 8 19:34:37 UTC 2018


#8684: hWaitForInput cannot be interrupted by async exceptions on unix
-------------------------------------+-------------------------------------
        Reporter:  nh2               |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Core Libraries    |              Version:  7.6.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:  13497, 13525      |             Blocking:
 Related Tickets:  #12912, #13525    |  Differential Rev(s):  Phab:D42
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by nh2):

 OK, due to the reasons at https://phabricator.haskell.org/D42#119714 I
 found that this bug is also present in non`-threaded` on Darwin and iOS:

 `ghc-bug-8684-test.hs`

 {{{
 import Control.Concurrent
 import System.IO
 import System.Timeout

 main :: IO ()
 main = do
     forkIO $ do
         threadDelay (5 * 1000000)
         -- The timeout should terminate before we ever make it here
         putStrLn "t=5 seconds: we shouldn't be here"

     timeout (1 * 1000000) $ do
         hWaitForInput stdin (10 * 1000)
         putStrLn "we shouldn't be here"

     return ()
 }}}

 I just confirmed that this prints `t=5 seconds: we shouldn't be here` on
 OSX.

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


More information about the ghc-tickets mailing list