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.REPsocket and start a main loop in which it receives and answers requests (usingrecv_jsonandsend_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
Creating client
Sending/receiving JSON
Destroying client's context
Finishing server's process
$ python client.py
Creating client
Sending/receiving JSON
Destroying client's context
File exists (epoll.cpp:69)
Aborted (core dumped)
System information:
zmq.__version__='2.1.11'- Python version = 2.7.3
- OS = Ubuntu 12.04 LTS