Fontforge: FontForge segfaults when instantiating a new font if compiled with the UI disabled

Created on 2 Sep 2017  路  6Comments  路  Source: fontforge/fontforge

Hello,

I got a new macbook and tried to run fontcustom, but I always get the error errorfontforgecompilation failed. Try again with --debug for more details.. After some research it seems that it is still working with the version 20170104. How can I downgrade to this version? If I do brew search fontforge I only see the latest version.

currently I got:
fontcustom 1.3.8
fontforge 20170806

Thanks!

I-bug I-crash

Most helpful comment

@felixhagspiel / @JakeBeresford a fix was merged into Homebrew so if you update your installed version of fontforge (20170731 pkgrel 2), I think it should work now. It should also work with the official releases since they are compiled with ui support and wouldn't be affected likewise.

All 6 comments

Same issue here, I dont see this version of fontforge in the releases. Could you please point me towards the changes for this release so that I can patch fontcustom if necessary.

This is a segfault (see also: https://github.com/FontCustom/fontcustom/issues/355). Probably homebrew or python related.

I can see this happen on OS X, but not on Windows. As for installing an older version, I have no idea. Perhaps raise a ticket on Homebrew or something.

I'll try to debug this... But just looking at the script, there are so many levels of wrong with it I don't know...

(lldb) r
Process 39117 launched: '/usr/local/bin/fontforge' (x86_64)
Copyright (c) 2000-2014 by George Williams. See AUTHORS for Contributors.
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
 with many parts BSD <http://fontforge.org/license.html>. Please read LICENSE.
 Based on sources from 22:29 UTC  8-Sep-2017-D.
 Based on source from git with hash: 7a64371d449911e4af23d9bbb91150b80d31d4bb
Process 39117 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x1604478)
    frame #0: 0x0000000100383fc2 libfontforge.2.dylib`SplineFontNew at splineutil2.c:3890
   3887
   3888 SplineFont *SplineFontNew(void) {
   3889     SplineFont *sf;
-> 3890     int enclen = default_encoding->char_cnt;
   3891
   3892     sf = SplineFontBlank(enclen);
   3893     sf->onlybitmaps = true;
(lldb) p default_encoding
(Encoding *) $0 = 0x0000000001604470
(lldb) p default_encoding->char_cnt
error: Couldn't apply expression side effects : Couldn't dematerialize a result variable: couldn't read its memory
(lldb) p default_encoding
(Encoding *) $2 = 0x0000000001604470
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x1604478)
  * frame #0: 0x0000000100383fc2 libfontforge.2.dylib`SplineFontNew at splineutil2.c:3890
    frame #1: 0x0000000100258cb0 libfontforge.2.dylib`PyFF_Font_new(type=0x0000000100523df0, UNUSED_args=0x0000000102c40050, UNUSED_kwds=0x000000
0000000000) at python.c:10758
    frame #2: 0x00000001006709ae Python`type_call + 46
    frame #3: 0x0000000100615203 Python`PyObject_Call + 99
    frame #4: 0x00000001006c019d Python`PyEval_EvalFrameEx + 29965
    frame #5: 0x00000001006b8947 Python`PyEval_EvalCodeEx + 2119
    frame #6: 0x00000001006b80f6 Python`PyEval_EvalCode + 54
    frame #7: 0x00000001006e7824 Python`PyRun_FileExFlags + 164
    frame #8: 0x00000001006e735e Python`PyRun_SimpleFileExFlags + 702
    frame #9: 0x00000001006fdb1d Python`Py_Main + 2925
    frame #10: 0x000000010023be74 libfontforge.2.dylib`PyFF_Main(argc=4, argv=0x00007fff5fbffc98, start=2) at python.c:18656
    frame #11: 0x0000000100274ad1 libfontforge.2.dylib`_CheckIsScript(argc=4, argv=0x00007fff5fbffc98) at scripting.c:10847
    frame #12: 0x000000010027468b libfontforge.2.dylib`CheckIsScript(argc=4, argv=0x00007fff5fbffc98) at scripting.c:10886
    frame #13: 0x000000010008f9f1 libfontforgeexe.2.dylib`fontforge_main(argc=4, argv=0x00007fff5fbffc98) at startnoui.c:113
    frame #14: 0x0000000100000f82 fontforge`main(argc=4, argv=0x00007fff5fbffc98) at main.c:39
    frame #15: 0x00007fff9964a255 libdyld.dylib`start + 1
    frame #16: 0x00007fff9964a255 libdyld.dylib`start + 1

Minimal test case (can be reproduced on linux):

./configure --without-x --disable-python-{scripting,extension}
make -j4 && make install

fontforge -lang=ff -c "New()"

 CC       libfontforgeexe_la-startnoui.lo
startnoui.c: In function 芒聙聵fontforge_main芒聙聶:
startnoui.c:110:22: warning: implicit declaration of function 芒聙聵FindOrMakeEncoding芒聙聶 [-Wimplicit-function-declaration]
     default_encoding=FindOrMakeEncoding("ISO8859-1");
                      ^~~~~~~~~~~~~~~~~~
startnoui.c:110:21: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     default_encoding=FindOrMakeEncoding("ISO8859-1");

Well then...

@felixhagspiel / @JakeBeresford a fix was merged into Homebrew so if you update your installed version of fontforge (20170731 pkgrel 2), I think it should work now. It should also work with the official releases since they are compiled with ui support and wouldn't be affected likewise.

Works! Thank you so much 馃憤

Was this page helpful?
0 / 5 - 0 ratings