I have a program that sends messages on a ZMQ_DEALER socket with ZMQ_DONTWAIT. If I get back EAGAIN (perhaps because the other end is responding slowly or has gone away) I call zmq_close to close the socket and then re-establish the connection (possibly to a new server) with a new socket. ZMQ_LINGER is set to 0.
I'm occasionally seeing crashes in libzmq that look like:
I've attached a program, zmqtest.c, that reproduces this. Compile it with -lzmq and run it, it should crash after a minute or so (at least it does for me).
Ubuntu 12.04 LTS, Virtualbox VM (64-bit).
The following also appears to fix it - not sure if this renders the above mentioned patch useless though...
Hrm...my patch makes the window much harder to hit with Andy's test program, but I still hit it after quite a while (somewhere around 10 minutes). Haven't had a chance to test the reversion of the patch that added in the 'terminating' variable.
Reverting the fix for does allow the test to run indefinitely for me with zeromq 3.2.3. Recommend reverting that fix until a solution that doesn't cause asserts can be found.
The revert of has been committed to zeromq3-x (9e6bdb5b), zeromq4-x (a37c198c) and libzmq (b5d2239a). Marking this resolved.
Note that this will also be fixed in 4.0.4. (4.0.3 and 4.0.4 are not currently options in this system since the bug tracking moved to github)