[GHC] #4362: error in multithreaded program "epollControl: does not exist (No such file or directory)"

GHC cvs-ghc at haskell.org
Sun Oct 3 20:49:36 EDT 2010


#4362: error in multithreaded program "epollControl: does not exist (No such file
or directory)"
-----------------------+----------------------------------------------------
    Reporter:  guest   |       Owner:                             
        Type:  bug     |      Status:  new                        
    Priority:  normal  |   Component:  libraries/base             
     Version:  7.1     |    Keywords:                             
    Testcase:          |   Blockedby:                             
          Os:  Linux   |    Blocking:                             
Architecture:  x86     |     Failure:  Incorrect result at runtime
-----------------------+----------------------------------------------------
 I wrote a program that is a standard multi threaded tcp server. It listens
 on a socket, and then it enters a loop where it does an accept for a new
 connection and then handles the connection on a new thread using forkIO.
 For each incoming connection, the program reads some data from the socket
 and then downloads a file from the web using the function simpleHTTP from
 the HTTP library.

 My program runs fine most of the time, but every now and then when I run
 my program, all of the simpleHTTP calls throw an IOException, with the
 error:

 {{{
 epollControl: does not exist (No such file or directory)
 }}}

 My program also has an additional background thread, started at program
 startup with forkIO, that periodically calls simpleHTTP and these calls
 always work, and they continue to work even as the calls from the
 connection threads throw the above error.

 From looking at the library code, it seems simpleHTTP eventually calls one
 of the low level socket functions which in turn calls
 System.Event.Thread.ensureIOManagerIsRunning, which calls
 System.Event.EPoll.new, which calls epoll_ctl which fails.

 epoll_ctl man page tells me that the reason for this error is:
 "ENOENT: op was EPOLL_CTL_MOD or EPOLL_CTL_DEL, and fd is not in epfd."

 As I said above, this problem is hard to reproduce, it only happens once
 every 30 or so invocations of my program.

 I am using ghc 7.1.20100925 and Linux 2.6.31
 I am compiling with -threaded -O2

 I'd be happy to give any any other needed information.

 Thanks

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4362>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list