[ ghc-Bugs-734716 ] ghc-5.05: handle closed by hselect

SourceForge.net noreply at sourceforge.net
Thu May 8 11:52:54 EDT 2003


Bugs item #734716, was opened at 2003-05-08 08:52
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=734716&group_id=8032

Category: hslibs/util
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: ghc-5.05: handle closed by hselect 

Initial Comment:
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)

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=734716&group_id=8032



More information about the Glasgow-haskell-bugs mailing list