Xcode crashing on second build with EXC_ARITHMETIC (SIGFPE) / TPCSignatureStore

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

  1. The issue does not happen when Xcode preferences are reset (~/Library/Preferences/com.apple.dt.Xcode.plist removed)
  2. 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

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật