How to debug this crash?

How do I diagnose this crash in my macOS Cocoa app? It happened when clicking on my app window after doing something in another application.

Code Block
0x7fff6a1edef4 - /usr/lib/system/libsystem_platform.dylib : os_unfair_lock_lock
0x7fff32635d24 - /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation : -[NSConcreteAttributedString dealloc]
0x7fff2d40741d - /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit : -[NSStringMeasurementCacheKey dealloc]
0x7fff69ddc5d1 - /usr/lib/system/libcache.dylib : _entry_remove
0x7fff69ddba31 - /usr/lib/system/libcache.dylib : _cache_enforce_limits
0x7fff69ddb507 - /usr/lib/system/libcache.dylib : cache_set_and_retain
0x7fff2ff5c0cf - /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation : -[NSCache setObject:forKey:cost:]
0x7fff2d247093 - /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit : rectForString
[...]
0x7fff2ff8c335 - /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation : CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION
0x7fff2ff8c267 - /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation : CFRunLoopDoObservers
0x7fff2ff8b805 - /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation : CFRunLoopRun
0x7fff2ff8ae3e - /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation : CFRunLoopRunSpecific
0x7fff2ebb7abd - /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox : RunCurrentEventLoopInMode
0x7fff2ebb77d5 - /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox : ReceiveNextEventCommon
0x7fff2ebb7579 - /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox : _BlockUntilNextEventMatchingListInModeWithFilter
0x7fff2d1fd039 - /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit : _DPSNextEvent
0x7fff2d1fb880 - /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit : -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]
0x7fff2d1ed58e - /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit : -[NSApplication run]
0x7fff2d1bf396 - /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit : NSApplicationMain




Are you sure this is a crash? What you've provided looking like a hang, where it's stuck on the os_unfair_lock. If it's actually a crash you need to provide the essential elements of the crash report.
If it's a hang, you left out the more important parts of your summary: on the app's main thread, the run loop is calling out to draw, which requires updating the constraints, and in the process of recalculating the size of some text in an NSTextField, an os_unfair_lock in NSCache is deadlocking.
Are you modifying the view off the main thread somewhere?
How to debug this crash?
 
 
Q