3 Commits

Author SHA1 Message Date
Thurston Dang
3ad2cd5e70 [asan] Fix-forward #133175 by restricting newly-added tests to Linux
This was failing on Mac
(https://green.lab.llvm.org/job/llvm.org/job/clang-stage1-RA/4107/ and
https://issues.chromium.org/issues/409995888). Since this is an
experimental feature, rather than play whack-a-mole with selectively
disabling failing platforms (previously done for Android), this patch
restricts it to Linux.
2025-04-11 15:09:41 +00:00
Thurston Dang
6c51603e4c [asan] Temporarily disable new test cases from #133175 on Android
My patch causes a build breakage on Android
(https://lab.llvm.org/buildbot/#/builders/186/builds/8103/steps/21/logs/stdio).
I can't easily test on Android, which is not the intended audience for
my patch anyway, so temporarily disable the test pending further
investigation.
2025-04-10 22:28:01 +00:00
Thurston Dang
721af7e636
[asan] Add experimental 'poison_history_size' flag (#133175)
This adds an experimental flag that will keep track of where the manual memory poisoning (`__asan_poison_memory_region`) is called from, and print the stack trace if the poisoned region is accessed. (Absent this flag, ASan will tell you what code accessed a poisoned region, but not which code set the poison.)

This implementation performs best-effort record keeping using ring buffers, as suggested by Vitaly. The size of each ring buffer is set by the `poison_history_size` flag.
2025-04-10 13:53:54 -07:00