-
Notifications
You must be signed in to change notification settings - Fork 2k
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
missing locking #6251
Comments
I would also suggest to discuss the return value of some APIs here. I also agree that most APIs can use ScheduleWork() -- especially those just send messages, however, this also means that the code becomes asynchronous for those APIs, this may change the way of error handling code. |
In python I added a 'ScheduleWorkAndWait' for the locking aspect |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This stale issue has been automatically closed. Thank you for your contributions. |
CHIP device layer starts an IO thread to be able to respond to network activity, timers, etc. Once this task starts, calls to CHIP on any other thread must be guarded by LockChipStack/UnlockChipStack to avoid data races.
This locking is missing in many places where it is required, and must be added.
A simple approach would be to have any other threads queue their tasks via ScheduleWork() as this will invoke the task on the IO thread with the stack lock held.
See #6155, #6207 for examples of the damage we're seeing that results from improper synchronization.
The text was updated successfully, but these errors were encountered: