Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

ASAN reports memory leaks from libfontconfig

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
9 posts • Page 1 of 1
Author
Message
ONEEYEMAN
Advocate
Advocate
Posts: 3709
Joined: Tue Mar 01, 2005 9:49 pm

ASAN reports memory leaks from libfontconfig

  • Quote

Post by ONEEYEMAN » Sat Mar 14, 2026 6:57 am

Hi, ALL,
I recently started using ASAN and I think I prefer it more over valgrind... ;-)

However upon exiting my program I'm getting the report of "Direct memory leaks" from libfontconfig.

I tried to talk to GNOME devs, but they suggested to use a suppresor pr get a full stack trace for the leak.

Should I continue pursuing this? Or use a suppressing file?

Thank you.
Top
GDH-gentoo
Advocate
Advocate
User avatar
Posts: 2111
Joined: Sat Jul 20, 2019 7:02 pm
Location: South America

Re: ASAN reports memory leaks from libfontconfig

  • Quote

Post by GDH-gentoo » Sat Mar 14, 2026 2:24 pm

ONEEYEMAN wrote:I tried to talk to GNOME devs, but they suggested to use a suppresor pr get a full stack trace for the leak.

Should I continue pursuing this? Or use a suppressing file?
I would go for the "get a full stack trace for the leak" alternative. It might help detect and fix an actual bug.
Ionen wrote:As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Top
ONEEYEMAN
Advocate
Advocate
Posts: 3709
Joined: Tue Mar 01, 2005 9:49 pm

  • Quote

Post by ONEEYEMAN » Sat Mar 14, 2026 3:43 pm

Hi,
I need to recompile fontconfig, right?

Thank you.
Top
GDH-gentoo
Advocate
Advocate
User avatar
Posts: 2111
Joined: Sat Jul 20, 2019 7:02 pm
Location: South America

  • Quote

Post by GDH-gentoo » Sat Mar 14, 2026 3:58 pm

Never used ASAN, but I suppose so. Adjusting CFLAGS to pass -fsanitize=address, and whatever your chosen compiler recommends:
  • GCC.
  • Clang.
Ionen wrote:As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Top
ONEEYEMAN
Advocate
Advocate
Posts: 3709
Joined: Tue Mar 01, 2005 9:49 pm

  • Quote

Post by ONEEYEMAN » Sat Mar 14, 2026 4:54 pm

Hi,
I thought all I need is to follow https://wiki.gentoo.org/wiki/Debugging for fontconfig…

Thank you.
Top
GDH-gentoo
Advocate
Advocate
User avatar
Posts: 2111
Joined: Sat Jul 20, 2019 7:02 pm
Location: South America

  • Quote

Post by GDH-gentoo » Sat Mar 14, 2026 5:59 pm

I just discovered there's a Wiki article. It seems to align with what I wrote.
Ionen wrote:As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Top
ONEEYEMAN
Advocate
Advocate
Posts: 3709
Joined: Tue Mar 01, 2005 9:49 pm

  • Quote

Post by ONEEYEMAN » Sun Mar 15, 2026 1:25 am

Hi,
This is from that report:
==5673==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 23040 byte(s) in 36 object(s) allocated from:
#0 0x7f3b904549d0 in __interceptor_realloc /var/tmp/portage/sys-devel/gcc-13.2.1_p20240210/work/gcc-13-20240210/libsanitizer/asan/asan_malloc_linux.cpp:85
#1 0x7f3b8d511aed (/usr/lib64/libfontconfig.so.1+0x23aed)

Direct leak of 11520 byte(s) in 45 object(s) allocated from:
#0 0x7f3b90455b4f in __interceptor_malloc /var/tmp/portage/sys-devel/gcc-13.2.1_p20240210/work/gcc-13-20240210/libsanitizer/asan/asan_malloc_linux.cpp:69
#1 0x7f3b8d511a3b (/usr/lib64/libfontconfig.so.1+0x23a3b)
So I presume it is media-libs/fontconfig that needs to be rebuilt and set.

Thank you.
Top
ONEEYEMAN
Advocate
Advocate
Posts: 3709
Joined: Tue Mar 01, 2005 9:49 pm

  • Quote

Post by ONEEYEMAN » Sun Mar 15, 2026 2:09 am

Hi,
After turning on the ASAN on fontconfig and keeping the source code for it as in the debugging link I got following report:
==16545==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 13824 byte(s) in 18 object(s) allocated from:
#0 0x7f03126049d0 in __interceptor_realloc /var/tmp/portage/sys-devel/gcc-13.2.1_p20240210/work/gcc-13-20240210/libsanitizer/asan/asan_malloc_linux.cpp:85
#1 0x7f030f698e24 in FcPatternObjectInsertElt ../fontconfig-2.14.2/src/fcpat.c:516
#2 0x7f030f69a237 in FcPatternObjectListAdd ../fontconfig-2.14.2/src/fcpat.c:650
#3 0x7f030f690bfd in IA__FcFontRenderPrepare ../fontconfig-2.14.2/src/fcmatch.c:834
#4 0x7f030f691230 in IA__FcFontSetMatch ../fontconfig-2.14.2/src/fcmatch.c:1050
#5 0x7f030f7c3275 (/usr/lib64/libpangoft2-1.0.so.0+0xd275)

Direct leak of 11520 byte(s) in 45 object(s) allocated from:
#0 0x7f0312605b4f in __interceptor_malloc /var/tmp/portage/sys-devel/gcc-13.2.1_p20240210/work/gcc-13-20240210/libsanitizer/asan/asan_malloc_linux.cpp:69
#1 0x7f030f698cb4 in FcPatternObjectInsertElt ../fontconfig-2.14.2/src/fcpat.c:525
#2 0x7f030f69a5d2 in FcPatternObjectAddWithBinding ../fontconfig-2.14.2/src/fcpat.c:711
#3 0x7f030f68be24 in FcListAppend ../fontconfig-2.14.2/src/fclist.c:457
#4 0x7f030f68be24 in IA__FcFontSetList ../fontconfig-2.14.2/src/fclist.c:528
#5 0x7f030f7c2dd5 (/usr/lib64/libpangoft2-1.0.so.0+0xcdd5)
#6 0x60b00009b58f (<unknown module>)

Direct leak of 9216 byte(s) in 18 object(s) allocated from:
#0 0x7f03126049d0 in __interceptor_realloc /var/tmp/portage/sys-devel/gcc-13.2.1_p20240210/work/gcc-13-20240210/libsanitizer/asan/asan_malloc_linux.cpp:85
#1 0x7f030f698e24 in FcPatternObjectInsertElt ../fontconfig-2.14.2/src/fcpat.c:516
#2 0x7f030f69a5d2 in FcPatternObjectAddWithBinding ../fontconfig-2.14.2/src/fcpat.c:711
#3 0x7f030f67393b in IA__FcDefaultSubstitute ../fontconfig-2.14.2/src/fcdefault.c:312
#4 0x7f030f7c4a4d (/usr/lib64/libpangoft2-1.0.so.0+0xea4d)

Direct leak of 728 byte(s) in 7 object(s) allocated from:
#0 0x7f0312605557 in __interceptor_calloc /var/tmp/portage/sys-devel/gcc-13.2.1_p20240210/work/gcc-13-20240210/libsanitizer/asan/asan_malloc_linux.cpp:77
#1 0x7f030fa95865 in g_malloc0 ../glib-2.78.3/glib/gmem.c:163
Are those a legitimate leaks?

And there is also those:
Direct leak of 16 byte(s) in 1 object(s) allocated from:
#0 0x7f0312605b4f in __interceptor_malloc /var/tmp/portage/sys-devel/gcc-13.2.1_p20240210/work/gcc-13-20240210/libsanitizer/asan/asan_malloc_linux.cpp:69
#1 0x7f030fa9581d in g_malloc ../glib-2.78.3/glib/gmem.c:130

Indirect leak of 20992 byte(s) in 656 object(s) allocated from:
#0 0x7f0312605b4f in __interceptor_malloc /var/tmp/portage/sys-devel/gcc-13.2.1_p20240210/work/gcc-13-20240210/libsanitizer/asan/asan_malloc_linux.cpp:69
#1 0x7f030f663f94 in FcConfigValues ../fontconfig-2.14.2/src/fccfg.c:1766
#2 0x7f030f6640fa in FcConfigValues ../fontconfig-2.14.2/src/fccfg.c:1772
#3 0x7f030f6640fa in FcConfigValues ../fontconfig-2.14.2/src/fccfg.c:1772
#4 0x7f030f6640fa in FcConfigValues ../fontconfig-2.14.2/src/fccfg.c:1772
#5 0x7f030f6640fa in FcConfigValues ../fontconfig-2.14.2/src/fccfg.c:1772
#6 0x7f030f6640fa in FcConfigValues ../fontconfig-2.14.2/src/fccfg.c:1772
#7 0x7f030f6640fa in FcConfigValues ../fontconfig-2.14.2/src/fccfg.c:1772
#8 0x7f030f6640fa in FcConfigValues ../fontconfig-2.14.2/src/fccfg.c:1772
#9 0x7f030f6640fa in FcConfigValues ../fontconfig-2.14.2/src/fccfg.c:1772
#10 0x7f030f6640fa in FcConfigValues ../fontconfig-2.14.2/src/fccfg.c:1772
#11 0x7f030f6640fa in FcConfigValues ../fontconfig-2.14.2/src/fccfg.c:1772
#12 0x7f030f6640fa in FcConfigValues ../fontconfig-2.14.2/src/fccfg.c:1772
#13 0x7f030f6640fa in FcConfigValues ../fontconfig-2.14.2/src/fccfg.c:1772
#14 0x7f030f6640fa in FcConfigValues ../fontconfig-2.14.2/src/fccfg.c:1772
#15 0x7f030f6640fa in FcConfigValues ../fontconfig-2.14.2/src/fccfg.c:1772
#16 0x7f030f6640fa in FcConfigValues ../fontconfig-2.14.2/src/fccfg.c:1772
#17 0x7f030f6640fa in FcConfigValues ../fontconfig-2.14.2/src/fccfg.c:1772
#18 0x7f030f6640fa in FcConfigValues ../fontconfig-2.14.2/src/fccfg.c:1772
#19 0x7f030f6640fa in FcConfigValues ../fontconfig-2.14.2/src/fccfg.c:1772
#20 0x7f030f6640fa in FcConfigValues ../fontconfig-2.14.2/src/fccfg.c:1772
#21 0x7f030f6640fa in FcConfigValues ../fontconfig-2.14.2/src/fccfg.c:1772
#22 0x7f030f6640fa in FcConfigValues ../fontconfig-2.14.2/src/fccfg.c:1772
#23 0x7f030f6640fa in FcConfigValues ../fontconfig-2.14.2/src/fccfg.c:1772
#24 0x7f030f6640fa in FcConfigValues ../fontconfig-2.14.2/src/fccfg.c:1772
#25 0x7f030f6640fa in FcConfigValues ../fontconfig-2.14.2/src/fccfg.c:1772
#26 0x7f030f6640fa in FcConfigValues ../fontconfig-2.14.2/src/fccfg.c:1772
#27 0x7f030f6640fa in FcConfigValues ../fontconfig-2.14.2/src/fccfg.c:1772
#28 0x7f030f6640fa in FcConfigValues ../fontconfig-2.14.2/src/fccfg.c:1772
#29 0x7f030f6640fa in FcConfigValues ../fontconfig-2.14.2/src/fccfg.c:1772

Indirect leak of 11040 byte(s) in 345 object(s) allocated from:
#0 0x7f0312605557 in __interceptor_calloc /var/tmp/portage/sys-devel/gcc-13.2.1_p20240210/work/gcc-13-20240210/libsanitizer/asan/asan_malloc_linux.cpp:77
#1 0x7f030f69a4fa in FcValueListCreate ../fontconfig-2.14.2/src/fcpat.c:136
#2 0x7f030f69a4fa in FcPatternObjectAddWithBinding ../fontconfig-2.14.2/src/fcpat.c:687
#3 0x7f030f68be24 in FcListAppend ../fontconfig-2.14.2/src/fclist.c:457
#4 0x7f030f68be24 in IA__FcFontSetList ../fontconfig-2.14.2/src/fclist.c:528
#5 0x7f030f7c2dd5 (/usr/lib64/libpangoft2-1.0.so.0+0xcdd5)
#6 0x60b00009b58f (<unknown module>)
Thank you.
Top
GDH-gentoo
Advocate
Advocate
User avatar
Posts: 2111
Joined: Sat Jul 20, 2019 7:02 pm
Location: South America

  • Quote

Post by GDH-gentoo » Sun Mar 15, 2026 3:54 pm

ONEEYEMAN wrote:Hi,
After turning on the ASAN on fontconfig and keeping the source code for it as in the debugging link I got following report:

[...]

And there is also those:

[...]
Good.
ONEEYEMAN wrote:I tried to talk to GNOME devs, but they suggested to use a suppresor pr get a full stack trace for the leak.
I'd say show those reports to whoever suggested you get a stack trace.
Ionen wrote:As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Top
Post Reply

9 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic