#2996: Network.Socket.sClose should change socket status
-----------------------------+----------------------------------------------
Reporter:  amthrax           |          Owner:                   
    Type:  bug               |         Status:  new              
Priority:  normal            |      Component:  libraries/network
 Version:  6.10.1            |       Severity:  normal           
Keywords:                    |       Testcase:                   
      Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple 
-----------------------------+----------------------------------------------
 The current implementation of sClose in Network.Socket leaves the socket
 in a Connected state but frees the underlying OS resource.  Thus, any
 further operations on the socket may apply to a ''different'' OS object if
 something else was assigned the same FD after the socket was closed.  For
 example, sClose'ing the socket a second time can lead to some arbitrary
 other file or socket being closed.

 The attached test case was run in ghci 6.8.2 on Debian Linux sid, though
 by inspection of the Network.Socket source in 6.10.1, this is still
 present and the test case should work.  It takes advantage of the way *NIX
 allocates file descriptors to demonstrate specific misbehaviors, so may or
 may not misbehave in the intended way on other platforms.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2996>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to