[GHC] #12873: hWaitForInput with socket as handle excepts on windows

GHC ghc-devs at haskell.org
Wed Nov 23 16:14:20 UTC 2016


#12873: hWaitForInput with socket as handle excepts on windows
--------------------------------------+----------------------------------
           Reporter:  bwurk           |             Owner:
               Type:  bug             |            Status:  new
           Priority:  normal          |         Milestone:
          Component:  Compiler        |           Version:  8.0.1
           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:
--------------------------------------+----------------------------------
 If I create a socket wrapped in a Handle (either by directly creating a
 handle with connectTo, or by creating a socket and wrapping it),
 hWaitForInput and hReady always give an exception with that handle. It
 excepts directly when calling, it does not wait until the given timeout of
 hWaitForInput has expired.

 The following code exposes the bug (requiring that a server-socket is
 listening on port 7892):
 {{{#!hs
 module SockDebug
 where
 import System.IO
 import Network

 main = do
  sock <- connectTo "localhost" (Service $ show 7892)
  hWaitForInput sock 5000

 }}}

 Excepts with "hWaitForInput: invalid argument (Invalid argument)"

 Happens both on windows 10 and windows 7.

 This is the same error as in ticket 1198 so I'd guess that the bug is in
 cbits/inputReady.c as well, but I'm not an expert.

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


More information about the ghc-tickets mailing list