Repository navigation
fix(rdc): initialize topology subcommand option state - #13694
Merged
Merged
Conversation
- Initialize the group index and its "was set" flag in the constructor so the "need to specify the group index" check cannot be skipped. - Both members were read before assignment, so with a dirty heap the validation was bypassed and an indeterminate index reached the topology query; confirmed by valgrind and by MALLOC_PERTURB_. - Matches the initialization already done by the group subcommand. - Add a CI test that runs rdci topo without -i on a dirty heap, and a changelog entry. Signed-off-by: Adam360x <Adam.pryor@amd.com>
✅ All Policy Checks Passed
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused initialization fix has regression coverage, and no blocking issues were identified.
No open issues 🎉
What changed in this PR
Fixes uninitialized topology option state so rdci topo reliably rejects a missing GPU index before connecting to the daemon.
Changes:
- Initializes the index and its presence flag.
- Adds a regression test using nonzero heap memory.
- Documents the fix in the changelog.
| File | Description |
|---|---|
| projects/rdc/tests/ci/test_rdc_core.py | Tests rejection of a missing GPU index. |
| projects/rdc/rdci/src/RdciTopologyLinkSubSystem.cc | Initializes topology option state. |
| projects/rdc/CHANGELOG.md | Records the corrected behavior. |
Review effort: Balanced
bill-shuzhou-liu
approved these changes
Oct 19, 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.
Motivation
rdci topowithout-ishould stop with "Need to specify the group index to notify". Theconstructor of
RdciTopologyLinkSubSystemleft the group index and its "was set" flaguninitialized, so on a dirty heap the check read garbage as "index given". rdci then skipped it
and asked rdcd for the topology of an undefined GPU index. Depending on the garbage, that printed
the topology of an arbitrary GPU or an unrelated error.
Technical Details
group_index_andis_group_index_setin the constructor, as the group subcommandalready does.
TestCLIUsage::test_topo_without_gpu_indexintests/ci/test_rdc_core.py. It runsrdci topowithout-iwithMALLOC_PERTURB_set, so new heap memory is nonzero. It needs noGPU or daemon because rdci checks the options before it connects.
No overlap with #13386, which changes
RdciTopologyLinkSubSystem::process()in the same file.Trial merges with the open RDC PRs that touch the same files (#13386, #13570, #13658) are clean.
Issue Tracking
No ticket. Found during a code review; valgrind and
MALLOC_PERTURB_confirmed it.Test Plan
allocator also fills new memory with nonzero bytes).
TestCLIUsageclass with the fix.Test Result
RDC_ST_BAD_PARAMETER).TestCLIUsagepasses 16/16.Submission Checklist