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

Log mutex locked twice (leading to crash) #3610

Closed
alxbilger opened this issue Jan 31, 2023 · 1 comment · Fixed by #3749
Closed

Log mutex locked twice (leading to crash) #3610

alxbilger opened this issue Jan 31, 2023 · 1 comment · Fixed by #3749

Comments

@alxbilger
Copy link
Contributor

I encountered a situation where my code emitted a dmsg_warning. It triggers a Qt event to react, and change the component icon. However, something went wrong in the Qt side and a Qt error was emitted. Since we listen to Qt errors, it also emits a msg_*.
Therefore, a msg_* is called inside a dmsg_warning call. The problem is that a mutex protects each call when entering the message functions (PUBLIC_API_ENTRY_POINT_MUTEX). And if a mutex is locked twice in the same thread, it crashes.
To solve this situation, a std::recursive_mutex would help. But I think there is a design problem in the first place. To be discussed...

@hugtalbot
Copy link
Contributor

Maybe @damienmarchal could help on this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants