Merged
Conversation
Coverity complains about using moved hipFile descriptors in some tests that check for behavior after destruction. These tests could be improved, but for now we'll mark the behavior as intentional (as we do for clang).
Coverity complains about the msghdr struct not having the
msg_flags field set, so it will contain garbage.
* Explicitly set the msg_flags field to 0
* Defensively initialize the msghdr structs using {}
Coverity complains about an unclosed socket in stats.cpp under certain error conditions. Fixed by setting a common exit point where the socket is always closed if it's not -1.
zbyrne
reviewed
Mar 30, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Addresses high-severity Coverity findings in tests and stats IPC by adding explicit suppressions/initialization and improving error-path cleanup.
Changes:
- Adds Coverity “use-after-move” suppressions in file descriptor move tests.
- Value-initializes
msghdr/ related variables in fd-passing helpers to avoid partially-initialized structs. - Ensures
StatsServer::threadFn()closes its server socket on early errors.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
test/amd_detail/file-descriptor.cpp |
Marks intentional post-move inspection in tests for Coverity. |
src/amd_detail/stats.cpp |
Fully initializes message header structs and adds error-path socket cleanup in the stats server. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
zbyrne
reviewed
Mar 30, 2026
zbyrne
reviewed
Mar 30, 2026
zbyrne
approved these changes
Mar 30, 2026
* controlMsg union was not initialized
* cmsgp switched from `= nullptr` to `{}` for uniformity
* Continue when -1 && errno == EINTR * Break when -1 otherwise * Continue when 0
derobins
commented
Mar 30, 2026
| EXPECT_CALL(msys, mmap).WillOnce(testing::Return(&buff)); | ||
| EXPECT_CALL(msys, munmap); | ||
| EXPECT_CALL(msys, close).Times(2); | ||
| EXPECT_CALL(msys, close).Times(3); |
Collaborator
Author
There was a problem hiding this comment.
Have to bump this because now we are calling one more close() through the mock
zbyrne
approved these changes
Mar 30, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes a couple of high-severity issues identified by Coverity Scan
StatsServer::threadFn()Part of AIHIPFILE-161