After upgrading to macOS Sierra, a growing number of my app’s users see crashes at [[_NSCGSWindowBuffer colorSpace] retain] with Segmentation fault: 11 / EXC_BAD_ACCESS.
I’m somewhat at a loss here, because the app works fine on my machine, but I keep getting more and more crash reports each day.
The stack trace is always the same, no sign of my app’s code in the stack trace so I have no idea where to start.
Some users claim that the app was in full screen mode while it crashed. Not sure if it is related to that…
I scanned my app for the use of NSColorSpace and everything looks good to me. The app uses automatic reference counting so I don’t call retain/release myself.
Did anybody run into a problem like this or has any suggestion how to debug an issue like this?
Sample crash log:
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000161d3a58bec0
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [0]
VM Regions Near 0x161d3a58bec0:
CoreAnimation 0000000119200000-0000000119642000 [ 4360K] rw-/rwx SM=PRV
-->
JS JIT generated code 0000463b1ca00000-0000463b1ca01000 [ 4K] ---/rwx SM=NUL
Application Specific Information:
objc_msgSend() selector name: retain
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libobjc.A.dylib 0x00007fffb9f71b5d objc_msgSend + 29
1 com.apple.AppKit 0x00007fffa35caa35 -[_NSCGSWindowBuffer colorSpace] + 33
2 com.apple.AppKit 0x00007fffa359ed11 __NSCGSWindowBackingStoreMark__block_invoke + 997
3 com.apple.AppKit 0x00007fffa35624ec NSCGSTransactionRunPreCommitActionsForOrder_ + 289
4 com.apple.AppKit 0x00007fffa35623b8 NSCGSTransactionRunPreCommitActions_ + 31
5 com.apple.AppKit 0x00007fffa356238d __39+[_NSCGSTransaction currentTransaction]_block_invoke + 34
6 com.apple.QuartzCore 0x00007fffab2c6a4a CA::Transaction::run_commit_handlers(CATransactionPhase) + 46
7 com.apple.QuartzCore 0x00007fffab3ce58f CA::Context::commit_transaction(CA::Transaction*) + 959
8 com.apple.QuartzCore 0x00007fffab2c55e5 CA::Transaction::commit() + 475
9 com.apple.AppKit 0x00007fffa38441cd __37+[NSDisplayCycle currentDisplayCycle]_block_invoke.31 + 323
10 com.apple.CoreFoundation 0x00007fffa57a8f87 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
11 com.apple.CoreFoundation 0x00007fffa57a8ef7 __CFRunLoopDoObservers + 391
12 com.apple.CoreFoundation 0x00007fffa5789e39 __CFRunLoopRun + 873
13 com.apple.CoreFoundation 0x00007fffa5789874 CFRunLoopRunSpecific + 420
14 com.apple.HIToolbox 0x00007fffa4d29f6c RunCurrentEventLoopInMode + 240
15 com.apple.HIToolbox 0x00007fffa4d29ca9 ReceiveNextEventCommon + 184
16 com.apple.HIToolbox 0x00007fffa4d29bd6 _BlockUntilNextEventMatchingListInModeWithFilter + 71
17 com.apple.AppKit 0x00007fffa34205f5 _DPSNextEvent + 1093
18 com.apple.AppKit 0x00007fffa3b308eb -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1637
19 com.apple.AppKit 0x00007fffa3414fbd -[NSApplication run] + 926
20 com.apple.AppKit 0x00007fffa33dfa8a NSApplicationMain + 1237
21 libdyld.dylib 0x00007fffba85b255 start + 1