Indirect Leak in __strdup not suppressed by libfontconfig in lsan_suppression.cc |
||
Issue description
By running the Lsan/Asan webkit unit tests (e.g.: FrameSerializerTest.XMLDeclaration) without suppressing __strdup in lsan_suppression.cc (and remember to comment out the existing libfontconfig suppression), and turning on
fast_unwind_on_malloc=0 to see the full stack trace,
you can see the following leak, among other few leaks:
Indirect leak of 519 byte(s) in 50 object(s) allocated from:
#0 0x5d756b in __interceptor_malloc (/usr/local/google/home/xlai/chromium/src/out/lsan/webkit_unit_tests+0x5d756b)
#1 0x7f72d718b839 in __strdup /build/eglibc-3GlaMS/eglibc-2.19/string/strdup.c:42
#2 0x7f72dba7524c in FcValueSave (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x1b24c)
#3 0x7f72dba75fb4 (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x1bfb4)
#4 0x7f72dba76e4a (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x1ce4a)
#5 0x7f72dba7bf73 (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x21f73)
#6 0x7f72db83acef in _init (/lib/x86_64-linux-gnu/libexpat.so.1+0xacef)
#7 0x7f72db83b64d in _init (/lib/x86_64-linux-gnu/libexpat.so.1+0xb64d)
#8 0x7f72db8399e0 in _init (/lib/x86_64-linux-gnu/libexpat.so.1+0x99e0)
#9 0x7f72db83a16c in _init (/lib/x86_64-linux-gnu/libexpat.so.1+0xa16c)
#10 0x7f72db83d5de in XML_ParseBuffer (/lib/x86_64-linux-gnu/libexpat.so.1+0xd5de)
#11 0x7f72dba7ad3a in FcConfigParseAndLoad (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x20d3a)
#12 0x7f72dba7b04e in FcConfigParseAndLoad (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2104e)
#13 0x7f72dba7b1d1 (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x211d1)
#14 0x7f72db83acef in _init (/lib/x86_64-linux-gnu/libexpat.so.1+0xacef)
#15 0x7f72db83b64d in _init (/lib/x86_64-linux-gnu/libexpat.so.1+0xb64d)
#16 0x7f72db8399e0 in _init (/lib/x86_64-linux-gnu/libexpat.so.1+0x99e0)
#17 0x7f72db83a16c in _init (/lib/x86_64-linux-gnu/libexpat.so.1+0xa16c)
#18 0x7f72db83d5de in XML_ParseBuffer (/lib/x86_64-linux-gnu/libexpat.so.1+0xd5de)
#19 0x7f72dba7ad3a in FcConfigParseAndLoad (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x20d3a)
#20 0x7f72dba6f84d (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x1584d)
#21 0x7f72dba6fa05 (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x15a05)
#22 0x7f72dba63c86 (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x9c86)
#23 0x7f72dba63cb8 (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x9cb8)
#24 0x36dbdfe in SkFontConfigInterfaceDirect::SkFontConfigInterfaceDirect() out/lsan/../../third_party/skia/src/ports/SkFontConfigInterface_direct.cpp:441:5
#25 0x36dd773 in SkFontConfigInterface::GetSingletonDirectInterface(SkBaseMutex*) out/lsan/../../third_party/skia/src/ports/SkFontConfigInterface_direct_factory.cpp:17:25
#26 0x36dda44 in RefFCI out/lsan/../../third_party/skia/src/ports/SkFontHost_fontconfig.cpp:48:15
#27 0x36dda44 in SkFontHost_fontconfig_ref_global() out/lsan/../../third_party/skia/src/ports/SkFontHost_fontconfig.cpp:56
#28 0x36d790e in RefFCI out/lsan/../../third_party/skia/src/fonts/SkFontMgr_fontconfig.cpp:57:12
#29 0x36d790e in SkFontMgr::Factory() out/lsan/../../third_party/skia/src/fonts/SkFontMgr_fontconfig.cpp:328
#30 0x3286bb4 in operator() out/lsan/../../third_party/skia/src/core/SkFontMgr.cpp:175:25
#31 0x3286bb4 in get<(lambda at ../../third_party/skia/src/core/SkFontMgr.cpp:174:32)> out/lsan/../../third_party/skia/include/private/SkOncePtr.h:72
#32 0x3286bb4 in SkFontMgr::RefDefault() out/lsan/../../third_party/skia/src/core/SkFontMgr.cpp:174
#33 0x347a24a in SkTypeface::CreateFromName(char const*, SkTypeface::Style) out/lsan/../../third_party/skia/src/core/SkTypeface.cpp:126:32
Note that the third method is libfontconfig. Also note that this leak looks quite similar to the other leaks.
Then, when libfontconfig suppression is in place, all the other similar leaks are suppressed except the above-mentioned one. This is because the default stack trace only lists 2 methods, the unit tests sees it as:
Indirect leak of 519 byte(s) in 50 object(s) allocated from:
#0 0x5d756b in __interceptor_malloc (/usr/local/google/home/xlai/chromium/src/out/lsan/webkit_unit_tests+0x5d756b)
#1 0x7f72d718b839 in __strdup /build/eglibc-3GlaMS/eglibc-2.19/string/strdup.c:42
and therefore the suppresion in libfontconfig doesn't work.
As a result, I add suppresion in __strdup as a temporary solution.
,
Apr 20 2016
This definitely can not be resolved before 604993, and the next clang roll would be a good time to take another look at this issue. I'll add the upstream revision number here very soon.
,
Apr 20 2016
Fixed upstream in r266931. http://llvm.org/klaus/compiler-rt/commit/b69978df2c04e4e06e3ed7ed7c0c1f471738b365/
,
Jan 11
You started fixing this bug over two years ago. Are you still working on it? |
||
►
Sign in to add a comment |
||
Comment 1 by thakis@chromium.org
, Apr 20 2016