[GHC] #14530: hWaitForInput causes the program to abort on Windows

GHC ghc-devs at haskell.org
Mon Nov 27 13:33:10 UTC 2017


#14530: hWaitForInput causes the program to abort on Windows
--------------------------------------+----------------------------------
           Reporter:  dnadales        |             Owner:  (none)
               Type:  bug             |            Status:  new
           Priority:  normal          |         Milestone:
          Component:  Core Libraries  |           Version:  8.0.2
           Keywords:                  |  Operating System:  Windows
       Architecture:  x86_64 (amd64)  |   Type of failure:  Runtime crash
          Test Case:                  |        Blocked By:
           Blocking:                  |   Related Tickets:
Differential Rev(s):                  |         Wiki Page:
--------------------------------------+----------------------------------
 When running the following program on Windows (10):

 {{{#!hs
 readWithinNSecs :: IO ()
 readWithinNSecs = withSocketsDo $ do
   h <- connectTo "localhost" (PortNumber 9090)
   hSetBuffering h NoBuffering
   readerTid <- forkIO $ politeReader h
   threadDelay (2 * 10^6)
   killThread readerTid

   where
     politeReader h = do
       info <- hShow h
       putStrLn info
       line <- ifM (hWaitForInput h (10^6)) (hGetLine h) (return
 "Nothing!")
       putStrLn $ "Got " ++ line
 }}}

 The program aborts with the following error:

 {{{#!text
 {loc=<socket: 380>,type=duplex (read-write),buffering=none}
 fdReady: fd is too big
 This application has requested the Runtime to terminate it in an unusual
 way.
 }}}

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


More information about the ghc-tickets mailing list