Happens on second build, meaning
Launch Xcode → Build → OK
Change a line → Build → Xcode crashes
Beginning of stack trace below
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------
Process: Xcode [64511]
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 15.4 (22622)
Build Info: IDEApplication-22622000000000000~2 (15F31d)
Code Type: X86-64 (Native)
Parent Process: launchd [1]
User ID: 501
Date/Time: 2024-07-31 16:18:09.2869 +1000
OS Version: macOS 14.1.1 (23B81)
Report Version: 12
Anonymous UUID: 390641C9-2924-838D-3E81-861399026A69
Time Awake Since Boot: 11000 seconds
System Integrity Protection: disabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_ARITHMETIC (SIGFPE)
Exception Codes: 0x0000000000000001, 0x0000000000000000
Termination Reason: Namespace SIGNAL, Code 8 Floating point exception: 8
Terminating Process: exc handler [64511]
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 CallstackAnalysis 0x7ffb0f9677f5 -[TPCSignatureStore isSignatureStoreUsable:] + 46
1 IDEPerformanceDebugger 0x303a0e4af RuntimePerformanceIssueDebuggerAddition.populateSignatureStore() + 815
2 IDEPerformanceDebugger 0x303a0dda8 closure #3 in closure #1 in RuntimePerformanceIssueDebuggerAddition.fetchLogs(bundleIdentifier:platform:) + 72
3 IDEPerformanceDebugger 0x303a1062c partial apply for closure #3 in closure #1 in RuntimePerformanceIssueDebuggerAddition.fetchLogs(bundleIdentifier:platform:) + 12
4 libswiftDispatch.dylib 0x7ff81b7d4331 partial apply for thunk for @callee_guaranteed () -> (@out A, @error @owned Error) + 17
5 libswiftDispatch.dylib 0x7ff81b7d49c9 thunk for @callee_guaranteed () -> (@out A, @error @owned Error)partial apply + 9
6 libswiftDispatch.dylib 0x7ff81b7d1cf8 closure #1 in closure #1 in OS_dispatch_queue._syncHelper<A>(fn:execute:rescue:) + 88
7 libswiftDispatch.dylib 0x7ff81b7d4291 partial apply for thunk for @callee_guaranteed () -> () + 17
8 libswiftDispatch.dylib 0x7ff81b7cda1e thunk for @escaping @callee_guaranteed () -> () + 14
9 libdispatch.dylib 0x7ff80552159a _dispatch_client_callout + 8
10 libdispatch.dylib 0x7ff80552e513 _dispatch_async_and_wait_invoke + 98
11 libdispatch.dylib 0x7ff80552159a _dispatch_client_callout + 8
12 libdispatch.dylib 0x7ff80552d8e1 _dispatch_main_queue_drain + 993
13 libdispatch.dylib 0x7ff80552d4f2 _dispatch_main_queue_callback_4CF + 31
14 CoreFoundation 0x7ff8057e4056 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
15 CoreFoundation 0x7ff8057a32b5 __CFRunLoopRun + 2459
16 CoreFoundation 0x7ff8057a2352 CFRunLoopRunSpecific + 557
17 HIToolbox 0x7ff8100449d9 RunCurrentEventLoopInMode + 292
18 HIToolbox 0x7ff8100447e6 ReceiveNextEventCommon + 665
19 HIToolbox 0x7ff810044531 _BlockUntilNextEventMatchingListInModeWithFilter + 66
20 AppKit 0x7ff808db2885 _DPSNextEvent + 880
21 AppKit 0x7ff8096a6348 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1304
22 DVTKit 0x17e217914 -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 366
23 AppKit 0x7ff808da3dfa -[NSApplication run] + 603
24 DVTKit 0x17e216a0f -[DVTApplication run] + 54
25 AppKit 0x7ff808d77e10 NSApplicationMain + 816
26 dyld 0x7ff8053403a6 start + 1942
After spending hours trying to fix this so I can write code again, I found that
- The issue does not happen when Xcode preferences are reset (
~/Library/Preferences/com.apple.dt.Xcode.plist
removed) - The lines in the plist that affect whether it crashes or not are within this block
"DVTAnalytics.AnalyticsDirectHangPointSource.lastRefreshAttemptDate" = {
DVTUserDefaultsCachingCache = {
"<bundle id> 5.0.5 2838 com.apple.platform.iphoneos" = "2024-07-31 13:12:12 +0000";
"<bundle id> 5.0.6 2843 com.apple.platform.iphoneos" = "2024-07-31 07:15:22 +0000";
"<bundle id> 5.1.0 2844 com.apple.platform.iphoneos" = "2024-07-31 04:42:07 +0000";
};
DVTUserDefaultsCachingKeysRecentlyUsed = (
"<bundle id> 5.1.0 2844 com.apple.platform.iphoneos",
"<bundle id> 5.0.6 2843 com.apple.platform.iphoneos",
"<bundle id> 5.0.5 2838 com.apple.platform.iphoneos"
);
};
Where 5.1.0 etc is the app version and 2844 etc is the build
Spent way too much time on this to dig further, but sharing the above in case it helps someone.
To avoid flushing preferences each time, a workaround is to remove the section with
defaults delete com.apple.dt.Xcode "DVTAnalytics.AnalyticsDirectHangPointSource.lastRefreshAttemptDate"
Might need to read the defaults for them to be read within Xcode as there is some caching that’s very inconsistent in behaviour
defaults read com.apple.dt.Xcode
Do share any findings you get on this if you encounter the same issue as I found nothing Googling