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

#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

#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 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: #7353 | Differential Rev(s): Wiki Page: | ----------------------------------+-------------------------------------- Changes (by Phyx-): * related: => #7353 Comment: Hi, thanks for the report. Unfortunately the I/O system for Windows is a bit lacking at the moment. There is some progress in rewriting it with a proper one but I don't know the current progress. See #7353 . There may however be a workaround for this specific case. That will have to be investigated. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12873#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: #7353 | Differential Rev(s): Wiki Page: | ----------------------------------+-------------------------------------- Comment (by pjljvdlaar): I had a similar problem with hWaitForInput. The work around I found was to move to Haskell platform 2013, with The Glorious Glasgow Haskell Compilation System, version 7.6.3 Also your example works perfectly with ghc 7.6.3! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12873#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: #7353 | Differential Rev(s): Wiki Page: | ----------------------------------+-------------------------------------- Comment (by bwurk): Unfortunately, that would mean downgrading infrastructure and packages, so I'm curious to the changes which introduce this bug. As far as I can tell, there are no relevant changes in cbits/inputReady.c from 7.6.3 to recent versions of GHC which could have caused this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12873#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12873: hWaitForInput with socket as handle excepts on windows ----------------------------------+-------------------------------------- Reporter: bwurk | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: Runtime crash | Test Case: Blocked By: 11394 | Blocking: Related Tickets: #7353 | Differential Rev(s): Wiki Page: | ----------------------------------+-------------------------------------- Changes (by Phyx-): * blockedby: => 11394 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12873#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC