[zeromq-dev] abort in mailbox.cpp after fork() and child exit
Matt Connolly
matt.connolly at me.com
Sat Aug 10 13:31:53 CEST 2013
On 8 Aug 2013, at 4:07 am, Pieter Hintjens <ph at imatix.com> wrote:
> On Wed, Aug 7, 2013 at 3:20 PM, Matt Connolly <matt.connolly at me.com> wrote:
>
>> Could it be that a child process exiting is triggering a SIGCHLD signal which is causing a “false positive” in the mailbox code?
>
> Could be. Can you investigate?
I couldn’t reproduce the issue in a C program using ZMQ or CZMQ directly.
The child signal does occur, but this appears to be being handled correctly by zeromq.
Eventually I found it. The child ruby process is destroying the context that it inherited from the parent. The io threads in the parent continue to run even though their sockets / pipes (guess!) have been altered by the child process.
This is something I can fix in the rbczmq binding so that its garbage collection will only touch contexts owned by the same process. I have a fix for it already.
The same approach may be useful for those doing bindings in other languages too.
Cheers,
Matt.
More information about the zeromq-dev
mailing list