jonnydee/nzmqt

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

natanojl opened this issue · 4 comments

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.

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.

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

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

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