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

46 views
Skip to first unread message

Chandler Carruth

unread,
Jan 14, 2015, 5:30:28 AM1/14/15
to LLVM Developers Mailing List
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/asan_malloc_linux.cc:40:3
    #1 0x7f575d8df1fe in wcsdup (/lib64/libedit.so.0+0x1c1fe)

I don't think I can fix this... ;]

-Chandler

Sergey Matveev

unread,
Jan 14, 2015, 9:43:37 AM1/14/15
to Chandler Carruth, LLVM Developers Mailing List
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

_______________________________________________
LLVM Developers mailing list
LLV...@cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev


Kostya Serebryany

unread,
Jan 14, 2015, 5:35:55 PM1/14/15
to Sergey Matveev, LLVM Developers Mailing List
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). 

Sergey Matveev

unread,
Jan 14, 2015, 5:48:53 PM1/14/15
to Kostya Serebryany, LLVM Developers Mailing List
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.
Reply all
Reply to author
Forward
0 new messages