Created attachment 141016 [details]
A program to reproduce segmentation fault
dwm, dmenu and st (from https://suckless.org/) are known to segfault when trying to render emoji.
I have reduced dmenu segfault down to a simple program that reproduces the bug.
To reproduce, compile the program attached with
gcc bug.c -lX11 -lXft -I /usr/include/freetype2 -lfontconfig
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7821e71 in ?? () from /usr/lib/x86_64-linux-gnu/libfontconfig.so.1
#0 0x00007ffff7821e71 in ?? () from /usr/lib/x86_64-linux-gnu/libfontconfig.so.1
#1 0x00007ffff7821fc8 in ?? () from /usr/lib/x86_64-linux-gnu/libfontconfig.so.1
#2 0x00007ffff7823028 in FcConfigSubstituteWithPat () from /usr/lib/x86_64-linux-gnu/libfontconfig.so.1
#3 0x00007ffff78329dd in FcFontRenderPrepare () from /usr/lib/x86_64-linux-gnu/libfontconfig.so.1
#4 0x00007ffff7832fc4 in FcFontMatch () from /usr/lib/x86_64-linux-gnu/libfontconfig.so.1
#5 0x000055555555531c in main ()
$ cat /etc/debian_version
$ apt show fontconfig
Also, it is a null pointer dereference:
(gdb) x/i $rip
=> 0x7ffff7821e71: movzwl (%rcx),%ebx
(gdb) p $rcx
$1 = 0
Fontconfig has quite a lot of null pointer dereference fixes since release, so maybe you just need to package a new release:
try git first. I can't reproduce this issue with even pure 2.13.0. so I'm not sure if this is fixed by those fixes.
I also can't reproduce it on Ubuntu, with 2.12.6 fontconfig. Will try to install debug symbols and see what happened then.
-- GitLab Migration Automatic Message --
This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.
You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/71.