Skip to content

ghc-5.05: handle closed by hselect

The included program, compiled with ghc-5.05 fails with the error 
Fail: illegal operation
Action: hGetChar
Handle: {loc=<socket: 4>,type=duplex (read-
write),binary=True,buffering=none}
Reason: handle is closed
File: <socket: 4>

The error occurs on both Mac OS X 10.2.6 and FreeBSD 4.7. 

The program works as expected when compiled with ghc-5.04.2.

module Main where
import Select 
import Network
import Network.Socket 
import IO

portId = (PortNumber portNum)
portNum = 9099

main = do
    sock <- listenOn portId
    (handle,_,_) <- Network.accept sock
    putStrLn ("Read")
    c <- (hGetChar handle)
    putStrLn ("Got: " ++ show c)
Trac metadata
Trac field Value
Version None
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution ResolvedFixed
Component hslibs/util
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information