Hey there! We've been getting occasional reports of a crash-on-quit, where our main thread is waiting on Syphon's finalizer()
function when a background thread crashes (usually a CVDisplayLink thread crashing deep in shader compilation code).
Here's an extract from a report that seems pretty representative of the majority of these cases:
OS Version: Mac OS X 10.13.4 (17E199)
Crashed Thread: 29 CVDisplayLink
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00007fa1b8985400
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Bus error: 10
Termination Reason: Namespace SIGNAL, Code 0xa
Terminating Process: exc handler [0]
VM Regions Near 0x7fa1b8985400:
MALLOC_SMALL 00007fa1b8970000-00007fa1b8976000 [ 24K] rw-/rwx SM=PRV
--> MALLOC_SMALL 00007fa1b8976000-00007fa1b8999000 [ 140K] rw-/rwx SM=COW
MALLOC_SMALL 00007fa1b8999000-00007fa1b89aa000 [ 68K] rw-/rwx SM=ZER
Thread 0:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff54d6b25e semaphore_timedwait_trap + 10
1 libdispatch.dylib 0x00007fff54bfa99f _dispatch_sema4_timedwait + 72
2 libdispatch.dylib 0x00007fff54bf299e _dispatch_semaphore_wait_slow + 58
3 info.v002.Syphon 0x0000000105a1b174 finalizer + 147
4 dyld 0x000000010b89cdfd ImageLoaderMachO::doTermination(ImageLoader::LinkContext const&) + 259
5 dyld 0x000000010b888613 dyld::runAllStaticTerminators(void*) + 64
6 libsystem_c.dylib 0x00007fff54cd0eed __cxa_finalize_ranges + 351
7 libsystem_c.dylib 0x00007fff54cd11fe exit + 55
8 com.apple.AppKit 0x00007fff2a08af2a -[NSApplication terminate:] + 1930
9 com.apple.AppKit 0x00007fff2a641a43 -[NSApplication(NSResponder) sendAction:to:from:] + 312
10 com.apple.AppKit 0x00007fff2a0d6213 -[NSMenuItem _corePerformAction] + 323
11 com.apple.AppKit 0x00007fff2a0d5f9b -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] + 114
12 com.apple.AppKit 0x00007fff2a0d4dff -[NSMenu performKeyEquivalent:] + 363
13 com.apple.AppKit 0x00007fff2a6406a9 routeKeyEquivalent + 884
14 com.apple.AppKit 0x00007fff2a63dce0 -[NSApplication(NSEvent) sendEvent:] + 1096
15 com.apple.AppKit 0x00007fff29e9e8b5 -[NSApplication run] + 812
16 com.figure53.QLab.4 0x0000000104f4fe19 -[QLab run] + 71
17 com.apple.AppKit 0x00007fff29e6da72 NSApplicationMain + 804
18 libdyld.dylib 0x00007fff54c24015 start + 1
...
Thread 29 Crashed:: CVDisplayLink
0 ??? 0x00007fa1b8985400 0 + 140332563452928
1 ATIRadeonX4000SCLib.dylib 0x00007fff25a50f8d boost::detail::sp_if_not_array<InputShaderControl>::type boost::make_shared<InputShaderControl, CompilerBase*&, _SC_SRCSHADER const*&>(CompilerBase*&&&, _SC_SRCSHADER const*&&&) + 77
2 ATIRadeonX4000SCLib.dylib 0x00007fff25a50d30 ShaderControl::ShaderControl(CompilerBase*, _SC_SRCSHADER const*&, _SC_HWSHADER*&) + 192
3 ATIRadeonX4000SCLib.dylib 0x00007fff25a5e23a SCCompileShader + 74
4 com.apple.AMDRadeonX4000GLDriver 0x0000000108ee908c glrATI_SI_SCCompileVertexShader + 982
5 com.apple.AMDRadeonX4000GLDriver 0x0000000108f3410b glrAMD_Hwl_CompileVertexShader + 247
6 com.apple.AMDRadeonX4000GLDriver 0x0000000108ed7225 glrUpdateCtxSysVertexProgram + 1118
7 com.apple.AMDRadeonX4000GLDriver 0x0000000108eee177 gpusLoadCurrentPipelinePrograms + 4219
8 com.apple.AMDRadeonX4000GLDriver 0x0000000108ed5092 gldUpdateDispatch + 1989
9 GLEngine 0x00007fff36ede9e0 gleDoDrawDispatchCore + 601
10 GLEngine 0x00007fff36ea37ee glDrawRangeElements_IMM_Exec + 288
11 com.apple.QuartzCore 0x00007fff37c75f25 CA::OGL::GLContext::draw_elements(CA::OGL::PrimitiveMode, unsigned int, unsigned short const*, CA::OGL::Vertex const*, unsigned int, unsigned int, CA::OGL::ClipPlane const*) + 215
12 com.apple.QuartzCore 0x00007fff37c75e45 CA::OGL::Context::array_flush() + 93
13 com.apple.QuartzCore 0x00007fff37c850bf CA::OGL::Context::ClippedArray::next_rect(CA::Bounds&) + 295
14 com.apple.QuartzCore 0x00007fff37db258f CA::OGL::emit_one_part_rect(CA::OGL::Context&, CA::OGL::RectState const&, float const*, float const*, unsigned int) + 940
15 com.apple.QuartzCore 0x00007fff37c83dc4 CA::OGL::fill_rect(CA::OGL::Context&, CA::OGL::RectState const&) + 176
16 com.apple.QuartzCore 0x00007fff37db328d CA::OGL::fill_round_rect(CA::OGL::Context&, CA::OGL::RectState const&, double, unsigned int, bool) + 175
17 com.apple.QuartzCore 0x00007fff37cfb3f0 CA::OGL::render_solid_background(CA::OGL::Renderer&, CA::OGL::Layer const*, CA::OGL::BaseColor, CA::Render::Pattern*) + 1735
18 com.apple.QuartzCore 0x00007fff37c83775 CA::OGL::render_background(CA::OGL::Renderer&, CA::OGL::Layer const*) + 373
19 com.apple.QuartzCore 0x00007fff37c829d2 CA::OGL::render_contents_background(CA::OGL::Renderer&, CA::OGL::Layer const*) + 535
20 com.apple.QuartzCore 0x00007fff37c82399 CA::OGL::LayerNode::apply(float, CA::OGL::Surface**, float*) + 59
21 com.apple.QuartzCore 0x00007fff37c8079a CA::OGL::ImagingNode::render(CA::OGL::ImagingNode::RenderClosure*, unsigned int) + 456
22 com.apple.QuartzCore 0x00007fff37c89296 CA::OGL::ImagingNode::retain_surface(float&, unsigned int) + 150
23 com.apple.QuartzCore 0x00007fff37c891b5 CA::OGL::LayerNode::retain_surface(float&, unsigned int) + 113
24 com.apple.QuartzCore 0x00007fff37c80660 CA::OGL::ImagingNode::render(CA::OGL::ImagingNode::RenderClosure*, unsigned int) + 142
25 com.apple.QuartzCore 0x00007fff37c804f3 CA::OGL::render_layers(CA::OGL::Renderer&, CA::OGL::Layer*) + 299
26 com.apple.QuartzCore 0x00007fff37c8243c CA::OGL::LayerNode::apply(float, CA::OGL::Surface**, float*) + 222
27 com.apple.QuartzCore 0x00007fff37c8079a CA::OGL::ImagingNode::render(CA::OGL::ImagingNode::RenderClosure*, unsigned int) + 456
28 com.apple.QuartzCore 0x00007fff37c804f3 CA::OGL::render_layers(CA::OGL::Renderer&, CA::OGL::Layer*) + 299
29 com.apple.QuartzCore 0x00007fff37c8243c CA::OGL::LayerNode::apply(float, CA::OGL::Surface**, float*) + 222
30 com.apple.QuartzCore 0x00007fff37c8079a CA::OGL::ImagingNode::render(CA::OGL::ImagingNode::RenderClosure*, unsigned int) + 456
31 com.apple.QuartzCore 0x00007fff37c804f3 CA::OGL::render_layers(CA::OGL::Renderer&, CA::OGL::Layer*) + 299
32 com.apple.QuartzCore 0x00007fff37c8243c CA::OGL::LayerNode::apply(float, CA::OGL::Surface**, float*) + 222
33 com.apple.QuartzCore 0x00007fff37c8079a CA::OGL::ImagingNode::render(CA::OGL::ImagingNode::RenderClosure*, unsigned int) + 456
34 com.apple.QuartzCore 0x00007fff37c804f3 CA::OGL::render_layers(CA::OGL::Renderer&, CA::OGL::Layer*) + 299
35 com.apple.QuartzCore 0x00007fff37c8243c CA::OGL::LayerNode::apply(float, CA::OGL::Surface**, float*) + 222
36 com.apple.QuartzCore 0x00007fff37c8079a CA::OGL::ImagingNode::render(CA::OGL::ImagingNode::RenderClosure*, unsigned int) + 456
37 com.apple.QuartzCore 0x00007fff37c804f3 CA::OGL::render_layers(CA::OGL::Renderer&, CA::OGL::Layer*) + 299
38 com.apple.QuartzCore 0x00007fff37c7bbaa CA::OGL::render_root_layers(CA::OGL::Renderer&, x_link_struct const*, CA::OGL::Gstate const&) + 487
39 com.apple.QuartzCore 0x00007fff37c7173a CA::OGL::Renderer::render(CA::Render::Update const*) + 1012
40 com.apple.QuartzCore 0x00007fff37c71311 CA::OGL::render(CA::OGL::Renderer&, CA::Render::Update*) + 396
41 com.apple.QuartzCore 0x00007fff37c60b09 view_draw(_CAView*, double, CVTimeStamp const*, bool) + 3093
42 com.apple.QuartzCore 0x00007fff37c5fec3 view_display_link(double, CVTimeStamp const*, void*) + 153
43 com.apple.QuartzCore 0x00007fff37c5fd1b link_callback + 255
44 com.apple.CoreVideo 0x00007fff2e4d95cf CVDisplayLink::performIO(CVTimeStamp*) + 233
45 com.apple.CoreVideo 0x00007fff2e4d8a14 CVDisplayLink::runIOThread() + 612
46 libsystem_pthread.dylib 0x00007fff54f3c661 _pthread_body + 340
47 libsystem_pthread.dylib 0x00007fff54f3c50d _pthread_start + 377
48 libsystem_pthread.dylib 0x00007fff54f3bbf9 thread_start + 13
Binary Images:
0x104f29000 - 0x10547cfcf +com.figure53.QLab.4 (4.2.3 - 4203) <C0916F24-A452-3F09-AF5C-EA9522243AFD> /Applications/QLab.app/Contents/MacOS/QLab
0x105a13000 - 0x105a25fff +info.v002.Syphon (3 - 3) <1034CFCA-CAB7-3823-A23F-AD77736BEEB5> /Applications/QLab.app/Contents/Frameworks/Syphon.framework/Versions/A/Syphon
Do you have any insight as to what might be happening here? It's a crash on quit, and not a terribly common one, but I'd feel better if I at least understood what was going on, and whether it's something we can prevent on our end. As it is, I don't know how to reproduce it. It's a rare race, although at least one customer has hit it multiple times on a single computer.