Repository navigation
Conversation
ccache drops -Xarch_host, so hsa-runtime never defines SANITIZER_AMDGPU and hipFree bad-frees the device pool allocation.
✅ All Policy Checks Passed
📖 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. |
shwetagkhatri
left a comment
There was a problem hiding this comment.
LGTM.
I have a follow up ROCr PR - ROCm/rocm-systems#14925 - after this one lands.
Approving this one - since TheRock HOST_ASAN build silently produces an un-instrumented ROCr and the breakage shows up much later as a bogus - attempting free on address which was not malloc()-ed. This PR restores the flag, which turns SANITIZER_AMDGPU on and activates the head-page swap that was supposed to be running. So this is a corrective fix for TheRock.
|
Seems like it should be resolved as #9502 reported this exact ccache bug. It was closed by #9506, which moved the Docker image to ccache 4.12.1, and #9589, which repinned the CI images. Both merged on Oct 29, two days after this PR was opened, and the PR doesn't mention them. The branch is 72 commits behind main. |
Thank you, looks like the above tickets should take care of the issue. |
Summary
hipFree()crash when host-ASAN is enabled through ci: declare build variant test triggers as data #8455 and feat(ci): enable focused host-ASAN presubmit for runtime components rocm-systems#10558.-Xarch_host -fsanitize=address. ccache drops-Xarch_*unless the compile also has-arch, sohsa-runtimenever sees a plain-fsanitize=addressand__has_feature(address_sanitizer)stays false.SANITIZER_AMDGPUis then off. GPU pool allocations do not remap the first page to host memory, the ASan chunk header in that page is not a coherent host atomic, andhipFreereportsattempting free on address which was not malloc()-ed.libhsakmtalready adds the plain flag for HOST_ASAN. This adds the same flag for the runtime, only whenTHEROCK_SANITIZERisHOST_ASAN, and only for C/C++. The global-Xarch_hostform is unchanged, so device compiles still do not see-fsanitize.pre_hook_ROCR-Runtime.cmakewas removed in Remove obsolete ROCR LibElf pre-hook #9033 with the obsolete LibElf prefetch. The file is restored with only this flag block, because the subproject loader includespre_hook_<target>.cmakewhen it exists.libamdhip64itself stays link-only ASan until CLR passes a plain flag that ccache keeps. That change is ROCm/rocm-systems#14327. The localhipFreecheck passed only with both.Test plan
hsa-runtimewith plain-fsanitize=addressand thehsa_amd_memory_pool_allocatetrampoline references__asan_init-fsanitize=addressfrom this hookhipMalloc/hipFreeon gfx942 (HSA_XNACK=1) no longer bad-frees