libXft causes leaks of libfontconfig
All information can be found here fontconfig/fontconfig#295 (closed)
Conclusion: I investigated libXft source code and libfontconfig - and found leaks on trivial samples.
libXft not calling FcFini(); but it is must!
PS
This issue considerates very old leak witch was catched by valgrind(see log below)
- ==143430== Memcheck, a memory error detector
- ==143430== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
- ==143430== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
- ==143430== Command: ./test_fc.out
- ==143430== Parent PID: 141006
- ==143430==
- ==143430==
- ==143430== HEAP SUMMARY:
- ==143430== in use at exit: 212,213 bytes in 6,675 blocks
- ==143430== total heap usage: 15,844 allocs, 9,169 frees, 4,421,299 bytes allocated
- ==143430==
- ==143430== 288 (256 direct, 32 indirect) bytes in 1 blocks are definitely lost in loss record 61 of 105
- ==143430== at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
- ==143430== by 0x488F93D: FcPatternObjectInsertElt (fcpat.c:545)
- ==143430== by 0x489006F: FcPatternObjectAddWithBinding (fcpat.c:732)
- ==143430== by 0x4891B7E: FcPatternAppend (fcpat.c:1281)
- ==143430== by 0x489C87D: FcParsePattern (fcxml.c:3087)
- ==143430== by 0x489CB9C: FcEndElement (fcxml.c:3212)
- ==143430== by 0x4B779D9: ??? (in /usr/lib/x86_64-linux-gnu/libexpat.so.1.6.11)
- ==143430== by 0x4B786AF: ??? (in /usr/lib/x86_64-linux-gnu/libexpat.so.1.6.11)
- ==143430== by 0x4B75B82: ??? (in /usr/lib/x86_64-linux-gnu/libexpat.so.1.6.11)
- ==143430== by 0x4B7704D: ??? (in /usr/lib/x86_64-linux-gnu/libexpat.so.1.6.11)
- ==143430== by 0x4B7ADBF: XML_ParseBuffer (in /usr/lib/x86_64-linux-gnu/libexpat.so.1.6.11)
- ==143430== by 0x489D3D8: FcConfigParseAndLoadFromMemoryInternal (fcxml.c:3527)
- ==143430==
- ==143430== LEAK SUMMARY:
- ==143430== definitely lost: 256 bytes in 1 blocks
- ==143430== indirectly lost: 32 bytes in 1 blocks
- ==143430== possibly lost: 0 bytes in 0 blocks
- ==143430== still reachable: 211,925 bytes in 6,673 blocks
- ==143430== suppressed: 0 bytes in 0 blocks
- ==143430== Reachable blocks (those to which a pointer was found) are not shown.
Many projects who uses libfontconfig has similar issues and most of it marked as "false positive".
But It's not true! Leaks are real!!!