我正在开发一个利用从CVDisplayLink线程驱动的NSOpenGLView的Cocoa应用程序。
我们最近看到了一些崩溃报告(在野外),其中包含以下堆栈跟踪。仅限10.11。
#29. Crashed: com.apple.root.default-qos
0 libobjc.A.dylib 0x7fff933bb4dd objc_msgSend + 29
1 CoreGraphics 0x7fff9219f19e CGImageGetProperty + 52
2 QuartzCore 0x7fff93ae1312 CA::Render::create_image(CGImage*, CGColorSpace*, unsigned int) + 149
3 QuartzCore 0x7fff93ae0fe6 CA::Render::copy_image(CGImage*, CGColorSpace*, unsigned int, double) + 395
4 QuartzCore 0x7fff93aeeb6b CA::Render::copy_render_value(void const*, CGColorSpace* (*)()) + 278
5 AppKit 0x7fffa010fcec -[_NSCGLSurface _copyNonatomicRenderValue] + 296
6 QuartzCore 0x7fff93addc35 -[CALayer(CALayerPrivate) _copyRenderLayer:layerFlags:commitFlags:] + 557
7 QuartzCore 0x7fff93add59d CA::Context::commit_layer(CA::Layer*, unsigned int, unsigned int, void*) + 103
8 QuartzCore 0x7fff93add4ca CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*) + 330
9 QuartzCore 0x7fff93adba72 CA::Context::commit_transaction(CA::Transaction*) + 1766
10 QuartzCore 0x7fff93adb0ec CA::Transaction::commit() + 508
11 AppKit 0x7fff9f9d95ae -[NSAnimation(NSInternal) _advanceTimeWithDisplayLink:] + 429
12 AppKit 0x7fff9f9d92ea -[NSScreenDisplayLink _fire] + 439
13 CoreFoundation 0x7fffa0b7bb94 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
14 CoreFoundation 0x7fffa0b7b823 __CFRunLoopDoTimer + 1075
15 CoreFoundation 0x7fffa0b7b37a __CFRunLoopDoTimers + 298
16 CoreFoundation 0x7fffa0b72871 __CFRunLoopRun + 1841
17 CoreFoundation 0x7fffa0b71ed8 CFRunLoopRunSpecific + 296
18 Foundation 0x7fff98c92ed9 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 270
19 AppKit 0x7fff9f93cd72 -[NSAnimation(NSInternal) _runBlocking] + 398
20 AppKit 0x7fff9f93cbcb -[NSAnimation(NSInternal) _animationThread] + 66
21 libdispatch.dylib 0x7fff8e85593d _dispatch_call_block_and_release + 12
22 libdispatch.dylib 0x7fff8e84a40b _dispatch_client_callout + 8
23 libdispatch.dylib 0x7fff8e84e29b _dispatch_root_queue_drain + 1890
24 libdispatch.dylib 0x7fff8e84db00 _dispatch_worker_thread3 + 91
25 libsystem_pthread.dylib 0x7fff90e4c4de _pthread_wqthread + 1129
26 libsystem_pthread.dylib 0x7fff90e4a341 start_wqthread + 13
我们有一个处于以下状态的CVDisplayLink驱动线程:
#35. CVDisplayLink
0 libsystem_platform.dylib 0x7fff9214ddbd _OSSpinLockLockSlow + 79
1 QuartzCore 0x7fff93ad88af -[CALayer setContents:] + 37
2 AppKit 0x7fff9fe302d7 flush_notify + 1169
3 GLEngine 0x7fff95e1ecda (Missing)
4 OpenGL 0x7fff9180effe CGLFlushDrawable + 66
当我在CA::Render::create_image
中设置符号断点时,我无法在com.apple.root.default-qos thread
中找到它。所以我得到第一个问题 - 这个堆栈何时在QOS线程中发生? (而不是主线程)。
我应该注意,有时崩溃发生在上面(CGImageGetProperty
)。任何帮助,将不胜感激。