Repository navigation
Conversation
rdc_field_watch() takes any uint32_t max_keep_samples, but the cache's eviction computed the number of samples to drop in an int. For limits above INT32_MAX, UINT32_MAX among them, that number could wrap around to more samples than the field held, and the eviction erased past the end of the field's samples: rdcd or the process that embeds RDC crashed or corrupted its memory. The eviction now drops samples only when a field holds more than its limit, and keeps the newest ones. rdc.h said that a max_keep_samples of 0 means no limit, but RDC keeps no samples for 0, and relies on it: the job statistics watch passes 0, and watches of one field merge to the larger limits. rdc.h now documents what 0 does, for max_keep_age too, and how watches of one field combine. rdc_field_get_value_since() no longer copies a field's whole sample vector, under the cache lock, to return one sample. Tests: rdc_cache_bounds_tests compiles RdcCacheManagerImpl.cc, and test_fake_gpu_cache_bounds.py watches fields in embedded RDC against the fake amd-smi. Without the fix, the large limits crash (AddressSanitizer: negative-size-param in evict_cache) or read outside the cache; the cases for the documented limits pass with and without it. Signed-off-by: Adam360x <Adam.pryor@amd.com>
Base automatically changed from
users/adam360x/rdc-fake-amdsmi-ext
to
users/adam360x/rdc-fake-gpu-tests
October 23, 2026 15:39
✅ All Policy Checks Passed
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
This branch has not been deployed
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
rdc_field_watch()takes anyuint32_tmax_keep_samples, but the cache's eviction computed the number of samples to drop in anint. For limits aboveINT32_MAX,UINT32_MAXamong them, that number could wrap around to more samples than the field held, and the eviction erased past the end of the field's samples:rdcdor the process that embeds RDC crashed or corrupted its memory.Technical Details
rdc.hsaid that amax_keep_samplesof 0 means no limit, but RDC keeps no samples for 0 and relies on it (the job statistics watch passes 0).rdc.hnow documents what 0 does, formax_keep_agetoo, and how watches of one field combine.rdc_field_get_value_since()no longer copies a field's whole sample vector, under the cache lock, to return one sample.Issue Tracking
ISSUE ID : #14107
Part of a series of RDC fixes, which #14107 lists. No JIRA ticket.
Test Plan
rdc_cache_bounds_testscompilesRdcCacheManagerImpl.cc, andtest_fake_gpu_cache_bounds.pywatches fields in embedded RDC against the fake amd-smi. Without the fix, the large limits crash (AddressSanitizer: negative-size-param inevict_cache) or read outside the cache; the cases for the documented limits pass with and without it.Test Result
Fake-GPU suite: 139 passed, 24 skipped.
tests/ci: 93 passed, 6 skipped.Submission Checklist