
#9168: reading/writing blocking FDs over FD_SETSIZE is broken -------------------------------------+------------------------------------ Reporter: rwbarton | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 7.8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by slyfox): Simplest "fix" (as done in non-threaded IOmanager): {{{ --- a/libraries/base/cbits/inputReady.c +++ b/libraries/base/cbits/inputReady.c @@ -25,7 +25,9 @@ fdReady(int fd, int write, int msecs, int isSock) int maxfd, ready; fd_set rfd, wfd; struct timeval tv; - + if ((fd >= (int)FD_SETSIZE) || (fd < 0)) { + return -1; + } FD_ZERO(&rfd); FD_ZERO(&wfd); if (write) { }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9168#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler