Built App Crashes on "resolutionChange"

I’ve been having these random crashes on Mac OS 10.13 with Xojo 2017 through 2018 where my app crashes at;

objc_msgSend() selector name: resolutionChanged:

It doesn’t seem to be happening when the the screen resolution is actually changed on the computer. It seems to be almost random, but I think there is a clear cause to it. I am hoping someone would have some insight one where to start looking.

Supports Hi-DPI is turned off.

Below is the crash report.

Thanks in advanced for any insights.

Time Awake Since Boot: 270000 seconds

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 0x00003c4b5582bec0
Exception Note: EXC_CORPSE_NOTIFY

Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [0]

VM Regions Near 0x3c4b5582bec0:
JS JIT generated code 000032d919201000-000032d919202000 [ 4K] —/rwx SM=NUL
–>
MALLOC_NANO 0000600000000000-0000600002e00000 [ 46.0M] rw-/rwx SM=PRV

Application Specific Information:
objc_msgSend() selector name: resolutionChanged:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libobjc.A.dylib 0x00007fff6b8e6e9d objc_msgSend + 29
1 com.apple.CoreFoundation 0x00007fff4455447c CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER + 12
2 com.apple.CoreFoundation 0x00007fff4455434a _CFXRegistrationPost + 458
3 com.apple.CoreFoundation 0x00007fff44554081 ___CFXNotificationPost_block_invoke + 225
4 com.apple.CoreFoundation 0x00007fff44512c12 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1826
5 com.apple.CoreFoundation 0x00007fff44511ca3 _CFXNotificationPost + 659
6 com.apple.Foundation 0x00007fff4663c817 -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
7 com.apple.AppKit 0x00007fff423987c3 -[NSWindow _postWindowDidChangeBackingPropertiesAndDisplayWindowForPreviousBackingScaleFactor:previousColorSpace:] + 197
8 com.apple.AppKit 0x00007fff41c5cf03 __67-[NSWindow _updateSettingsSendingScreenChangeNotificationIfNeeded:]_block_invoke + 212
9 com.apple.AppKit 0x00007fff41bf3c0c NSPerformVisuallyAtomicChange + 146
10 com.apple.AppKit 0x00007fff41b7904c -[NSWindow _updateSettingsSendingScreenChangeNotificationIfNeeded:] + 193
11 com.apple.AppKit 0x00007fff41e4356e -[NSWindow _displayChangedSoAdjustWindows:] + 146
12 com.apple.AppKit 0x00007fff41c3e138 __44-[NSApplication makeWindowsPerform:inOrder:]_block_invoke + 27
13 com.apple.AppKit 0x00007fff41ee8cdd __52-[NSApplication _findWindowWithOptions:passingTest:]_block_invoke + 26
14 com.apple.AppKit 0x00007fff41ee8e8c -[NSApplication enumerateWindowsWithOptions:usingBlock:] + 301
15 com.apple.AppKit 0x00007fff41ee8c8a -[NSApplication _findWindowWithOptions:passingTest:] + 147
16 com.apple.AppKit 0x00007fff41acabf6 -[NSApplication makeWindowsPerform:inOrder:] + 255
17 com.apple.AppKit 0x00007fff4264f00d -[NSApplication(ScreenHandling) _reactToScreenInvalidationImmediately:] + 60
18 com.apple.AppKit 0x00007fff4264ef95 __60-[NSApplication(ScreenHandling) _reactToScreenInvalidation:]_block_invoke + 59
19 com.apple.CoreFoundation 0x00007fff4455ca3c CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 12
20 com.apple.CoreFoundation 0x00007fff4453f973 __CFRunLoopDoBlocks + 275
21 com.apple.CoreFoundation 0x00007fff4453f738 __CFRunLoopRun + 3128
22 com.apple.CoreFoundation 0x00007fff4453e867 CFRunLoopRunSpecific + 487
23 com.apple.HIToolbox 0x00007fff4381ed96 RunCurrentEventLoopInMode + 286
24 com.apple.HIToolbox 0x00007fff4381eb06 ReceiveNextEventCommon + 613
25 com.apple.HIToolbox 0x00007fff4381e884 _BlockUntilNextEventMatchingListInModeWithFilter + 64
26 com.apple.AppKit 0x00007fff41acea73 _DPSNextEvent + 2085
27 com.apple.AppKit 0x00007fff42264e34 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 3044
28 com.xojo.XojoFramework 0x0000000111ba7859 0x111ad3000 + 870489
29 com.xojo.XojoFramework 0x0000000111ba789d 0x111ad3000 + 870557
30 com.app.appname 0x0000000105eaea65 Application._CallFunctionWithExceptionHandling%%op + 181
31 com.xojo.XojoFramework 0x0000000111d285a7 CallFunctionWithExceptionHandling(void (*)()) + 262
32 com.xojo.XojoFramework 0x0000000111ba7806 0x111ad3000 + 870406
33 com.apple.AppKit 0x00007fff41ac3885 -[NSApplication run] + 764
34 com.xojo.XojoFramework 0x0000000111d2691d RuntimeRun + 42
35 com.app.appname 0x0000000105f99ac3 REALbasic._RuntimeRun + 19
36 com.app.appname 0x0000000110e1f376 _Main + 326
37 com.app.appname 0x0000000110e0a493 main + 19
38 libdyld.dylib 0x00007fff6c50b015 start + 1

What I can determine from this crash report is that the macOS thinks that your screen resolution is changing, even if you don’t. While it may not help solve your crashes (although it might!), I believe that is caused by either buggy software or a hardware intermittent failure.

  • When this next occurs, immediately look at Console, you may find some error messages logged there.
  • Shut the machine down (backup first incase this kills your machine), get a can of compressed air and give the ports a good blast.
  • Use a Q-Tip with trace amounts of alcohol, and gently wipe the inside of the port.
  • Wait for it to dry, perhaps overnight before booting it back up.

If it still persists;

  • Backup the machine using Time Machine.
  • Use the recovery partition to boot the machine, reformat the internal HDD and re-install the macOS.
  • Once installation has completed, it’ll offer to restore from Time Machine, so do that.

If it still persists;

  • IMHO there’s a hardware fault. You can try your local service center to see if they can replace the logic board or…
  • Time to buy a new machine, I’d avoid all of Apple’s current portable machines at the moment. Check the refurbs for a 2015 model, it comes with a full warranty and most importantly isn’t designed to be thrown away after a couple of years.

Quick question before you go off buying a new machine, does this crash happen to any other apps?

Right now it only happens with one app.

I haven’t seen it happen with any other app that I am using.

That in itself is a good point, the app is crashing because a receiver of the message “resolutionChanged” isn’t there any more. I was more concerned with why the update message is being sent randomly. I’ve had similar issues like this in the past and the cause of the problem was a hardware fault, but I’ll give you that it was only noticeable because of an additional issues within the software.

@Paul Levine -

Have you searched for resolutionChanged: in your app?