crash closing a socket after zmq_msg_send returns EAGAIN

Description

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).

Environment

Ubuntu 12.04 LTS, Virtualbox VM (64-bit).

Status

Assignee

Unassigned

Reporter

Andy Tucker

Labels

None

Components

Fix versions

Affects versions

4.0.1
3.2.4
4.0.2

Priority

Major
Configure