[compiler-rt] [sanitizer] Support "alloc_dealloc_mismatch" suppressions (PR #124197)

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 26 14:50:31 PST 2025


================
@@ -732,7 +733,8 @@ struct Allocator {
     if (!AtomicallySetQuarantineFlagIfAllocated(m, ptr, stack)) return;
 
     if (m->alloc_type != alloc_type) {
-      if (atomic_load(&alloc_dealloc_mismatch, memory_order_acquire)) {
+      if (atomic_load(&alloc_dealloc_mismatch, memory_order_acquire) &&
+          !IsStackTraceSuppressed(stack)) {
----------------
vitalybuka wrote:

This looks very random.
Why ReportAllocTypeMismatch and not ReportNewDeleteTypeMismatch?

I propose to move IsStackTraceSuppressed into Report* functions.
WDYT?

Do do so, some refactoring is needed, some Report* functions don't accept stack,
but they generate it internally anyway. We need to change that, and than move existing IsStackTraceSuppressed into Report* function.

I don't have preference if we do that before, or after the current PR.





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


More information about the llvm-commits mailing list