[zeromq-dev] zmq crash when using PGM
luca.boccassi at gmail.com
Tue Aug 14 11:49:06 CEST 2018
On Mon, 2018-08-13 at 14:52 +0800, 纪明 wrote:
> Hi all:
> We are using ZMQ to do some multicast work. The service keep
> crashing, and we found it has something to do with pgm_receiver.
> Specifically, there is a function called
> zmq::pgm_receiver_t::restart_input(), when it receives some data, it
> calls decoder to decode the message. On line 132, it checks if the
> message size is greater than zero. If yes, it will call
> function to decode the message. However, when insize is greater than
> zero, inpos could point to null. When this happens, zmq crashes when
> calling memcpy to copy something to the memory that inpos points to.
> This actually looks like a threading issue to us.
> We really appreciate if anyone familiar with this zmq could
> out a solution to this. We are using zmq in a real time environment,
> occassional message drop is more acceptable than crashing the
> We tried to change the source code a little bit, from "if (insize >
> to "if (insize > 0 && inpos)". It caused other problem.
> Thanks a lot in advance.
Are you using a socket from multiple threads by any chance?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 488 bytes
Desc: This is a digitally signed message part
More information about the zeromq-dev