fc-cache, fc-cat, etc. segfaults due to FcObjectLookupOtherTypeById
Commit 452be812 I'm attempting to build font-config on iOS, which I know is not a target device, but I've been unable to debug this myself.
Here's what I know from system logs (full log attached):
Thread 0 Crashed:
0 libfontconfig.1.dylib 0x100b3b84c 0x100b1c000 + 0x1f84c // /Library/x/fontconfig/src/fcobjs.c:160
1 libfontconfig.1.dylib 0x100b3b840 0x100b1c000 + 0x1f840 // /Library/x/fontconfig/src/fcobjs.c:159
2 libfontconfig.1.dylib 0x100b3a1ec 0x100b1c000 + 0x1e1ec // /Library/x/fontconfig/src/fcname.c:131
3 libfontconfig.1.dylib 0x100b457d8 0x100b1c000 + 0x297d8 // /Library/x/fontconfig/src/fcxml.c:820
4 libexpat.1.dylib 0x101006b34 0x100ff8000 + 0xeb34 // /Library/x/expat-2.2.9/lib/xmlparse.c:2848
5 libexpat.1.dylib 0x101004134 0x100ff8000 + 0xc134 // /Library/x/expat-2.2.9/lib/xmlparse.c:2445
6 libexpat.1.dylib 0x101001b38 0x100ff8000 + 0x9b38 // /Library/x/expat-2.2.9/lib/xmlparse.c:3921
7 libexpat.1.dylib 0x1010014e0 0x100ff8000 + 0x94e0 // /Library/x/expat-2.2.9/lib/xmlparse.c:1893
This occurs whether I use libxml or expat.
The relevant lines of code: https://gitlab.freedesktop.org/fontconfig/fontconfig/blob/master/src/fcobjs.c#L160
https://gitlab.freedesktop.org/fontconfig/fontconfig/blob/master/src/fcname.c#L131
https://gitlab.freedesktop.org/fontconfig/fontconfig/blob/master/src/fcxml.c#L820
This same error occurs in many fc-* tools.
Any help would be appreciated!