Repository navigation
fix(rocroller): release acquired COMGR executable data - #14698
Merged
rkayaith merged 1 commit intoNov 4, 2026
Merged
Conversation
Generated Documentation |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the change adding cleanup of the COMGR executable-data reference after its bytes are copied.
No open issues 🎉
What changed in this PR
Fixes a host-memory leak in rocRoller’s in-process assembler, identified while expanding AddressSanitizer coverage.
Changes:
- Releases the executable-data reference acquired from COMGR after its bytes have been copied.
- The PR reports that the existing CPU-only assembler test’s detected leaks dropped from 4,204 bytes to zero.
| File | Description |
|---|---|
shared/rocroller/lib/source/Assemblers/InProcessAssembler.cpp |
Adds the missing amd_comgr_release_data(execData) cleanup call. |
Review effort: Balanced
Code Coverage Report for gfx950Summary
This PR adds/edits 62 newly uncovered lines. Artifacts
Commit Hashes |
rkayaith
marked this pull request as ready for review
October 30, 2026 19:24
✅ All Checks Passed — Ready for Review
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🎉 All checks passed! This PR is ready for review. |
rkayaith
force-pushed
the
users/rkayaith/hipblaslt-tuning-scratch-leak
branch
from
November 2, 2026 18:12
c523531 to
0abae0b
Compare
rkayaith
force-pushed
the
users/rkayaith/ROCM-33540-comgr-executable-release
branch
from
November 2, 2026 18:12
b04145e to
01beaca
Compare
talumbau
approved these changes
Nov 2, 2026
1 task
caio96
approved these changes
Nov 3, 2026
jaopaulolc
approved these changes
Nov 3, 2026
amd_comgr_action_data_get_data increments the executable data reference count. Dataset destruction releases its own reference, leaving the separately acquired execData reference outstanding. Release execData after copying its bytes, alongside the existing assemblyData cleanup. Fixes ROCM-33540.
rkayaith
changed the base branch from
users/rkayaith/hipblaslt-tuning-scratch-leak
to
develop
November 3, 2026 16:14
rkayaith
force-pushed
the
users/rkayaith/ROCM-33540-comgr-executable-release
branch
from
November 3, 2026 16:14
01beaca to
49dcc3a
Compare
rkayaith
enabled auto-merge (squash)
November 3, 2026 16:14
rkayaith
deleted the
users/rkayaith/ROCM-33540-comgr-executable-release
branch
November 4, 2026 05:53
assistant-librarian Bot
pushed a commit
to ROCm/rocRoller
that referenced
this pull request
Nov 4, 2026
fix(rocroller): release acquired COMGR executable data (#14698) JIRA ID : ROCM-33540 ## Motivation rocRoller's in-process assembler acquires the linked executable from the code-object manager (COMGR) but never releases that reference. Each assembly leaks executable data, causing host AddressSanitizer runs to fail at exit ([ROCM-33540](https://amd-hub.atlassian.net/browse/ROCM-33540)). Found while expanding ASAN testing in [#14240](ROCm/rocm-libraries#14240). ## Technical Details Release the reference acquired by `amd_comgr_action_data_get_data` after copying the executable bytes. Destroying the dataset releases its own reference; it does not release this separately acquired reference. ## Test Plan With a host AddressSanitizer (`HOST_ASAN`) TheRock build, run the existing CPU-only test without leak suppressions: ```sh env -u LD_LIBRARY_PATH -u LD_PRELOAD -u ROCROLLER_ASSEMBLER -u ROCROLLER_SAVE_ASSEMBLY \ ASAN_OPTIONS=quarantine_size_mb=600:detect_leaks=1 LSAN_OPTIONS= \ HIP_VISIBLE_DEVICES=-1 ROCR_VISIBLE_DEVICES= HSA_XNACK=0 \ rocroller-tests --gtest_filter=AssemblerTest.Basic ``` ## Test Result Leaked bytes went from 4,204 to 0. The `mci/rocm-libraries/code-analysis(rocroller)` failure is pre-existing: the job fails before analysis at `docker build -f null`, the same way it does on [`develop`](https://math-ci.amd.com/job/rocm-libraries/job/code-analysis/job/rocroller/job/develop/) and other PRs. <details> <summary>ASAN error output (before fix)</summary> ```text ================================================================= ==1667238==ERROR: LeakSanitizer: detected memory leaks Direct leak of 1240 byte(s) in 1 object(s) allocated from: #0 0x70e0e936daed in operator new(unsigned long, std::nothrow_t const&) /__w/rocm-libraries/rocm-libraries/TheRock/compiler/amd-llvm/compiler-rt/lib/asan/asan_new_delete.cpp:114:3 #1 0x70e0cb7f51a5 in amd_comgr_create_data (/home/rkayaith/repos/iree-workspace/workspaces/hipblaslt-hipsparselt-host-asan/tmp/comgr-existing-test/current-pin-dist/bin/../lib/libamd_comgr.so.3+0x5f51a5) (BuildId: 14c1bc839727066f9233f0481c919d82cabe711d) #2 0x7ffe694a9f17 (<unknown module>) Indirect leak of 2959 byte(s) in 1 object(s) allocated from: #0 0x70e0e935d174 in malloc /__w/rocm-libraries/rocm-libraries/TheRock/compiler/amd-llvm/compiler-rt/lib/asan/asan_malloc_linux.cpp:127:3 #1 0x70e0cbb4d96d (/home/rkayaith/repos/iree-workspace/workspaces/hipblaslt-hipsparselt-host-asan/tmp/comgr-existing-test/current-pin-dist/bin/../lib/libamd_comgr.so.3+0x94d96d) (BuildId: 14c1bc839727066f9233f0481c919d82cabe711d) #2 0x726170737069682c (<unknown module>) Indirect leak of 5 byte(s) in 1 object(s) allocated from: #0 0x70e0e935d174 in malloc /__w/rocm-libraries/rocm-libraries/TheRock/compiler/amd-llvm/compiler-rt/lib/asan/asan_malloc_linux.cpp:127:3 #1 0x70e0cb7d1b06 (/home/rkayaith/repos/iree-workspace/workspaces/hipblaslt-hipsparselt-host-asan/tmp/comgr-existing-test/current-pin-dist/bin/../lib/libamd_comgr.so.3+0x5d1b06) (BuildId: 14c1bc839727066f9233f0481c919d82cabe711d) SUMMARY: AddressSanitizer: 4204 byte(s) leaked in 3 allocation(s). ``` </details> ## Submission Checklist - [x] Look over the contributing guidelines at https://github.com/ROCm/TheRock/blob/main/GOVERNANCE.md#pull-requests. ## Risk level Low (2/5): releases one acquired reference after the executable bytes have been copied. [ROCM-33540]: https://amd-hub.atlassian.net/browse/ROCM-33540?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
Contributor
TheRock Submodule Bump ActivityNewest first
|
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.
JIRA ID : ROCM-33540
Motivation
rocRoller's in-process assembler acquires the linked executable from the code-object manager (COMGR) but never releases that reference. Each assembly leaks executable data, causing host AddressSanitizer runs to fail at exit (ROCM-33540).
Found while expanding ASAN testing in #14240.
Technical Details
Release the reference acquired by
amd_comgr_action_data_get_dataafter copying the executable bytes. Destroying the dataset releases its own reference; it does not release this separately acquired reference.Test Plan
With a host AddressSanitizer (
HOST_ASAN) TheRock build, run the existing CPU-only test without leak suppressions:Test Result
Leaked bytes went from 4,204 to 0.
The
mci/rocm-libraries/code-analysis(rocroller)failure is pre-existing: the job fails before analysis atdocker build -f null, the same way it does ondevelopand other PRs.ASAN error output (before fix)
Submission Checklist
Risk level
Low (2/5): releases one acquired reference after the executable bytes have been copied.