-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
Use correct recursive mutex for env and regular mutex for tz (IDFGH-9266) #10649
Use correct recursive mutex for env and regular mutex for tz (IDFGH-9266) #10649
Conversation
sha=7ca5fa87c0d6e7173a353425b40293f79838859d |
@smjothen thank you for the fix! |
@igrr it'll be backported to 4.4, right? |
@KaeLL Yes, when it is merged we will also backport it to 4.4 |
@ESP-Marius Just remind that v4.4 branch still does not include this fix! |
@AxelLin it is already merged in our internal gitlab repo. It will be available the next time v4.4 passes QA and syncs to github. |
Newlib defines __env_lock_object as a recursive mutex and __tz_lock_object as a regular mutex, but when initialized in esp_newlib_locks_init, __env_lock_object gets initialized as a regular mutex (points to s_common_mutex) and __tz_lock_object gets initialized to a recursive mutex (s_common_recursive_mutex).
This causes a lot of panics due to various mutex ownership checks in the FreeRTOS code, but only seems to appear when there is a lot of usage of the __tz_lock_object and __env_lock_object. I believe this is also causing the crashes referred to in the issues: #10626 and #9441