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

GHC cvs-ghc at haskell.org
Thu Dec 2 14:46:54 CET 2010


#4362: error in multithreaded program "epollControl: does not exist (No such file
or directory)"
-------------------------------+--------------------------------------------
    Reporter:  guest           |        Owner:                             
        Type:  bug             |       Status:  infoneeded                 
    Priority:  normal          |    Milestone:  7.0.2                      
   Component:  libraries/base  |      Version:  7.1                        
    Keywords:                  |     Testcase:                             
   Blockedby:                  |   Difficulty:                             
          Os:  Linux           |     Blocking:                             
Architecture:  x86             |      Failure:  Incorrect result at runtime
-------------------------------+--------------------------------------------

Comment(by StefanWehr):

 dleuschner and myself finally managed to reproduce the problem with two
 fairly small sample (but not necessarily minimal) programs. I've attached
 a tar-archive with the sample programs.

 The sample programs are a client and a server program:

 * The server has three parts:
   1. It forks 10 threads and each threads downloads every 100 milliseconds
 some data via HTTP.
   1. Another thread reports every 10 seconds the number of successful HTTP
 downloads
   1. It accepts TCP connections on port 2222. When a clients connects, the
 server forks a new thread to serve the client. Serving the clients simple
 means reading some data from the client and then closing the connection.

 * The client forks 10 threads which periodically open a TCP connection to
 the server on port 2222 and send some data.

 Here are the first few lines of the logging output from the server:

 {{{
 drghc at docidev ~/ghc-bug $ ./Server
 Run 0: 0 successful downloads
 Run 1: 450 successful downloads
 Run 2: 901 successful downloads
 ERROR: Downloading "http://gmail.com/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://www.factisresearch.com/" failed with an
 exception: epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://www.haskell.org/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://www.stefanwehr.de/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://www.factisresearch.com/" failed with an
 exception: epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://www.haskell.org/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://www.stefanwehr.de/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://www.factisresearch.com/" failed with an
 exception: epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://www.haskell.org/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://www.google.de/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://www.amazon.de/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://www.haskell.org/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://www.heise.de/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://www.stefanwehr.de/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://www.yahoo.com/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://www.factisresearch.com/" failed with an
 exception: epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://www.google.de/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://www.microsoft.com/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://www.haskell.org/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://www.heise.de/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://www.haskell.org/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://www.google.de/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://www.google.de/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://gmail.com/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://www.stefanwehr.de/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://www.google.de/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://www.yahoo.com/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://www.stefanwehr.de/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 ERROR: Thread receiveThread for <socket: 32> terminated with an exception:
 epollControl: invalid argument (Bad file descriptor)
 ERROR: Thread receiveThread for <socket: 10> terminated with an exception:
 epollControl: invalid argument (Bad file descriptor)
 ERROR: Downloading "http://www.haskell.org/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://gmail.com/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://gmail.com/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://gmail.com/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://www.factisresearch.com/" failed with an
 exception: epollControl: does not exist (No such file or directory)
 ERROR: Thread receiveThread for <socket: 32> terminated with an exception:
 epollControl: invalid argument (Bad file descriptor)
 ERROR: Downloading "http://www.stefanwehr.de/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 ERROR: Thread receiveThread for <socket: 51> terminated with an exception:
 epollControl: invalid argument (Bad file descriptor)
 ERROR: Thread receiveThread for <socket: 54> terminated with an exception:
 epollControl: invalid argument (Bad file descriptor)
 ERROR: Downloading "http://www.yahoo.com/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://gmail.com/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://www.haskell.org/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://www.google.de/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 ERROR: Downloading "http://www.yahoo.com/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 Run 3: 1319 successful downloads
 ERROR: Thread receiveThread for <socket: 34> terminated with an exception:
 epollControl: invalid argument (Bad file descriptor)
 ERROR: Thread receiveThread for <socket: 58> terminated with an exception:
 epollControl: invalid argument (Bad file descriptor)
 ERROR: Downloading "http://www.google.de/" failed with an exception:
 epollControl: does not exist (No such file or directory)
 }}}

 Some comments on the log output:

 * The clients were started some time after the server outputs the log
 message

 {{{
 Run 2: 901 successful downloads
 }}}

 Before the clients were connected, the server ran without any errors.

 * The error message

 {{{
 ERROR: Thread receiveThread for <socket: 32> terminated with an exception:
 epollControl: invalid argument (Bad file descriptor)
 }}}

 is in some sense expected because the TPC part of the server relies on
 this exception to terminate the receive thread for a client.

 * Stopping the clients also stops the `epollControl` errors from
 happening. Starting the clients again causes the `epollControl` error to
 appear again.

 We ran the server and the clients on the same machine and we also ran them
 on different machines, with no noticable difference.

 However, we discovered that the `epollControll` errors disappear if the
 clients close their sockets explicitly via `sClose` (see the line with the
 comment in Clients.hs).

 How to run the sample programs: Unpack the archive, execute `make`, then
 `./Server` and some time later `./Clients`.

 In case you cannot reproduce the problem on your machine: we were able to
 reproduce it on the machine mentioned earlier, the code is located in
 `/home/drghc/ghc-bug`.

 Many thanks for helping!

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



More information about the Glasgow-haskell-bugs mailing list