Re: [Pyobjc-dev] Problem with pyObjC and Swift
Brought to you by:
ronaldoussoren
From: John B. <nho...@gm...> - 2017-03-30 11:11:59
|
Plugins written in Swift don't strike me as a good idea until we have ABI stability. What if two plugins are loaded with different swift runtimes? You can work-around that if your architecture loads plugins in a separate process and communicates via XPC (or similar). I work on a plugin for FCPX. We considered Swift, but it's a no-go until we have ABI stability for the above reason. Cheers, John -- John Buckley LBIPP M.Eng. Ph.D. +44 7740 099518 johnbuckleyphotography.uk On Thu, 30 Mar 2017 at 10:27 Georg Seifert <geo...@gm...> wrote: > Hi > > I have an app written in ObjectiveC. It allows loading plugins from third > parties. Most of those are written in python, some in ObjectiveC. Now > someone tries to write on in Swift. That plugin works as expected but all > the python plugin don't work any more and crash the app. At least when the > plugin is build with Xcode 8 and Swift 3. Compiling it on Xcode 7 (macOS > 10.10) works fine. Running the Xcode 8 version on 10.10 crashes, too. > > The app links agains the system python framework. > > Anyone has knows anything about this? > > Thanks > Georg Seifert > > p.s. I get backtraces like this: > > Calling a method on an python object inheriting from NSObject > > #0 0x0000000100a56ed7 in ___lldb_unnamed_function679$$Python () > #1 0x0000000100a584f1 in PyDict_SetItemString () > #2 0x00000001098319a5 in PyObjCClass_CheckMethodList () > #3 0x0000000109832543 in ___lldb_unnamed_function453$$_objc.so () > #4 0x0000000100aa3238 in ___lldb_unnamed_function1431$$Python () > #5 0x0000000100aa9d8c in PyEval_EvalFrameEx () > #6 0x0000000100aa6352 in PyEval_EvalCodeEx () > #7 0x0000000100a4a5de in ___lldb_unnamed_function510$$Python () > #8 0x0000000100a2c50a in PyObject_Call () > #9 0x0000000109831c04 in PyObjCClass_CheckMethodList () > #10 0x00000001098361ed in PyObjCObject_New () > #11 0x00000001098368fa in ___lldb_unnamed_function487$$_objc.so () > #12 0x000000010983955d in pythonify_c_value () > #13 0x000000010982654a in ___lldb_unnamed_function373$$_objc.so () > #14 0x00007fff87356a07 in ffi_closure_unix64_inner () > #15 0x00007fff873560c6 in ffi_closure_unix64 () > > or: > > calling [NSBundle principalClass] on the plugin containing the python class > > #0 0x0000000100a99bd3 in ___lldb_unnamed_symbol679$$Python () > #1 0x0000000100a9b1cd in PyDict_SetItemString () > #2 0x000000010e6a21cb in PyObjCClass_CheckMethodList () > #3 0x000000010e6a51a4 in PyObjCClass_FindSelector () > #4 0x000000010e6b0aef in PyObjCSelector_FromFunction () > #5 0x000000010e6a3005 in ___lldb_unnamed_symbol454$$_objc.so () > #6 0x0000000100a9fb14 in PyObject_SetAttr () > #7 0x0000000100ae97a6 in PyEval_EvalFrameEx () > #8 0x0000000100ae79be in PyEval_EvalCodeEx () > #9 0x0000000100ae7367 in PyEval_EvalCode () > #10 0x0000000100afc6bd in PyImport_ExecCodeModuleEx () > #11 0x0000000100aff3c7 in ___lldb_unnamed_symbol1546$$Python () > #12 0x0000000100afee2c in ___lldb_unnamed_symbol1545$$Python () > #13 0x0000000100afea00 in ___lldb_unnamed_symbol1543$$Python () > #14 0x0000000100afdc10 in PyImport_ImportModuleLevel () > #15 0x0000000100ae3006 in ___lldb_unnamed_symbol1412$$Python () > #16 0x0000000100a6f6fb in PyObject_Call () > #17 0x0000000100aeddbb in PyEval_CallObjectWithKeywords () > #18 0x0000000100ae9c0f in PyEval_EvalFrameEx () > #19 0x0000000100ae79be in PyEval_EvalCodeEx () > #20 0x0000000100ae7367 in PyEval_EvalCode () > #21 0x0000000100afc6bd in PyImport_ExecCodeModuleEx () > #22 0x0000000100aff3c7 in ___lldb_unnamed_symbol1546$$Python () > #23 0x0000000100aff64f in ___lldb_unnamed_symbol1548$$Python () > #24 0x0000000100afee2c in ___lldb_unnamed_symbol1545$$Python () > #25 0x0000000100afea41 in ___lldb_unnamed_symbol1543$$Python () > #26 0x0000000100afdbd8 in PyImport_ImportModuleLevel () > #27 0x0000000100ae3006 in ___lldb_unnamed_symbol1412$$Python () > #28 0x0000000100a6f6fb in PyObject_Call () > #29 0x0000000100aeddbb in PyEval_CallObjectWithKeywords () > #30 0x0000000100ae9c0f in PyEval_EvalFrameEx () > #31 0x0000000100ae79be in PyEval_EvalCodeEx () > #32 0x0000000100ae7367 in PyEval_EvalCode () > #33 0x0000000100afc6bd in PyImport_ExecCodeModuleEx () > #34 0x0000000100aff4e1 in ___lldb_unnamed_symbol1547$$Python () > #35 0x0000000100aff64f in ___lldb_unnamed_symbol1548$$Python () > #36 0x0000000100afee2c in ___lldb_unnamed_symbol1545$$Python () > #37 0x0000000100afea00 in ___lldb_unnamed_symbol1543$$Python () > #38 0x0000000100afdbd8 in PyImport_ImportModuleLevel () > #39 0x0000000100ae3006 in ___lldb_unnamed_symbol1412$$Python () > #40 0x0000000100a6f6fb in PyObject_Call () > #41 0x0000000100aeddbb in PyEval_CallObjectWithKeywords () > #42 0x0000000100ae9c0f in PyEval_EvalFrameEx () > #43 0x0000000100ae79be in PyEval_EvalCodeEx () > #44 0x0000000100ae7367 in PyEval_EvalCode () > #45 0x0000000100b075dd in ___lldb_unnamed_symbol1599$$Python () > #46 0x0000000100b07680 in PyRun_FileExFlags () > #47 0x0000000100ae3cbd in ___lldb_unnamed_symbol1427$$Python () > #48 0x0000000100aeb4d4 in PyEval_EvalFrameEx () > #49 0x0000000100ae79be in PyEval_EvalCodeEx () > #50 0x0000000100aee3e2 in ___lldb_unnamed_symbol1476$$Python () > #51 0x0000000100aeae4e in PyEval_EvalFrameEx () > #52 0x0000000100ae79be in PyEval_EvalCodeEx () > #53 0x0000000100ae7367 in PyEval_EvalCode () > #54 0x0000000100b075dd in ___lldb_unnamed_symbol1599$$Python () > #55 0x0000000100b07680 in PyRun_FileExFlags () > #56 0x0000000100b0890a in PyRun_File () > #57 0x000000010e5bea86 in ___lldb_unnamed_symbol1$$plugin () > #58 0x00000001002cfa1b in > ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) () > #59 0x00000001002cfc1e in > ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) () > #60 0x00000001002cb4aa in > ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, > unsigned int, char const*, ImageLoader::InitializerTimingList&, > ImageLoader::UninitedUpwards&) () > #61 0x00000001002ca524 in > ImageLoader::processInitializers(ImageLoader::LinkContext const&, unsigned > int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) () > #62 0x00000001002ca5b9 in > ImageLoader::runInitializers(ImageLoader::LinkContext const&, > ImageLoader::InitializerTimingList&) () > #63 0x00000001002bf7cd in dyld::runInitializers(ImageLoader*) () > #64 0x00000001002c73ec in dlopen () > #65 0x00007fffaa2ac832 in dlopen () > #66 0x00007fff94b7a249 in _CFBundleDlfcnLoadBundle () > #67 0x00007fff94b7a0ca in _CFBundleLoadExecutableAndReturnError () > #68 0x00007fff9656283f in _NSBundleLoadCode () > #69 0x00007fff96562425 in -[NSBundle loadAndReturnError:] () > #70 0x00007fff965aca16 in -[NSBundle principalClass] () > > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > |