[zeromq-dev] Assertion failed: !current_out (xrep.cpp:166)

Martin Sustrik sustrik at 250bpm.com
Fri Jan 28 18:50:55 CET 2011

Hi Victor,

> I've got a trouble while using XREP socket under relatively high load.
> Assertion mentioned crashes my daemon after minute or so. All that
> time it is used to reply to xreqs and to initiate message pushes with
> manually formed envelope (as an identity of an expected receiver) as
> well. Messages are from 40 bytes to 20 KBytes.
> As far as I understand looking at C++ code, the problem is attempt to
> send a new message while previous message send isn't done.  If so, how
> could it be? Could it be a threading issue? I done my code in such way
> so that a new XREP socket is created for every thread, but there is
> just one thread and just one socket on receiving (XREQ) side. Could it
> be a reason? I guess no, but who knows. I use python bindings if it
> matters, they are 2.1.1 and zeromq itself is 2.1.0.

I've checked the code and it seems the !more_out && current_out cannot 
happen unless there's a memory overwrite or something like that.

Is there a way to reproduce the problem?

As for debugging you can possibly assert() that !(!more_out && 
current_out) at each place where either more_out or current_out are set 
to double check that xrep_t doesn't get the two variables into 
inconsistent state somehow.


More information about the zeromq-dev mailing list