-
Notifications
You must be signed in to change notification settings - Fork 3
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
Crash: timer_insert #30
Comments
The last part of my code before the crash is a call to So your thread theory may be valid. And it is interesting that the log messages show that vehicle status just changed to park, and that is in the function that flashes the LED... so within 500ms two threads are calling on the LED to flash. But... I'm 99% sure that the esp_timer code we're using includes the commit you pointed at that talks about thread safety. Things we could try...
I'm not a fan of the first option. But some combination of the others sounds wise. But I bet this is hard to reproduce (unless you tell me otherwise!) |
It looks like the commit I linked only handled the delete case, not the insert. But I like your suggestion of simply avoiding this edge case by not blinking the led :) That seems straight-forward and will at least confirm the hypothesis of a thread-safety issue being the root cause. |
As you can see above, I've gone with 2 and 3b from above bulleted list. Once I merge and release we'll see how successful that is. |
After enabling crash dumps in #2 I was able to collect the following log
Depending on the version of esp_timer in use, the crash happens between these lines of code:
https://github.com/espressif/esp-idf/blob/release/v5.3/components/esp_timer/src/esp_timer.c#L327-L337
possibly the
assert
, if there are multiple threads editing the list being iterated over. There is an older commit that suggests this file has thread safety issues: espressif/esp-idf@3ba7049After symbolication of the stack:
Raw crash report
The text was updated successfully, but these errors were encountered: