-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Check that we are on the Matter thread when we do ErrorStr. #25313
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
base: master
Are you sure you want to change the base?
Check that we are on the Matter thread when we do ErrorStr. #25313
Conversation
This uses a single static buffer, so using it from multiple threads can race on writes to that buffer. In the worst case, we could end up with that buffer not null-terminated in a useful way.
PR #25313: Size comparison from ad5dc95 to 89a7ed9 Increases (26 builds for bl602, bl702, cc13x2_26x2, cc32xx, efr32, esp32, k32w, linux, psoc6, telink)
Decreases (10 builds for bl702, cc13x2_26x2, cc32xx, psoc6, telink)
Full report (46 builds for bl602, bl702, cc13x2_26x2, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This stale pull request has been automatically closed. Thank you for your contributions. |
PR #25313: Size comparison from 40fb7c2 to 89a7ed9 Increases (35 builds for bl602, bl702, cyw30739, efr32, esp32, k32w, linux, nrfconnect, psoc6, telink)
Decreases (14 builds for bl702, cc32xx, k32w, psoc6, telink)
Full report (57 builds for bl602, bl702, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Need to figure out how to proceed here, given the fact that we do in fact have thread-unsafe use of this buffer.... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances thread safety in error message generation by verifying that ErrorStr is only called from the Matter thread.
- Inserts a runtime assertion in ErrorStr to enforce thread confinement.
- Updates include directives to add LockTracker support.
Files not reviewed (2)
- src/ble/tests/BUILD.gn: Language not supported
- src/lib/core/tests/BUILD.gn: Language not supported
Comments suppressed due to low confidence (1)
src/lib/support/ErrorStr.cpp:60
- Ensure that this assertion is effective in production builds; if assertions are disabled in release mode, consider adding a runtime check to prevent race conditions.
assertChipStackLockedByCurrentThread();
This uses a single static buffer, so using it from multiple threads can race on writes to that buffer. In the worst case, we could end up with that buffer not null-terminated in a useful way.