[compiler-rt] [asan] Add experimental 'poison_history_size' flag (PR #133175)

Thurston Dang via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 10 09:52:55 PDT 2025


================
@@ -107,6 +166,22 @@ void __asan_poison_memory_region(void const volatile *addr, uptr size) {
   uptr end_addr = beg_addr + size;
   VPrintf(3, "Trying to poison memory region [%p, %p)\n", (void *)beg_addr,
           (void *)end_addr);
+
+  if (flags()->poison_history_size > 0) {
+    GET_STACK_TRACE(/*max_size=*/16, /*fast=*/false);
+    u32 current_tid = GetCurrentTidOrInvalid();
+
+    // TODO: garbage collect stacks once they fall off the ring buffer?
+    // StackDepot doesn't currently have a way to delete stacks.
+    u32 stack_id = StackDepotPut(stack);
----------------
thurstond wrote:

Removed

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


More information about the llvm-commits mailing list