[clang] [ASAN] For Asan instrumented global, emit two symbols, one with actual size and other with instrumented size. (PR #70166)

Mitch Phillips via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 27 00:56:04 PDT 2023


hctim wrote:

I talked with some folks internally and we came to the consensus that this'll almost certainly break some debugging tools and such, it probably won't effect the runtime of binaries, but I wouldn't say that this is a super confidence-inspiring thing to do.

> AMD language runtimes provide queries for the size of device global symbols and functions to copy data to and from device global variables. Runtime gets the needed information form the ELF symbol table. So, when it querires the size of device global variable, it gets the padded size rather than actual size.

It's my understanding your problem is that you are asan-trapping on the redzones when you copy data to/from the device. Is it possible instead to just make those copy-from and copy-to functions in the runtime `__attribute__((no_sanitize("address")))` and copy the padding as well?

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


More information about the cfe-commits mailing list