Thanks for the feedback. Threads don’t seem to be the issue, though I’ve double checked by both making sure the plugins get loaded inside the update function and by trying vinjn’s suggested dispatchAsync to schedule the imports. Both result in the same crashes.
These are my crash stacktraces (getPluginInterface is the function exported by the plugin);
When calling Context::makeCurrent in the plugin
* thread #1: tid = 0x9afe2, 0x00007fffdea1add6 libsystem_kernel.dylib`__pthread_kill + 10, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
frame #0: 0x00007fffdea1add6 libsystem_kernel.dylib`__pthread_kill + 10
frame #1: 0x00000001005eba1c libsystem_pthread.dylib`pthread_kill + 90
frame #2: 0x00007fffde980420 libsystem_c.dylib`abort + 129
frame #3: 0x00007fffde947893 libsystem_c.dylib`__assert_rtn + 320
* frame #4: 0x000000010dd4967d libdrawablePlugin-01.dylib`cinder::gl::env() + 61 at Environment.cpp:81
frame #5: 0x000000010da92ae1 libdrawablePlugin-01.dylib`cinder::gl::Context::makeCurrent(this=0x00000001010060d0, force=false) const + 129 at Context.cpp:191
frame #6: 0x000000010d99e7c0 libdrawablePlugin-01.dylib`getPluginInterface + 64
frame #7: 0x00000001000033bf drawableApp`CinderPlugin::PluginManager<Drawable>::loadFile(this=0x00000001010034f0, path=<unavailable>) + 1967 at PluginManager.h:53
frame #8: 0x0000000100001c5f drawableApp`drawableApp::update(this=0x00000001010032c0) + 271 at drawableApp.cpp:38
frame #9: 0x0000000100030226 drawableApp`cinder::app::AppBase::privateUpdate__(this=0x00000001010032c0) + 358 at AppBase.cpp:232
frame #10: 0x0000000100031624 drawableApp`-[AppImplMac timerFired:](self=0x0000610000062c00, _cmd="timerFired:", t=0x0000618000163b40) + 100 at AppImplMac.mm:152
frame #11: 0x00007fffcada1f7f Foundation`__NSFireTimer + 83
frame #12: 0x00007fffc92f8294 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
frame #13: 0x00007fffc92f7f23 CoreFoundation`__CFRunLoopDoTimer + 1075
frame #14: 0x00007fffc92f7a7a CoreFoundation`__CFRunLoopDoTimers + 298
frame #15: 0x00007fffc92ef5d1 CoreFoundation`__CFRunLoopRun + 2081
frame #16: 0x00007fffc92eeb54 CoreFoundation`CFRunLoopRunSpecific + 420
frame #17: 0x00007fffc8879acc HIToolbox`RunCurrentEventLoopInMode + 240
frame #18: 0x00007fffc8879901 HIToolbox`ReceiveNextEventCommon + 432
frame #19: 0x00007fffc8879736 HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 71
frame #20: 0x00007fffc6e1fae4 AppKit`_DPSNextEvent + 1120
frame #21: 0x00007fffc759a21f AppKit`-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 2789
frame #22: 0x00007fffc6e14465 AppKit`-[NSApplication run] + 926
frame #23: 0x00000001000c9599 drawableApp`cinder::app::AppMac::launch(this=0x00000001010032c0) + 57 at AppMac.cpp:67
frame #24: 0x000000010002fc99 drawableApp`cinder::app::AppBase::executeLaunch(this=0x00000001010032c0) + 73 at AppBase.cpp:190
frame #25: 0x0000000100004114 drawableApp`void cinder::app::AppMac::main<drawableApp>(defaultRenderer=ptr = 0x610000120000 strong=3 weak=1, title="drawableApp", argc=3, argv=0x00007fff5fbff850, settingsFn=0x00007fff5fbff7f0)> const&) + 292 at AppMac.h:94
frame #26: 0x0000000100002462 drawableApp`main(argc=3, argv=0x00007fff5fbff850) + 194 at drawableApp.cpp:72
frame #27: 0x00007fffde8ec255 libdyld.dylib`start + 1
When calling Renderer::makeCurrentContext
* thread #1: tid = 0x9b5c8, 0x00007fffdd501a59 libc++abi.dylib`__dynamic_cast + 38, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
frame #0: 0x00007fffdd501a59 libc++abi.dylib`__dynamic_cast + 38
* frame #1: 0x00000001000a3aeb drawableApp`cinder::gl::Environment::makeContextCurrent(cinder::gl::Context const*) [inlined] std::__1::enable_if<(!(is_array<cinder::gl::PlatformDataMac>::value)) && (!(is_array<cinder::gl::Context::PlatformData>::value)), std::__1::shared_ptr<cinder::gl::PlatformDataMac> >::type std::__1::dynamic_pointer_cast<cinder::gl::PlatformDataMac, cinder::gl::Context::PlatformData>(__r=0x00007fff5fbfc6d0) + 82 at memory:5006
frame #2: 0x00000001000a3a99 drawableApp`cinder::gl::Environment::makeContextCurrent(this=0x0000610000000880, context=0x0000000101016e10) + 57 at Environment.cpp:215
frame #3: 0x0000000100060c2d drawableApp`cinder::gl::Context::makeCurrent(this=0x0000000101016e10, force=false) const + 141 at Context.cpp:191
frame #4: 0x00000001000d76bd drawableApp`-[RendererImplGlMac makeCurrentContext:](self=0x00006080000428b0, _cmd="makeCurrentContext:", force=false) + 61 at RendererImplGlMac.mm:131
frame #5: 0x00000001000aeef3 drawableApp`cinder::app::RendererGl::startDraw(this=0x0000600000120dc0) + 99 at RendererGl.cpp:87
frame #6: 0x0000000100086dcb drawableApp`-[CinderViewMac drawRect:](self=0x00006080001e0000, _cmd="drawRect:", rect=(origin = (x = 0, y = 0), size = (width = 640, height = 480))) + 187 at CinderViewMac.mm:184
frame #7: 0x0000000100086cb3 drawableApp`-[CinderViewMac draw](self=0x00006080001e0000, _cmd="draw") + 179 at CinderViewMac.mm:169
frame #8: 0x0000000100031956 drawableApp`-[AppImplMac timerFired:](self=0x00006000000661c0, _cmd="timerFired:", t=0x0000618000161e00) + 918 at AppImplMac.mm:165
frame #9: 0x00007fffcada1f7f Foundation`__NSFireTimer + 83
frame #10: 0x00007fffc92f8294 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
frame #11: 0x00007fffc92f7f23 CoreFoundation`__CFRunLoopDoTimer + 1075
frame #12: 0x00007fffc92f7a7a CoreFoundation`__CFRunLoopDoTimers + 298
frame #13: 0x00007fffc92ef5d1 CoreFoundation`__CFRunLoopRun + 2081
frame #14: 0x00007fffc92eeb54 CoreFoundation`CFRunLoopRunSpecific + 420
frame #15: 0x00007fffc8879acc HIToolbox`RunCurrentEventLoopInMode + 240
frame #16: 0x00007fffc8879901 HIToolbox`ReceiveNextEventCommon + 432
frame #17: 0x00007fffc8879736 HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 71
frame #18: 0x00007fffc6e1fae4 AppKit`_DPSNextEvent + 1120
frame #19: 0x00007fffc759a21f AppKit`-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 2789
frame #20: 0x00007fffc6e14465 AppKit`-[NSApplication run] + 926
frame #21: 0x00000001000c9599 drawableApp`cinder::app::AppMac::launch(this=0x0000000101600660) + 57 at AppMac.cpp:67
frame #22: 0x000000010002fc99 drawableApp`cinder::app::AppBase::executeLaunch(this=0x0000000101600660) + 73 at AppBase.cpp:190
frame #23: 0x0000000100004114 drawableApp`void cinder::app::AppMac::main<drawableApp>(defaultRenderer=ptr = 0x600000120000 strong=3 weak=1, title="drawableApp", argc=3, argv=0x00007fff5fbff850, settingsFn=0x00007fff5fbff7f0)> const&) + 292 at AppMac.h:94
frame #24: 0x0000000100002462 drawableApp`main(argc=3, argv=0x00007fff5fbff850) + 194 at drawableApp.cpp:72
frame #25: 0x00007fffde8ec255 libdyld.dylib`start + 1
When not trying to adopt context and plugin just starts drawing
* thread #1: tid = 0x9b97c, 0x00007fffdd501a59 libc++abi.dylib`__dynamic_cast + 38, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
frame #0: 0x00007fffdd501a59 libc++abi.dylib`__dynamic_cast + 38
* frame #1: 0x00000001000a3aeb drawableApp`cinder::gl::Environment::makeContextCurrent(cinder::gl::Context const*) [inlined] std::__1::enable_if<(!(is_array<cinder::gl::PlatformDataMac>::value)) && (!(is_array<cinder::gl::Context::PlatformData>::value)), std::__1::shared_ptr<cinder::gl::PlatformDataMac> >::type std::__1::dynamic_pointer_cast<cinder::gl::PlatformDataMac, cinder::gl::Context::PlatformData>(__r=0x00007fff5fbfc6d0) + 82 at memory:5006
frame #2: 0x00000001000a3a99 drawableApp`cinder::gl::Environment::makeContextCurrent(this=0x00006000000005e0, context=0x000000010110b370) + 57 at Environment.cpp:215
frame #3: 0x0000000100060c2d drawableApp`cinder::gl::Context::makeCurrent(this=0x000000010110b370, force=false) const + 141 at Context.cpp:191
frame #4: 0x00000001000d76bd drawableApp`-[RendererImplGlMac makeCurrentContext:](self=0x0000608000044ef0, _cmd="makeCurrentContext:", force=false) + 61 at RendererImplGlMac.mm:131
frame #5: 0x00000001000aeef3 drawableApp`cinder::app::RendererGl::startDraw(this=0x0000608000120320) + 99 at RendererGl.cpp:87
frame #6: 0x0000000100086dcb drawableApp`-[CinderViewMac drawRect:](self=0x00006080001e0100, _cmd="drawRect:", rect=(origin = (x = 0, y = 0), size = (width = 640, height = 480))) + 187 at CinderViewMac.mm:184
frame #7: 0x0000000100086cb3 drawableApp`-[CinderViewMac draw](self=0x00006080001e0100, _cmd="draw") + 179 at CinderViewMac.mm:169
frame #8: 0x0000000100031956 drawableApp`-[AppImplMac timerFired:](self=0x0000608000062bc0, _cmd="timerFired:", t=0x0000608000162d00) + 918 at AppImplMac.mm:165
frame #9: 0x00007fffcada1f7f Foundation`__NSFireTimer + 83
frame #10: 0x00007fffc92f8294 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
frame #11: 0x00007fffc92f7f23 CoreFoundation`__CFRunLoopDoTimer + 1075
frame #12: 0x00007fffc92f7a7a CoreFoundation`__CFRunLoopDoTimers + 298
frame #13: 0x00007fffc92ef5d1 CoreFoundation`__CFRunLoopRun + 2081
frame #14: 0x00007fffc92eeb54 CoreFoundation`CFRunLoopRunSpecific + 420
frame #15: 0x00007fffc8879acc HIToolbox`RunCurrentEventLoopInMode + 240
frame #16: 0x00007fffc8879901 HIToolbox`ReceiveNextEventCommon + 432
frame #17: 0x00007fffc8879736 HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 71
frame #18: 0x00007fffc6e1fae4 AppKit`_DPSNextEvent + 1120
frame #19: 0x00007fffc759a21f AppKit`-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 2789
frame #20: 0x00007fffc6e14465 AppKit`-[NSApplication run] + 926
frame #21: 0x00000001000c9599 drawableApp`cinder::app::AppMac::launch(this=0x0000000100701870) + 57 at AppMac.cpp:67
frame #22: 0x000000010002fc99 drawableApp`cinder::app::AppBase::executeLaunch(this=0x0000000100701870) + 73 at AppBase.cpp:190
frame #23: 0x0000000100004114 drawableApp`void cinder::app::AppMac::main<drawableApp>(defaultRenderer=ptr = 0x618000120000 strong=3 weak=1, title="drawableApp", argc=3, argv=0x00007fff5fbff850, settingsFn=0x00007fff5fbff7f0)> const&) + 292 at AppMac.h:94
frame #24: 0x0000000100002462 drawableApp`main(argc=3, argv=0x00007fff5fbff850) + 194 at drawableApp.cpp:72
frame #25: 0x00007fffde8ec255 libdyld.dylib`start + 1