[zeromq-dev] Recent changes introduced segfaults during ctx.term

MinRK benjaminrk at gmail.com
Thu Mar 22 02:43:02 CET 2012

On Wed, Mar 21, 2012 at 15:26, Pieter Hintjens <ph at imatix.com> wrote:

> On Wed, Mar 21, 2012 at 5:18 PM, Jon Dyte <jon at totient.co.uk> wrote:
> > I think there's a race between zmq::ctx_t::terminate and
> > zmq::ctx_t::create_socket.
> >
> > If terminate gets called before create_socket has set starting to false
> > it just does delete this. In the meantime create_socket carries merrily
> on.
> Looks like you're right. I'm going to make a minimal test case in C.
> MinRK, would you log an issue? Thanks

Issue #345 opened on Jira, with Python test case attached.

> Quite impressive that the PyZMQ test cases caught this.

It only caught it due to a bug in the test, where it didn't wait for the
*actual* call that was supposed to be concurrent (test was term during
recv).  But Python threads aren't as bad as many make them out to be.

I think it was brought up elsewhere that a Python test suite might be
desirable for testing libzmq itself.  It's quite easy to write a hundred or
so little tests like this in Python, but the pyzmq test suite itself is
only meant to test that the bindings themselves are working properly.


> -Pieter
> _______________________________________________
> 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/20120321/984fb106/attachment.htm>

More information about the zeromq-dev mailing list