[zeromq-dev] Assertion failure when receiving

Ale Strooisma a.strooisma at student.utwente.nl
Mon May 9 10:10:37 CEST 2016


Thanks for your response, I found the issue. I stored some zmq::message_t
objects (C++ high-level binding) in a vector and it turns out I did some
wrong bounds checking:

if (my_vector.size() > 0) { // should be a 1
    size_t size = my_vector[1].size(); // example, did some more complex
work
}

So that call to my_vector[1] created a new object that was not initialized
properly...


On 6 May 2016 at 18:01, Doron Somech <somdoron at gmail.com> wrote:

> it seems you didn't initialize the zmq_msg structure before calling the
> receive method.
>
> Make sure to call zmq_msg_init before receiving the message.
>
> On Fri, May 6, 2016 at 6:38 PM, Ale Strooisma <
> a.strooisma at student.utwente.nl> wrote:
>
>> Hi guys,
>>
>> when receiving a message I get this error/warning:
>>
>>     Assertion failed: check () (msg.cpp:220)
>>
>> That is on the "unlikely" line of this bit:
>>
>> int zmq::msg_t::close ()
>> {
>>     // Check the validity of the message.
>>     if (unlikely (!check ())) {
>>         errno = EFAULT;
>>         return -1;
>>     }
>>     ...
>>
>>
>> I don't really know what I should be looking for here. Could somebody
>> give some hints?
>>
>>
>> Kind regards,
>> Ale Strooisma
>>
>> _______________________________________________
>> zeromq-dev mailing list
>> zeromq-dev at lists.zeromq.org
>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>>
>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20160509/231fd5a1/attachment.htm>


More information about the zeromq-dev mailing list