[zeromq-dev] ZMQ 3.0.1 crash

Pieter Hintjens ph at imatix.com
Thu Sep 1 11:25:50 CEST 2011

Hi Emmanuel,,

Thanks for reporting this. Could you create an issue for that at

For Valgrind we've made a suppression file, see


On Thu, Sep 1, 2011 at 11:18 AM, Emmanuel TAUREL <taurel at esrf.fr> wrote:
> Hello all,
> I am using ZMQ 3.0.1 on a Ubuntu 10.10 box (32 bits)
> I am actually experimenting crashes in ZMQ when using ZMQ 3.0.1. If I use
> ZMQ 2.1.7, my software works without any problems.
> I am mainly using PUB/SUB pattern.
> The publisher publishes a multipart message with 3 parts (one of the part is
> a very small message: only one byte).
> The subscriber dynamically connects its subscriber socket to publisher(s).
> To do so, the thread in which runs the subscriber socket also has a REP
> socket and is listening on socket events using zmq::poll().
> The REP socket is used to receive dynamic connection request for the
> subscriber socket. These requests are sent by other threads using a REQ
> socket
> (inproc transport). The connection endpoint and the subscription string are
> sent in the message used by the REQ/REP communication.
> The subscriber process crashes when the code tries to connect the subscriber
> socket to a publisher.
> The crash happens in one of the 2 ZMQ threads at msg.cpp:126 in method
> zmq::msg_t::close() due to a
> "glibc detected free(): invalid pointer"
> I am using a ZMQ library compiled with ZMQ_MAKE_VALGRIND_HAPPY.
> If I run my subscriber process under valgrind, it works (!) but valgrind
> complains about memory access and invalid free.
> I attach to this mail my subscriber and publisher code which contains only
> ZMQ related code (sub.cpp and pub.cpp)
> I also attach the output from valgrind (valgrind.out)
> To reproduce the crash:
> 1 - Start one publisher with a port number and a string (pub 5555 Hello)
> 2 - Start another publisher with another port and string (pub 5556 world)
> 3 - Wait for publishers to start publishing data
> 4 - Start the subscriber with the publisher endpoints and strings (sub
> tcp://host:5555 tcp://host:5556 Hello world)
> I hope I am clear enough
> Thank's for your help
> Emmanuel Taurel
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev

More information about the zeromq-dev mailing list