[clang] [Clang] Correctly handle UBSan libraries for the GPU (PR #188290)

Manuel Carrasco via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 25 06:56:50 PDT 2026


mgcarrasco wrote:

> > Can `-fsanitize=undefined -fsanitize-trap=all` now be used for GPUs? This doesn't require any library installed.
> > Is the PR enabling UBSan for HIP?
> 
> Yes, this enables UBSan on HIP / OpenMP / Whatever. All it does is respect the flags so they make it to the device. The `-fsanitize=trap` already functions without a library and #188289 adds the minimal runtime which actually prints the error. (I should note for HIP the runtime will need adjustment for the `printf` but I'm working on that)

Thanks, this is super useful! Do we have runtime tests for ASAN and HIP (somewhere)? I mean tests where the instrumented binary is actually executed. If so, could we add some for UBSan? I understand that this is a complex matter, that is why I'm asking if we do for ASAN.

https://github.com/llvm/llvm-project/pull/188290


More information about the cfe-commits mailing list