Skip to content

[ASan] Exclude .hipFatBinSegment and .nvFatBinSegment from instrument…#2544

Open
geomin12 wants to merge 1 commit into
amd-stagingfrom
users/geomin12/asan-hipfatbin-fix
Open

[ASan] Exclude .hipFatBinSegment and .nvFatBinSegment from instrument…#2544
geomin12 wants to merge 1 commit into
amd-stagingfrom
users/geomin12/asan-hipfatbin-fix

Conversation

@geomin12
Copy link
Copy Markdown

These sections contain tightly-packed arrays of __CudaFatBinaryWrapper structs (24 bytes each). The HIP/CUDA runtime and tools like rocm-kpack walk these sections assuming a contiguous 24-byte stride.

When ASan instruments globals in these sections, it adds redzones and alignment padding, breaking the layout assumption. This causes failures like:

  • ".hipFatBinSegment size 128 is not a multiple of wrapper size (24)"
  • "Unexpected magic 0x00000000 at wrapper 1"

Add these sections to the exemption list in shouldInstrumentGlobal(), similar to .preinit_array, .init_array, and .fini_array.

Fixes: ROCm/TheRock#4680

Noticed issue in https://github.com/ROCm/TheRock/actions/runs/24646315874/job/72061754947 and now fixed and tested here: https://github.com/ROCm/TheRock/actions/runs/25816355734/job/75859833854

…ation

These sections contain tightly-packed arrays of __CudaFatBinaryWrapper
structs (24 bytes each). The HIP/CUDA runtime and tools like rocm-kpack
walk these sections assuming a contiguous 24-byte stride.

When ASan instruments globals in these sections, it adds redzones and
alignment padding, breaking the layout assumption. This causes failures
like:
  - ".hipFatBinSegment size 128 is not a multiple of wrapper size (24)"
  - "Unexpected magic 0x00000000 at wrapper 1"

Add these sections to the exemption list in shouldInstrumentGlobal(),
similar to .preinit_array, .init_array, and .fini_array.

Fixes: ROCm/TheRock#4680

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@geomin12
Copy link
Copy Markdown
Author

resolved in 6d92257

@geomin12 geomin12 closed this May 14, 2026
@geomin12 geomin12 deleted the users/geomin12/asan-hipfatbin-fix branch May 14, 2026 16:56
@geomin12 geomin12 restored the users/geomin12/asan-hipfatbin-fix branch May 14, 2026 16:59
@geomin12 geomin12 reopened this May 14, 2026
@geomin12 geomin12 requested a review from ronlieb May 14, 2026 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Issue] Multi-Arch CI ASAN failing: kpack split_artifacts errors (Unexpected magic 0x00000000 / hipFatBinSegment size not multiple of wrapper size)

1 participant