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

MinRK benjaminrk at gmail.com
Wed Mar 21 22:06:48 CET 2012

I have a test<https://github.com/zeromq/pyzmq/blob/master/zmq/tests/test_context.py#L168>in
pyzmq, which launches a background thread in which a socket is
bound and blocks on a recv that will never come, then the context is
terminated in the main thread. The result should be a simple ETERM in the
socket thread, but recent changes in libzmq-master have resulted in this
test segfaulting.

I discovered that this was in fact a bug in the test, because it's possible
for ctx.term() to fire during socket *creation* instead of the recv.  But
this still shouldn't cause a problem, given the general notion that
"sockets are not threadsafe; contexts are threadsafe".  The fact being that
the contexts are currently *not* threadsafe.

The bug is new in master, and does not affect 2.1.11.

isolated test case <https://gist.github.com/8835aff735f818ba3172>

pretty reliably (80% of the time on my laptop) segfaults.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120321/49009c5e/attachment.htm>

More information about the zeromq-dev mailing list