deadlock on callback call after sending disconnect from client to server

Bug #1313725 reported by Michael Frommberger on 2014-04-28
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mosquitto
Fix Released
Undecided
Unassigned

Bug Description

After sending a disconnect from the client to the server no more callbacks will be called (e.g. connect). It seems that the mosq->callback_mutex blocks after disconnecting. In _mosquitto_packet_write in net_mosq.c line 792 the pthread_mutex_unlock call is missing. the callback_mutex is taken in line 786.

Tested it with mosquitto 1.3.1 and 1.3. Same behaviour.

I attach a patch for mosquitto 1.3.1 which fixes the bug...

And here the patch fro mosquitto 1.3.1

Roger Light (roger.light) wrote :

Thanks for this, I implemented the change based on your description rather than looking at the patch, for simplicity.

Changed in mosquitto:
milestone: none → 1.3.2
status: New → Fix Committed
Changed in mosquitto:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers