This bug is really bizarre: I'm doing some operations inside a class and received a "core dumped" (the process is killed) when trying to destroy the context. But when I do the same operations outside the class, the error simply does not happen!
I can reproduce the bug with two scripts:
server.py
: creates a context, creates and binds to onezmq.REP
socket and start a main loop in which it receives and answers requests (usingrecv_json
andsend_json
). When receivesSIGINT
(KeyboardInterrupt
), destroy the context and exit.client.py
: creates a context, starts a process to runserver.py
(usingsubprocess.Popen
), connects to server's socket, send/recv a JSON, destroys its context and finishes server's process sending aSIGINT
.
I've implemented another version of client.py
without using a class (client_without_class.py
) but doing the same things and the error simply does not happen! The output for the two implementations is shown below:
$ python client_without_class.py
Cr