Skip to content
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

Merged
merged 1 commit into from Feb 8, 2023

Conversation

smjothen
Copy link
Contributor

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

@CLAassistant
Copy link

CLAassistant commented Jan 30, 2023

CLA assistant check
All committers have signed the CLA.

@espressif-bot espressif-bot added the Status: Opened Issue is new label Jan 30, 2023
@github-actions github-actions bot changed the title Use correct recursive mutex for env and regular mutex for tz Use correct recursive mutex for env and regular mutex for tz (IDFGH-9266) Jan 30, 2023
@igrr igrr added the PR-Sync-Merge Pull request sync as merge commit label Jan 30, 2023
@igrr
Copy link
Member

igrr commented Jan 30, 2023

sha=7ca5fa87c0d6e7173a353425b40293f79838859d

@igrr
Copy link
Member

igrr commented Jan 30, 2023

@smjothen thank you for the fix!

@KaeLL
Copy link
Contributor

KaeLL commented Jan 31, 2023

@igrr it'll be backported to 4.4, right?

@ESP-Marius
Copy link
Collaborator

@KaeLL Yes, when it is merged we will also backport it to 4.4

@AxelLin
Copy link
Contributor

AxelLin commented Mar 6, 2023

@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!

@ESP-Marius
Copy link
Collaborator

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Sync-Merge Pull request sync as merge commit Resolution: Done Issue is done internally Status: Done Issue is done internally
Projects
None yet
7 participants