Repository navigation
Conversation
Carry the ELFIO symbol hash table and note accessor fixes from upstream ELFIO PRs #174 and #173 until they land upstream. - Move the external/elfio submodule from 575bfdb to upstream main (660e905), the base of both upstream PRs, so the patches are the upstream changes verbatim. The non-git fallback clone checks out the same commit instead of Release_3.12. - Apply patches/elfio/*.patch at configure time to a copy of the header-only ELFIO in the build tree and expose it as elfio::elfio, so the submodule stays unmodified. Patched headers are only rewritten when their content changes, and configure reruns when a patch or submodule header changes. Builds with ROCPROFILER_BUILD_ELFIO=OFF use the external ELFIO package unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ 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
rocprofiler-sdk bundles ELFIO through its
external/elfiosubmodule and uses it in both standalone and TheRock builds (ROCPROFILER_BUILD_ELFIOdefaults toON). Upstream ELFIO has out-of-bounds reads and unbounded loops in symbol hash table lookup and note parsing. The fixes are in review upstream (serge1/ELFIO#174, serge1/ELFIO#173), but ELFIO has had no release since 3.12 (2023), so the SDK needs to carry them until they land.Same fixes in CLR's ELFIO copy: #10982, #10979.
Technical Details
external/elfiosubmodule from575bfdbto upstreammain(660e905), which is the base of both upstream PRs, so the patches are the upstream changes verbatim. The non-git fallback clone now checks out the same commit instead ofRelease_3.12, so git and non-git builds use the same ELFIO.external/patches/elfio/0001-Validate-note-accessor-bounds.patchand0002-Validate-symbol-hash-table-bounds.patch. Each names its upstream PR and should be removed once the submodule moves to a commit that includes it.elfio::elfio, replacingadd_subdirectory(elfio), which only defined that header-only target. The submodule stays unmodified.patchoutput.ROCPROFILER_BUILD_ELFIO=OFFkeep using the external ELFIO package unchanged.JIRA ID
SWSPLAT-24296, SWSPLAT-24318
Test Plan
rocprofiler-sdk-common-library,rocprofiler-sdk-rocattach-shared-library) compile only against the patched headers.rocattach-symbol-lookup-test, whose fixtures cover both GNU (--hash-style=gnu) and SysV (--hash-style=sysv) hash tables.rocprofv3 --kernel-traceon thetransposesample on gfx1100.Test Result
elfio-patchedinclude, never the submodule.elfio_note.hppandelfio_symbols.hppmatch Validate note accessor bounds serge1/ELFIO#173 and Disabling temp. the call to OMPT Tool Finalize #174 byte for byte.rocattach-symbol-lookup-test: passed.rocprofv3 --kernel-trace: passed on a ROCm runtime containing fix(rocr): fix out-of-bounds access in hsa_amd_signal_wait_any #8564 (TheRock nightly 2026-10-07), with queue interposition active. That was 53 rows for 1 thread × 50 iterations and 1,005 rows for 2 threads × 500 iterations, across all visible GPUs. The baseline (unpatched) SDK gives identical results..cmake-format.yaml: clean.Note: on an older ROCm runtime (7.15),
rocprofv3aborts with heap corruption, with or without this change. The cause is thehsa_amd_signal_wait_anyout-of-bounds write fixed in #8564, which the SDK's queue-interposition completion monitor hits whenever its wake signal (last slot) fires. That's unrelated to ELFIO;ROCPROFILER_QUEUE_INTERPOSITION=0avoids it on such runtimes.Submission Checklist
Prepared with AI assistance.
🤖 Generated with Claude Code