llvm-project
c1720003 - [ASan][Windows] Fixing Windows shadow memory address for arm64 (#184902)

Commit
3 days ago
[ASan][Windows] Fixing Windows shadow memory address for arm64 (#184902) This is a prerequisite for full ARM64 Windows ASan support. The runtime interception changes needed to make ASan functional end-to-end on ARM64 Windows will be opened separately. Motivated by https://github.com/microsoft/STL/pull/6095 (more specifically [this reference to clang-cl](https://github.com/microsoft/STL/pull/6095#:~:text=Not%20enabling%20GH_002030_asan_annotate_string%20and%20GH_002030_asan_annotate_vector%20yet%20due%20to%20Clang%20issues.)) The latest MSVC toolset includes ARM64 AddressSanitizer support. This change adds AArch64 to the Windows 64-bit shadow mapping condition when compiling with `-fsanitize=address` with `clang-cl`. Without this, consumers on Windows who target ARM64 with `clang-cl -fsanitize=address` and then link with `link.exe` will see this at runtime: ```text ERROR: AddressSanitizer: access-violation on unknown address ... ``` since the shadow memory offset is not properly assigned. Windows ARM64 uses the same dynamic shadow allocation strategy as x64 via `__asan_shadow_memory_dynamic_address`.
Author
Parents
Loading