You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The fix correctly addresses the MISSING_LOCK defect by acquiring xconfProfileLock before reading the shared globals isOnDemandReport and isAbortTriggered, copying them to local variables, resetting isAbortTriggered under the lock, then releasing the lock before using the local copies. The logic is semantically preserved: the abort flag reset still occurs once per loop iteration, and the publish status calls use the same values as before. The fix is minimal and introduces no new defects.
The reason will be displayed to describe this comment to others. Learn more.
🟢 Approval recommended
The race fix is addressed; the remaining regression-test request is non-blocking.
Pull request overview
This PR fixes a Coverity-reported data race in XCONF report status handling.
Changes:
Protects shared status flags with xconfProfileLock.
Snapshots and resets flags under the mutex.
Publishes status using local values after unlocking.
File summaries
File
Description
source/bulkdata/profilexconf.c
Synchronizes shared report-status state.
Review details
Suppressed comments (1)
source/bulkdata/profilexconf.c:540
This changes the synchronization and status snapshot on the report-thread path, but the only test that exercises ProfileXConf_notifyTimeout(..., true) and verifies publishReportUploadStatus is commented out in source/test/bulkdata/profilexconfTest.cpp:551-595. Please enable or replace it with a focused test that covers the report/status path, including concurrent notification, so this race fix has an active regression check.
Sets abort state once.
Verifies the first failure publishes ABORTED.
Calls the helper again without resetting globals.
Verifies the next failure publishes FAILURE, proving isAbortTriggered was reset.
Adds a separate non-on-demand test verifying no status is published.
Tests bypass production status call and omit success path
source/bulkdata/profilexconf.c:574
The added tests call the test-only test_publishReportUploadStatusForResult wrapper directly, so the changed production call at this site is never exercised; a regression that removes or misplaces this call would still pass. The success path is also not covered because both tests pass T2ERROR_FAILURE. Please add an active test that drives ProfileXConf_notifyTimeout/the report worker through this call and asserts the success status as well as the abort/reset cases.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#Fix for Coverity Defects
Triggered by: ThamimRazith AbbasAli
Fixed Files
source/bulkdata/profilexconf.cFix Summaries
source/bulkdata/profilexconf.cThe fix correctly addresses the MISSING_LOCK defect by acquiring xconfProfileLock before reading the shared globals isOnDemandReport and isAbortTriggered, copying them to local variables, resetting isAbortTriggered under the lock, then releasing the lock before using the local copies. The logic is semantically preserved: the abort flag reset still occurs once per loop iteration, and the publish status calls use the same values as before. The fix is minimal and introduces no new defects.
Repository Guidelines Applied
.github/copilot-instructions.md(instruction).github/instructions/c-embedded.instructions.md(instruction)Activated skills: thread-safety-analyzer