[zeromq-dev] Assertion failed: (prefetched_msg.flags () & msg_t::more) == 0 (../src/stream.cpp:220)

Pieter Hintjens ph at imatix.com
Fri Feb 14 10:20:26 CET 2014


ZMQ_STREAM won't work over inproc://

Probably it'd be worth adding a check for that and returning an error
in bind/connect.

On Sun, Feb 9, 2014 at 9:15 AM, Laurent Alebarde <l.alebarde at free.fr> wrote:
> It seems that the cause is the use of ZMQ_STREAM with inproc ?
>
>
> Le 08/02/2014 09:16, Laurent Alebarde a écrit :
>
> Hi Devs,
>
> I assume I have done something wrong, but I don't know what. Does somebody
> has an idea what can cause such failure please ?
>
> The context is a poll of three sockets:
>
>     void *frontend = zmq_socket (ctx, ZMQ_ROUTER);
>     assert (frontend);
>     int rc = zmq_bind (frontend, "tcp://127.0.0.1:9999");
>     assert (rc == 0);
>
>     // Backend socket talks to workers over inproc -->0x7fffec001830
>     void *backend = zmq_socket (ctx, ZMQ_STREAM);
>     assert (backend);
>     rc = zmq_bind (backend, "inproc://backend");
>     assert (rc == 0);
>
>     // Control socket receives terminate command from main over inproc
>     void *control = zmq_socket (ctx, ZMQ_SUB);
>     assert (control);
>     rc = zmq_setsockopt (control, ZMQ_SUBSCRIBE, "", 0);
>     assert (rc == 0);
>     rc = zmq_connect (control, "inproc://control");
>     assert (rc == 0);
>
> The event leading to that is a CURVE/DEALER  worker connected to
> "inproc://backend" and sending its first message.
>
>
> Cheers,
>
> Laurent
>
>
> Assertion failed: (prefetched_msg.flags () & msg_t::more) == 0
> (../src/stream.cpp:220)
> Calls from top to bottom (error at the end):
>
> From:
> src/zmp.cpp
> int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_)
> Name : items_
>     Details:{{socket = 0x7fffec0008c0, fd = 0, events = 0, revents = 0},
> {socket = 0x7fffec001830, fd = 0, events = 1, revents = 0}, {socket =
> 0x7fffec002270, fd = 0, events = 1, revents = 0}}
> Name : nitems_
>     Details:3
> Name : timeout_
>     Details:-1
>
> Note 1: events in the 1st socket has been intentionnaly set to 0 to not poll
> this one.
> Note2: The socket addresses are the ones I have in the application.
>
> When it calls (i == 1):
>                 if (zmq_getsockopt (items_ [i].socket, ZMQ_EVENTS,
> &zmq_events,
>                     &zmq_events_size) == -1) {
> Then:
> int zmq_getsockopt (void *s_, int option_, void *optval_, size_t
> *optvallen_)
> Name : s_
>     Details:0x7fffec001830
> Name : option_
>     Details:15
>
> When it calls:
> int result = s->getsockopt (option_, optval_, optvallen_);
>
>
> Then:
> int zmq::socket_base_t::getsockopt (int option_, void *optval_,
>     size_t *optvallen_)
>
> When it calls:
>         if (has_in ())
>
>
> Then:
> bool zmq::socket_base_t::has_in ()
> {
>     return xhas_in ();
> }
>
> Then:
> bool zmq::stream_t::xhas_in ()
>
> When it execute:
>     zmq_assert ((prefetched_msg.flags () & msg_t::more) == 0);
> Name : prefetched_msg
>     Details:{u = {base = {unused =
> "\\001\\000\\000\\000\\377\\177\\000\\000\\240\\006w\\367\\377\\177\\000\\000@\\353\\377\\347\\377\\177\\000\\000\\247\\304F\\000\\000\\004",
> type = 101 'e', flags = 1 '\\001'}, vsm = {data =
> "\\001\\000\\000\\000\\377\\177\\000\\000\\240\\006w\\367\\377\\177\\000\\000@\\353\\377\\347\\377\\177\\000\\000\\247\\304F\\000",
> size = 4 '\\004', type = 101 'e', flags = 1 '\\001'}, lmsg = {content =
> 0x7fff00000001, unused =
> "\\240\\006w\\367\\377\\177\\000\\000@\\353\\377\\347\\377\\177\\000\\000\\247\\304F\\000\\000\\004",
> type = 101 'e', flags = 1 '\\001'}, cmsg = {data = 0x7fff00000001, size =
> 140737345160864, unused =
> "@\\353\\377\\347\\377\\177\\000\\000\\247\\304F\\000\\000\\004", type = 101
> 'e', flags = 1 '\\001'}, delimiter = {unused =
> "\\001\\000\\000\\000\\377\\177\\000\\000\\240\\006w\\367\\377\\177\\000\\000@\\353\\377\\347\\377\\177\\000\\000\\247\\304F\\000\\000\\004",
> type = 101 'e', flags = 1 '\\001'}}}
> msg_t::more = 1
>
>
> Then:
> unsigned char zmq::msg_t::flags ()
> {
>     return u.base.flags;
> }
>
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> 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
>



More information about the zeromq-dev mailing list