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

Should ErrorStr be calling assertChipStackLockedByCurrentThread? #25306

Open
vivien-apple opened this issue Feb 24, 2023 · 2 comments
Open

Should ErrorStr be calling assertChipStackLockedByCurrentThread? #25306

vivien-apple opened this issue Feb 24, 2023 · 2 comments

Comments

@vivien-apple
Copy link
Contributor

Problem

While working on #25155 I end up with some Tsan data races when logging errors.

It seems that

DLL_EXPORT const char * ErrorStr(CHIP_ERROR err)
use a static buffer under the hood which is not thread safe.

We could probably add assertChipStackLockedByCurrentThread to ErrorStr but I suspect that in our current examples there are various places where this is used from the main thread.

Maybe we can just allow to pass an optional application owned buffer to ErrorStr too.

@bzbarsky-apple
Copy link
Contributor

When I try making that assert, as in #25313, various things fail.....

@stale
Copy link

stale bot commented Oct 15, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale Stale issue or PR label Oct 15, 2023
@bzbarsky-apple bzbarsky-apple removed the stale Stale issue or PR label Oct 16, 2023
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

No branches or pull requests

2 participants