Martin,

I do not know the zeromq code very well... and the current code not at all.

The question I raise is "Is 'active' modified and read in two different
threads?".
Because I am confident that in zeromq3-x it is modified in two threads and
a race to crash exists as a consequence.


On Fri, Apr 25, 2014 at 4:54 PM, Martin Hurton <notifications@github.com>wrote:

> In src/lb.cpp:
>
> > @@ -116,7 +116,8 @@ int zmq::lb_t::sendpipe (msg_t *msg_, pipe_t **pipe_)
> >      more = msg_->flags () & msg_t::more? true: false;
> >      if (!more) {
> >          pipes [current]->flush ();
> > -        current = (current + 1) % active;
> > +        current = (current + 1) % active; //  in zmq 3.x this causes crash if the last pipe is terminated beween the
> > +                                          //    the test for active == 0 at 109  and here as %(active==0) causes a crash.
>
> A think we can safely assert that active is non zero here.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/zeromq/libzmq/pull/982/files#r12002719>
> .
>