App Crash when using with external monitor

Hello,

My user reports a crash and say that it seems happen when he disconnects his laptop (being closed) from the external monitor then open the laptop again to use my app.

I cannot reproduce the issue to debug. The crash report prints some information as below. I'm not sure if the stack trace tells some problems related to KVO. Could anyone give me the advise what could be wrong in my app? thanks a lot.

  "vmRegionInfo" : "0x113e1930 is not in any region.  Bytes before following region: 4006160080\n      REGION TYPE                    START - END         [ VSIZE] PRT\/MAX SHRMOD  REGION DETAIL\n      UNUSED SPACE AT START\n--->  \n      __TEXT                      100074000-1012a4000    [ 18.2M] r-x\/r-x SM=COW  ...nts\/MacOS\/MyApp",
  "isCorpse" : 1,
  "exception" : {"codes":"0x0000000000000001, 0x00000000113e1930","rawCodes":[1,289282352],"type":"EXC_BAD_ACCESS","signal":"SIGSEGV","subtype":"KERN_INVALID_ADDRESS at 0x00000000113e1930"},
  "termination" : {"flags":0,"code":11,"namespace":"SIGNAL","indicator":"Segmentation fault: 11","byProc":"exc handler","byPid":92577},
  "ktriageinfo" : "VM - Compressor failed a blocking pager_get\nVM - Compressor failed a blocking pager_get\nVM - Compressor failed a blocking pager_get\nVM - Compressor failed a blocking pager_get\nVM - Compressor failed a blocking pager_get\n",
  "vmregioninfo" : "0x113e1930 is not in any region.  Bytes before following region: 4006160080\n      REGION TYPE                    START - END         [ VSIZE] PRT\/MAX SHRMOD  REGION DETAIL\n      UNUSED SPACE AT START\n--->  \n      __TEXT                      100074000-1012a4000    [ 18.2M] r-x\/r-x SM=COW  ...nts\/MacOS\/MyApp",
  "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0},
  "faultingThread" : 0,
  "threads" : [{"triggered":true,"id":3800781,"threadState":{"x":[{"value":289282352},{"value":8636418237,"objc-selector":"_isKVOA"},{"value":0},{"value":4},{"value":15},{"value":1},{"value":8636388587,"objc-selector":"observeValueForKeyPath:ofObject:change:context:"},{"value":6171429376},{"value":8636416000,"objc-selector":""},{"value":16},{"value":2},{"value":63},{"value":36},{"value":5177990704},{"value":7387906048},{"value":8878686176,"symbolLocation":0,"symbol":"OBJC_CLASS_$_NSMutableIndexSet"},{"value":7389711300,"symbolLocation":0,"symbol":"class_getMethodImplementation"},{"value":8892457680},{"value":0},{"value":289282352},{"value":8636418237,"objc-selector":"_isKVOA"},{"value":152},{"value":19},{"value":105553283433568},{"value":4},{"value":8636411362,"objc-selector":"removeIndex:"},{"value":6171429368},{"value":8878677536,"symbolLocation":0,"symbol":"OBJC_CLASS_$_NSKeyValueObservance"},{"value":105553180243120}],"flavor":"ARM_THREAD_STATE64","lr":{"value":7389711344},"cpsr":{"value":2147487744},"fp":{"value":6171429264},"sp":{"value":6171429248},"esr":{"value":2449473542,"description":"(Data Abort) byte read Translation fault"},"pc":{"value":7389786712,"matchesCrashFrame":1},"far":{"value":289282352}},"queue":"com.apple.main-thread","frames":[{"imageOffset":131672,"symbol":"objc_class::isInitialized()","symbolLocation":0,"imageIndex":0},{"imageOffset":56304,"symbol":"class_getMethodImplementation","symbolLocation":44,"imageIndex":0},{"imageOffset":83920,"symbol":"_NSKVONotifyingOriginalClassForIsa","symbolLocation":32,"imageIndex":1},{"imageOffset":229352,"symbol":"_NSKeyValueObservationInfoGetObservances","symbolLocation":288,"imageIndex":1},{"imageOffset":1798020,"symbol":"NSKeyValueWillChangeWithPerThreadPendingNotifications","symbolLocation":240,"imageIndex":1},{"imageOffset":11380800,"symbol":"__reusableDependencyContextForKey_block_invoke","symbolLocation":64,"imageIndex":2},{"imageOffset":309344,"symbol":"__CFSetApplyFunction_block_invoke","symbolLocation":28,"imageIndex":3},{"imageOffset":308872,"symbol":"CFBasicHashApply","symbolLocation":148,"imageIndex":3},{"imageOffset":308684,"symbol":"CFSetApplyFunction","symbolLocation":328,"imageIndex":3},{"imageOffset":479500,"symbol":"-[NSView setFrameSize:]","symbolLocation":1228,"imageIndex":2},{"imageOffset":612340,"symbol":"-[NSThemeFrame setFrameSize:]","symbolLocation":292,"imageIndex":2},{"imageOffset":550020,"symbol":"-[NSView setFrame:]","symbolLocation":420,"imageIndex":2},{"imageOffset":620044,"symbol":"-[NSView resizeWithOldSuperviewSize:]","symbolLocation":588,"imageIndex":2},{"imageOffset":623452,"symbol":"-[NSView _layoutSubtreeIfNeededAndAllowTemporaryEngine:]","symbolLocation":944,"imageIndex":2},{"imageOffset":622296,"symbol":"-[NSWindow(NSConstraintBasedLayout) _layoutViewTree]","symbolLocation":148,"imageIndex":2},{"imageOffset":610144,"symbol":"-[NSWindow _oldPlaceWindow:fromServer:]","symbolLocation":584,"imageIndex":2},{"imageOffset":605664,"symbol":"-[NSWindow _setFrameCommon:display:fromServer:]","symbolLocation":2220,"imageIndex":2},{"imageOffset":9294524,"symbol":"-[NSWindow(NSScreenLayout) _setFrame:fromAdjustmentToScreen:anchorIfNeeded:animate:]","symbolLocation":1692,"imageIndex":2},{"imageOffset":3963944,"symbol":"-[NSWindow _adjustWindowToScreen]","symbolLocation":1296,"imageIndex":2},{"imageOffset":4122644,"symbol":"-[NSWindow _displayChangedSoAdjustWindows:]","symbolLocation":116,"imageIndex":2},{"imageOffset":12082044,"symbol":"___NSApplicationPerformScreenInvalidationReactions_block_invoke","symbolLocation":96,"imageIndex":2},{"imageOffset":243432,"symbol":"-[NSApplication enumerateWindowsWithOptions:usingBlock:]","symbolLocation":288,"imageIndex":2},{"imageOffset":12080648,"symbol":"___NSApplicationReactToScreenInvalidation_block_invoke","symbolLocation":640,"imageIndex":2},{"imageOffset":12079364,"symbol":"_NSApplicationReactToScreenInvalidation","symbolLocation":288,"imageIndex":2},{"imageOffset":12079872,"symbol":"-[NSApplication(ScreenHandling) _reactToDisplayChanges:]","symbolLocation":408,"imageIndex":2},

The crash report prints some information as below.

Please post your full crash report, using the instructions from Posting a Crash Report.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Please see full crash report attached below, thanks.

Thanks for the crash report.

Looking at the crash it seems that the system has posted a screen changed notification and AppKit has crashed in the process of responding to that. The crash is happening deep in AppKit’s KVO infrastructure, which means it’s hard to distinguish this crash from the numerous other crashes that occur down there.

My best guess is that this is a system bug rather than anything your app is doing. And without a better understanding of what’s causing it, it’s hard to suggest any sort of path to a workaround.

Regardless of what else you do, I encourage you to file a bug about this. Please post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

App Crash when using with external monitor
 
 
Q