esp_dpp: crash when calling esp_supp_dpp_deinit then init again without delay (IDFGH-9524) (IDFGH-9525) #10879
Closed
3 tasks done
Labels
Resolution: Cannot Reproduce
Issue cannot be reproduced
Status: Done
Issue is done internally
Type: Bug
bugs in IDF
Answers checklist.
IDF version.
v4.4.4 and v5.0.1
Operating System used.
Linux
How did you build your project?
Other (please specify in More Information)
If you are using Windows, please specify command line type.
None
Development Kit.
ESP32-C3-DevKit-M-1
Power Supply used.
USB
What is the expected behavior?
esp_supp_dpp_deinit then esp_supp_dpp_init should work without crash and behave functionally the same as the first time it is init. This is especially important as we must use this workaround until #10865 is merged in master (i.e. you cannot simply call esp_supp_dpp_start_listen to resume after an error). The effect of these two issues combined is that any error at all, including user error, is fatal to the MCU with respect to DPP and the device must be rebooted to try provisioning again.
What is the actual behavior?
High probability of a crash, due to the following race condition:
Steps to reproduce.
Minimum steps to reproduce are simply:
Usually will crash after 2 or 3 iterations of the loop.
The dpp-enrolle example can be modified to simply do it's initializing in a
while (true) { ... }
loop. Replace xEventGroupWaitBits with vTaskDelay.Debug Logs.
More Information.
I used Rust when I first discovered the bug, but can confirm it repros even in a modified dpp-enrollee example. For the Rust support, see esp-rs/esp-idf-sys#168.
The text was updated successfully, but these errors were encountered: