jonnydee / nzmqt

nzmqt - A lightweight C++ Qt binding for ZeroMQ
Other
199 stars 72 forks source link

Unsafe disconnect in PollingZMQContext::unregisterSocket(QObject* socket_) #8

Closed natanojl closed 11 years ago

natanojl commented 11 years ago

It seems unsafe (and unnecessary) to call disconnect on socket when unregisterSocket is called from socket's destroyed signal. If socket is has been created in a different thread than the PollingZMQContext instance was created in, the destroyed signal will arrive after socket has been destroyed, leading to a free memory read.

This seems to be the cause of some crashes reported in MythTV, http://code.mythtv.org/trac/ticket/10924, http://code.mythtv.org/trac/ticket/11043, http://code.mythtv.org/trac/ticket/11360.

Valgrind log is available at http://code.mythtv.org/trac/attachment/ticket/10924/valgrind-mythlogserver.txt.

jonnydee commented 11 years ago

Sorry that I did not react to this issue for such a long time. Thank you for your feedback. I'll incorporate your fix in the next release.

jonnydee commented 11 years ago

@natanojl Would you please be so kind and try if the bug is fixed and give me feedback?

jonnydee commented 11 years ago

I've put a corresponding comment at mythTV bug tracker.

jonnydee commented 11 years ago

As I've not received any further feedback I consider this bug as being fixed.