[zeromq-dev] zeromq2: problem with closing pollable socket

Martin Sustrik sustrik at fastmq.com
Wed Oct 21 12:44:41 CEST 2009


Vitaly,

I've created a test program but no luck with reproducing the problem. 
Can you test it in your environment?

Thanks.
Martin

#include <zmq.h>
#include <assert.h>
#include <unistd.h>

int main ()
{
     void *ctx;
     void *s;
     int rc;

     ctx = zmq_init (1, 1, ZMQ_POLL);
     assert (ctx);

     s = zmq_socket (ctx, ZMQ_PUB);
     assert (s);

     rc = zmq_bind (s, "tcp://lo:5555");
     assert (rc == 0);

     rc = zmq_close (s);
     assert (rc == 0);

     sleep (1);

     rc = zmq_term (ctx);
     assert (rc == 0);

     return 0;
}

Martin Sustrik wrote:
> Hi Vitaly,
> 
> Yes. It's a bug (ticket ZMQII-21). Thanks for reporting it!
> 
> Martin
> 
> Vitaly Mayatskikh wrote:
>> Hi!
>>
>> When I call zmq_init(..., ZMQ_POLL), create a socket, bind it, then
>> zmq_close fails with:
>>
>> Assertion failed: false (fd_signaler.cpp:72)
>>
>> It doesn't fail w/o call to zmq_bind before zmq_close.
> 
> _______________________________________________
> 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