-
Notifications
You must be signed in to change notification settings - Fork 7.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deadlock @ mdns_free() (IDFGH-718) #1696
Comments
Suggested fix: I was able to reproduce this easily with softAP created on ubuntu machine. |
Hi, this bug has already been addressed in 6bb68a5 and 206b47c. There's still one possible deadlock (yet very improbable) calling |
mnds_free() initiates stop and delete timer tasks, which after locking the mutex could lead to a dead lock in case timer task executed before deleting the task, as it would wait indefinitelly for unlocking the mutex. This condition is fixed by calling _mdns_stop_timer without locking the mutex, because there's no need to protect any data when stopping and deleting the timer task Closes #1696
mnds_free() initiates stop and delete timer tasks, which after locking the mutex could lead to a dead lock in case timer task executed before deleting the task, as it would wait indefinitelly for unlocking the mutex. This condition is fixed by calling _mdns_stop_timer without locking the mutex, because there's no need to protect any data when stopping and deleting the timer task Closes #1696
mnds_free() initiates stop and delete timer tasks, which after locking the mutex could lead to a dead lock in case timer task executed before deleting the task, as it would wait indefinitelly for unlocking the mutex. This condition is fixed by calling _mdns_stop_timer without locking the mutex, because there's no need to protect any data when stopping and deleting the timer task Closes espressif/esp-idf#1696
mnds_free() initiates stop and delete timer tasks, which after locking the mutex could lead to a dead lock in case timer task executed before deleting the task, as it would wait indefinitelly for unlocking the mutex. This condition is fixed by calling _mdns_stop_timer without locking the mutex, because there's no need to protect any data when stopping and deleting the timer task Closes espressif/esp-idf#1696 * Original commit: espressif/esp-idf@48b5501
mnds_free() initiates stop and delete timer tasks, which after locking the mutex could lead to a dead lock in case timer task executed before deleting the task, as it would wait indefinitelly for unlocking the mutex. This condition is fixed by calling _mdns_stop_timer without locking the mutex, because there's no need to protect any data when stopping and deleting the timer task Closes espressif/esp-idf#1696 * Original commit: espressif/esp-idf@48b5501
mnds_free() initiates stop and delete timer tasks, which after locking the mutex could lead to a dead lock in case timer task executed before deleting the task, as it would wait indefinitelly for unlocking the mutex. This condition is fixed by calling _mdns_stop_timer without locking the mutex, because there's no need to protect any data when stopping and deleting the timer task Closes espressif/esp-idf#1696 * Original commit: espressif/esp-idf@48b5501
mnds_free() initiates stop and delete timer tasks, which after locking the mutex could lead to a dead lock in case timer task executed before deleting the task, as it would wait indefinitelly for unlocking the mutex. This condition is fixed by calling _mdns_stop_timer without locking the mutex, because there's no need to protect any data when stopping and deleting the timer task Closes espressif/esp-idf#1696 * Original commit: espressif/esp-idf@48b5501
mnds_free() initiates stop and delete timer tasks, which after locking the mutex could lead to a dead lock in case timer task executed before deleting the task, as it would wait indefinitelly for unlocking the mutex. This condition is fixed by calling _mdns_stop_timer without locking the mutex, because there's no need to protect any data when stopping and deleting the timer task Closes espressif/esp-idf#1696 * Original commit: espressif/esp-idf@48b5501
mnds_free() initiates stop and delete timer tasks, which after locking the mutex could lead to a dead lock in case timer task executed before deleting the task, as it would wait indefinitelly for unlocking the mutex. This condition is fixed by calling _mdns_stop_timer without locking the mutex, because there's no need to protect any data when stopping and deleting the timer task Closes espressif/esp-idf#1696 * Original commit: espressif/esp-idf@48b5501
mnds_free() initiates stop and delete timer tasks, which after locking the mutex could lead to a dead lock in case timer task executed before deleting the task, as it would wait indefinitelly for unlocking the mutex. This condition is fixed by calling _mdns_stop_timer without locking the mutex, because there's no need to protect any data when stopping and deleting the timer task Closes espressif/esp-idf#1696 * Original commit: espressif/esp-idf@48b5501
mnds_free() initiates stop and delete timer tasks, which after locking the mutex could lead to a dead lock in case timer task executed before deleting the task, as it would wait indefinitelly for unlocking the mutex. This condition is fixed by calling _mdns_stop_timer without locking the mutex, because there's no need to protect any data when stopping and deleting the timer task Closes espressif/esp-idf#1696 * Original commit: espressif/esp-idf@48b5501
mnds_free() initiates stop and delete timer tasks, which after locking the mutex could lead to a dead lock in case timer task executed before deleting the task, as it would wait indefinitelly for unlocking the mutex. This condition is fixed by calling _mdns_stop_timer without locking the mutex, because there's no need to protect any data when stopping and deleting the timer task Closes espressif/esp-idf#1696 * Original commit: espressif/esp-idf@48b5501
mdns_free() calls function _mdns_service_task_stop()
mdns_free() --> _mdns_service_task_stop() {
MDNS_SERVICE_LOCK() --> Step 1
Post ACTION_TASK_STOP to task and wait on this while loop
while (_mdns_service_task_handle) {
vTaskDelay(10 / portTICK_PERIOD_MS);
}
MDNS_SERVICE_UNLOCK();
}
on _mdns_service_task() {
Wait on queue messages() --> Step 2
if(action == ACTION_TASK_STOP)
{
break; //exit the task
}
MDNS_SERVICE_LOCK(); --> Step 3
_mdns_execute_action(a);
MDNS_SERVICE_UNLOCK();
}
If Step 1 happens and on Step2 if there are other actions pending on queue mdns task will be stuck at Step3
This can be easily reproduced if mdns_service_remove_all() is called just before mdns_free(). (happens 1 in 10 times)
The text was updated successfully, but these errors were encountered: