[zeromq-dev] Segfault

Dhammika Pathirana dhammika at gmail.com
Mon Jan 3 09:24:46 CET 2011


Hi Martin,

On Sun, Jan 2, 2011 at 11:56 PM, Martin Sustrik <sustrik at 250bpm.com> wrote:
> On 01/02/2011 06:35 AM, Dhammika Pathirana wrote:
>
>> There's a off by one indexing error in load balancer.
>
> This in in the test program, not 0MQ itself, right?
>

It's actually in zmq.
Terminated pipe writer gets a "activate" command. But load balancer
doesn't decrement active pipe count in terminate() call.

 55 void zmq::lb_t::terminate ()
 56 {
 57     zmq_assert (!terminating);
 58     terminating = true;
 59
 60     sink->register_term_acks (pipes.size ());
 61     for (pipes_t::size_type i = 0; i != pipes.size (); i++)
 62         pipes [i]->terminate ();
 63 }



>> Shutdown code is bit gnarly.
>
> More than a bit :) If anyone has any idea of how to make the shutdown code
> less complex, let me know, please.
>

It's like TCP shutdown!
Do we have a diagram of shutdown event flow?


Dhammika



More information about the zeromq-dev mailing list