How do I add suppressions to LSan when testing LLVM with ASan enabled?

I get leaks from a system library:

==16272==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 148 byte(s) in 2 object(s) allocated from:
#0 0x4a3172 in __interceptor_malloc …/build/…/projects/compiler-rt/lib/asan/
#1 0x7f575d8df1fe in wcsdup (/lib64/

I don’t think I can fix this… ;]


Run it with the slow unwinder (ASAN_OPTIONS=fast_unwind_on_malloc=0) to identify the call site, then wrap the call in an __lsan::ScopedDisabler.

  • Sergey

I would say, run with ASAN_OPTIONS=fast_unwind_on_malloc=0 and let us see the stack trace.
We are not using the suppressions with llvm yet,
and we are not yet using ScopedDisabler in the LLVM sources.
If this is an intentional leak that happens once in the process we have BuryPointer for that.
If this is a real bad leak, use ScopedDisabler locally, but don’t commit (fix instead).

I assumed that the leak is in libedit code, which we can’t fix.

It’s possible (though less likely) that libedit passes the result of wstrdup back to the caller and expects us to deallocate it.