trouble loading python extension

Joshua Richardson <[email protected]>
Newsgroups gmane.comp.fonts.fontforge.devel
Message-ID <[email protected]>
It used to work fine, but I got a newer Mountain Lion Mac and tried to install the python extension of fontforge.  First, I installed fontforge using macports, but then deactivated it, because I had forgotten to install XQuartz first.  Then when I tried using macports version of fontforge @20120731_3+freetype_bytecode+python27, it complained about "SystemError: No initialization function in fontforge library".

So, I tried building fontforge from source, as I've done in the past, but unlike the past, it didn't try to install the extension into /opt/local/lib, though I used the PKG_CONFIG_PATH variable and --with-python-binary switches.  The build put the extension into /usr/local/lib.  Didn't seem like a good idea to mix ports and non-ports anyway, so I built a new python from source and installed into /usr/local.  Then I configured fontforge to point at my new python install:

make distclean &&
PKG_CONFIG_PATH=/Library/Frameworks/Python.framework/Versions/2.7/lib/pkgconfig LDFLAGS="-L/usr/local/lib -L/opt/local/lib -lintl" CFLAGS="-O0 -g" ./configure --with-pythonbinary=/usr/local/bin/python2.7 --enable-debug


Unfortunately, when I try to import fontforge from this new python, I get a segfault:

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000048

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   org.python.python             0x00000001016c66ce PyErr_Occurred + 14
1   org.python.python             0x00000001016ee94f _PyObject_GC_Malloc + 127
2   org.python.python             0x0000000101674e99 PyType_GenericAlloc + 57
3   org.python.python             0x000000010163809c PyDescr_NewWrapper + 44
4   org.python.python             0x000000010167703b PyType_Ready + 347
5   libfontforge.2.dylib          0x0000000101205a1c FinalizePythonTypes + 348 (python.c:18260)
6   libfontforge.2.dylib          0x0000000101205c19 CreatePyModule + 73 (python.c:18304)
7   libfontforge.2.dylib          0x0000000101205e4a CreateAllPyModules + 58 (python.c:18362)
8   libfontforge.2.dylib          0x00000001012078c3 fontforge_python2_init + 51 (python.c:18846)
9   fontforge.so                  0x00000001002f9f43 initfontforge + 19 (fontforgepyhook.c:21)
10  org.python.python             0x00000001000bf17a _PyImport_LoadDynamicModule + 170 (importdl.c:54)
11  org.python.python             0x00000001000bd8f7 import_submodule + 327 (import.c:2700)
12  org.python.python             0x00000001000bdafb load_next + 251 (import.c:2515)
13  org.python.python             0x00000001000be942 PyImport_ImportModuleLevel + 1170 (import.c:2224)
14  org.python.python             0x000000010009c0a4 builtin___import__ + 132 (bltinmodule.c:49)
15  org.python.python             0x000000010000c9b1 PyObject_Call + 97 (abstract.c:2529)
16  org.python.python             0x00000001000a0a44 PyEval_CallObjectWithKeywords + 180 (ceval.c:3891)
17  org.python.python             0x00000001000a79c6 PyEval_EvalFrameEx + 25478 (ceval.c:2333)
18  org.python.python             0x00000001000a8f57 PyEval_EvalCodeEx + 2103 (ceval.c:3253)
19  org.python.python             0x00000001000a8fd6 PyEval_EvalCode + 54 (ceval.c:665)
20  org.python.python             0x00000001000c8932 PyRun_InteractiveOneFlags + 578 (pythonrun.c:1370)
21  org.python.python             0x00000001000c8a8e PyRun_InteractiveLoopFlags + 222 (pythonrun.c:777)
22  org.python.python             0x00000001000c8b37 PyRun_AnyFileExFlags + 119 (pythonrun.c:746)
23  org.python.python             0x00000001000db7fa Py_Main + 2890 (main.c:640)

So looks like it's trying to access an object that's null.  Here is a listing of the object that's getting passed into the depths of Python, where I don't have debugging symbols enabled.  I can't tell if it's ok or not, but hoping someone on the list can tell:


18260if ( PyType_Ready(typ) < 0 ) {
(gdb) p typ 
$1 = (PyTypeObject *) 0x101537d20
(gdb) p *typ
$2 = {
  ob_refcnt = 1, 
  ob_type = 0x0, 
  ob_size = 0, 
  tp_name = 0x10146d86b "fontforge.awcontext", 
  tp_basicsize = 56, 
  tp_itemsize = 0, 
  tp_dealloc = 0x101203950 <PyFF_AWContext_dealloc>, 
  tp_print = 0, 
  tp_getattr = 0, 
  tp_setattr = 0, 
  tp_compare = 0, 
  tp_repr = 0, 
  tp_as_number = 0x0, 
  tp_as_sequence = 0x0, 
  tp_as_mapping = 0x0, 
  tp_hash = 0, 
  tp_call = 0, 
  tp_str = 0, 
  tp_getattro = 0, 
  tp_setattro = 0, 
  tp_as_buffer = 0x0, 
  tp_flags = 131563, 
  tp_doc = 0x10146d880 "FontForge Auto Width/Kern Context object", 
  tp_traverse = 0, 
  tp_clear = 0, 
  tp_richcompare = 0, 
  tp_weaklistoffset = 0, 
  tp_iter = 0, 
  tp_iternext = 0, 
  tp_methods = 0x0, 
  tp_members = 0x0, 
  tp_getset = 0x101537ec0, 
  tp_base = 0x0, 
  tp_dict = 0x0, 
  tp_descr_get = 0, 
  tp_descr_set = 0, 
  tp_dictoffset = 0, 
  tp_init = 0, 
  tp_alloc = 0, 
  tp_new = 0, 
  tp_free = 0, 
  tp_is_gc = 0, 
  tp_bases = 0x0, 
  tp_mro = 0x0, 
  tp_cache = 0x0, 
  tp_subclasses = 0x0, 
  tp_weaklist = 0x0, 
  tp_del = 0, 
  tp_version_tag = 0
}

------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk

_______________________________________________
Fontforge-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fontforge-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.