[compiler-rt] [hwasan] Fix suppression of leaks from dlsym (PR #154073)

Mingjie Xu via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 18 01:13:12 PDT 2025


https://github.com/Enna1 created https://github.com/llvm/llvm-project/pull/154073

Header "lsan/lsan_common.h" is not included, CAN_SANITIZE_LEAKS macro is expanded to 0, so suppression of leaks from dlsym doesn't take effect.

>From f16887628741978881606e83593ca39f44774fee Mon Sep 17 00:00:00 2001
From: "xumingjie.enna1" <xumingjie.enna1 at bytedance.com>
Date: Mon, 18 Aug 2025 16:05:02 +0800
Subject: [PATCH] [hwasan] Fix suppression of leaks from dlsym

Header "lsan/lsan_common.h" is not included, CAN_SANITIZE_LEAKS macro is
expanded to 0, so suppression of leaks from dlsym doesn't take effect.
---
 compiler-rt/lib/hwasan/hwasan_allocation_functions.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/compiler-rt/lib/hwasan/hwasan_allocation_functions.cpp b/compiler-rt/lib/hwasan/hwasan_allocation_functions.cpp
index 25ca0a3b0b68e..7609e6cd65b7a 100644
--- a/compiler-rt/lib/hwasan/hwasan_allocation_functions.cpp
+++ b/compiler-rt/lib/hwasan/hwasan_allocation_functions.cpp
@@ -14,6 +14,7 @@
 
 #include "hwasan.h"
 #include "interception/interception.h"
+#include "lsan/lsan_common.h"
 #include "sanitizer_common/sanitizer_allocator_dlsym.h"
 #include "sanitizer_common/sanitizer_allocator_interface.h"
 #include "sanitizer_common/sanitizer_mallinfo.h"



More information about the llvm-commits mailing list