A bug of multicore IO manager

Simon Marlow marlowsd at gmail.com
Wed Sep 4 12:51:54 CEST 2013


On 03/09/13 22:57, Johan Tibell wrote:
> Hi Kazu,
>
> On Tue, Sep 3, 2013 at 2:52 PM, Kazu Yamamoto <kazu at iij.ad.jp
> <mailto:kazu at iij.ad.jp>> wrote:
>
>     Hi,
>
>     As I said before, I started running HTTP server using Mio in the real
>     world. Unfortunately, the daemon is not stable.
>
>     After one day or so, the server cannot accept any HTTP requests.  No
>     error messages from the server.
>
>     The server is alive. To terminate the server (running in a "screen"
>     terminal), single Ctrl-c is not enough. Typing Ctrl-c again terminates
>     the server.
>
>
> Could you run an strace on the process in this state so we can get an
> idea what it's doing?
>
>     After several tests, I'm getting convinced that this occurs only when
>     +RTS -N<x> is specified (where <x> >= 2). The server runs well if +RTS
>     -N<x> is not specified.
>
>
> That indicates that the problem is with the threaded RTS and perhaps
> with the IO manager.
>
>     My question: if the program complied with GHC needs double Ctrl-c to
>     terminate, what is the situation of the program?
>
>
> If Ctrl+C generates an exception (does it?) there could be an
> overzealous exception catcher somewhere that catches all exceptions,
> including your Ctrl+C.

The first Ctrl-C is sent as an Interrupted exception to the main thread. 
  The second Ctrl-C sends a SIGINT as usual, which tends to kill the 
process.

If you need two Ctrl-Cs to kill the program, it probably means that it 
deadlocked somewhere, maybe in the RTS.  Kazu: if you can attach to the 
deadlocked process with gdb and get stack traces of all the threads, 
that might help.

Cheers,
	Simon






More information about the ghc-devs mailing list