[Pyobjc-dev] Multiple PyObjC plugins
Brought to you by:
ronaldoussoren
|
From: Duncan W. <du...@mc...> - 2007-11-28 06:16:53
|
Hi, I have an objc leopard app that has a plain objc loadable bundle =20 plugin structure. I'm finding that doing plugins with pyobjc is great. I don't have an extensive python experience, and python embedding is a =20= complete mystery to me, so I borrowed Jon Wight's Python Action =20 startup code, with Ian Baird's tweaks: = http://paste.lisp.org/display/51497 The problem I'm seeing is that the first plugin I load will work just =20= fine, but as soon as I load a second plugin (from a second bundle, =20 with the same startup code), I'll get bad crashes, specifically Xcode =20= will fail with an error like this: Program received signal: =93EXC_BAD_ACCESS=94. Xcode: Introspection dylib not loaded because thread 1 has function: =20 = __dyld__ZN16ImageLoaderMachO18doModInitFunctionsERKN11ImageLoader11LinkCon= textE=20 on stack When running from the terminal I get a Bus Error and Crash Reporter =20 showing this backtrace: Thread 0 Crashed: 0 org.python.python 0x0c69d1bb PyImport_AddModule + = 29 1 org.python.python 0x0c6a681a = PyRun_SimpleFileExFlags =20 + 29 2 org.python.python 0x0c6a6ba4 PyRun_SimpleFile + 40 The PyRun_SimpleFile call is from the python startup code above. This is on stock 10.5.1. I also tried modifying the startup code to guard the initialization =20 like this: if(! Py_IsInitialized()) { Py_SetProgramName("/usr/bin/python"); Py_Initialize(); } but the crash didn't change. Should I be using more lower level embedding glue? Should I be moving =20= interpreter startup to the main app? Thanks for any reply, Duncan |