[zeromq-dev] zmq crash when using PGM

Luca Boccassi 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
> process_input() 
> 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
> point 
> out a solution to this. We are using zmq in a real time environment, 
> occassional message drop is more acceptable than crashing the
> service. 
> We tried to change the source code a little bit, from "if (insize >
> 0)" 
> to "if (insize > 0 && inpos)". It caused other problem.
> Thanks a lot in advance.
> Ming

Are you using a socket from multiple threads by any chance?

Kind regards,
Luca Boccassi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20180814/63dd42cb/attachment.sig>

More information about the zeromq-dev mailing list