[zeromq-dev] Test case for the "Assertion failed: nbytes == sizeof (command_t)" error.

Mike Pearce mike at kaew.be
Sun Jun 12 14:29:38 CEST 2011


Hello,

I'm just thinking out loud after I glanced at your code, I confess that I
did not spend long enough to understand the real problem but my attention
was drawn to something you might take a 2nd look at whilst waiting for a
more serious answer.

1. The signal handler open and closes a socket per interrupt.
2. Its activation triggers the shutdown but I am guessing it could get
called more than once, i.e. during shutdown.

You could do a quick check to see if its waking up during your orderly
shutdown, perhaps disable it before you start to shutdown - make it single
shot.

Mike.

On Sat, Jun 11, 2011 at 5:05 PM, Luc Heinrich <luc at honk-honk.com> wrote:

> Hello,
>
> This is a response to a request made in another thread [1] for a test case
> allowing to reproduce the "Assertion failed: nbytes == sizeof (command_t)"
> error on orderly shutdown. I should obviously have replied to the request
> directly but I only recently joined the list and I don't have the original
> message ;) Sorry about that.
>
> I'm posting this because I actually just had this problem in a personal
> project too and I was able to build a minimal testcase to demonstrate it.
> I'm not the original poster, and I'm not sure if the context is similar but
> here it goes:
>
> https://gist.github.com/1020628
>
> Note that:
>
> * This is using ZMQ 2.1.7.
> * The problem never occurs if the tcp ZMQ_ROUTER socket is not bound.
> * The problem occurs relatively consistently, but sometimes does not.
> * I get *three* possible different assertions:
>  - sometimes it's "Assertion failed: nbytes == sizeof (command_t)
> (mailbox.cpp:194)"
>  - sometimes it's "nbytes != -1 (mailbox.cpp:190)"
>  - sometimes it's both.
>
> Let me know if you need more context or info.
>
>
> [1] http://lists.zeromq.org/pipermail/zeromq-dev/2011-May/011196.html
>
> --
> Luc Heinrich - luc at honk-honk.com
>
> _______________________________________________
> 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/20110612/9d791d57/attachment.htm>


More information about the zeromq-dev mailing list