My iOS app crashed

The crash logs recorded on iOS Firebase, does anyone have a solution? Using Unity 2022.3.42.

# Crashlytics - Stack trace
# Application: com.xxzhz.ios.eu
# Platform: apple
# Version: 1.3.125 (1387)
# Issue: 7692d285cb603c3c62443c93b01e3c90
# Session: 156b25b6f89a457d91bd7ff906af0af0_DNE_0_v2
# Date: Fri Feb 07 2025 13:05:18 GMT+0800

com.apple.main-thread
0  libsystem_kernel.dylib         0x687c read + 8
1  CoreFoundation                 0x7e200 fdRead + 28
2  CoreFoundation                 0x7e11c fileRead + 56
3  CoreFoundation                 0x7ce74 CFReadStreamRead + 320
4  CFNetwork                      0x9d8fc readEntirely(__CFReadStream*, void*, long) + 56
5  CFNetwork                      0x9bb70 BinaryCookieStorage::readCookiesFromStream(__CFReadStream*, MemoryCookies*, __CFData const**) + 88
6  CFNetwork                      0xba6a0 DiskCookieStorage::readFileToCookies(MemoryCookies*) + 200
7  CFNetwork                      0xbb5e0 DiskCookieStorage::syncStorageWithCompletionLocked(unsigned char, void () block_pointer) + 3360
8  CFNetwork                      0x1f84fc invocation function for block in CFHTTPCookieStorageFlushCookieStores() + 200
9  CoreFoundation                 0x55cf4 __CFDictionaryApplyFunction_block_invoke + 28
10 CoreFoundation                 0x55b10 CFBasicHashApply + 148
11 CoreFoundation                 0x593dc CFDictionaryApplyFunction + 224
12 CFNetwork                      0x1f83a0 CFHTTPCookieStorageFlushCookieStores() + 188
13 libsystem_c.dylib              0x23d68 __cxa_finalize_ranges + 492
14 libsystem_c.dylib              0x23b64 exit + 32
15 UnityFramework                 0x2ded100 UnityRequestQuit + 166 (UnityAppController.mm:166)
16 UnityFramework                 0x3cb3fb8 UnityPlayerLoopImpl + 347 (LibEntryPoint.mm:347)
17 UnityFramework                 0x2df229c UnityRepaint + 218 (UnityAppController+Rendering.mm:218)
18 QuartzCore                     0xc76dc CA::Display::DisplayLinkItem::dispatch_(CA::SignPost::Interval<(CA::SignPost::CAEventCode)835322056>&) + 48
19 QuartzCore                     0xc5914 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 884
20 QuartzCore                     0xc54ac CA::Display::DisplayLink::dispatch_deferred_display_links(unsigned int) + 352
21 UIKitCore                      0xa09d8 _UIUpdateSequenceRun + 84
22 UIKitCore                      0xa0628 schedulerStepScheduledMainSection + 172
23 UIKitCore                      0xa159c runloopSourceCallback + 92
24 CoreFoundation                 0x56328 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
25 CoreFoundation                 0x562bc __CFRunLoopDoSource0 + 176
26 CoreFoundation                 0x53dc0 __CFRunLoopDoSources0 + 244
27 CoreFoundation                 0x52fbc __CFRunLoopRun + 840
28 CoreFoundation                 0x52830 CFRunLoopRunSpecific + 588
29 GraphicsServices               0x11c4 GSEventRunModal + 164
30 UIKitCore                      0x3d2eb0 -[UIApplication _run] + 816
31 UIKitCore                      0x4815b4 UIApplicationMain + 340
32 UnityFramework                 0x2df1ec0 -[UnityFramework runUIApplicationMainWithArgc:argv:] + 96 (main.mm:96)
33 EpicWar                        0x417c main + 28 (main.mm:28)
34 ???                            0x1c7d86ec8

com.q1sdk.stdout
0  libsystem_kernel.dylib         0x687c read + 8
1  UnityFramework                 0x30d3748 __40-[APMReadConsole redirectStandardOutput]_block_invoke + 129 (APMReadConsole.m:129)
2  libdispatch.dylib              0x2370 _dispatch_call_block_and_release + 32
3  libdispatch.dylib              0x40d0 _dispatch_client_callout + 20
4  libdispatch.dylib              0xb6d8 _dispatch_lane_serial_drain + 744
5  libdispatch.dylib              0xc1e0 _dispatch_lane_invoke + 380
6  libdispatch.dylib              0x17258 _dispatch_root_queue_drain_deferred_wlh + 288
7  libdispatch.dylib              0x16aa4 _dispatch_workloop_worker_thread + 540
8  libsystem_pthread.dylib        0x4c7c _pthread_wqthread + 288
9  libsystem_pthread.dylib        0x1488 start_wqthread + 8

APMBlockThrad
0  libsystem_kernel.dylib         0x161c semaphore_timedwait_trap + 8
1  libdispatch.dylib              0x46e8 _dispatch_sema4_timedwait + 64
2  libdispatch.dylib              0x4ce8 _dispatch_semaphore_wait_slow + 76
3  UnityFramework                 0x30eac30 __52-[APMBlockMonitorManager beginMonitor:durationTime:]_block_invoke + 137 (APMBlockMonitorManager.m:137)
4  libdispatch.dylib              0x2370 _dispatch_call_block_and_release + 32
5  libdispatch.dylib              0x40d0 _dispatch_client_callout + 20
6  libdispatch.dylib              0x7218 _dispatch_queue_override_invoke + 916
7  libdispatch.dylib              0x15d8c _dispatch_root_queue_drain + 392
8  libdispatch.dylib              0x16590 _dispatch_worker_thread2 + 156
9  libsystem_pthread.dylib        0x4c40 _pthread_wqthread + 228
10 libsystem_pthread.dylib        0x1488 start_wqthread + 8

Crashed: Thread
0  libsystem_kernel.dylib         0xc1d4 __pthread_kill + 8
1  libsystem_pthread.dylib        0x7ef8 pthread_kill + 268
2  libsystem_c.dylib              0x77ad8 abort + 128
3  libc++abi.dylib                0x135b8 __cxxabiv1::__aligned_malloc_with_fallback(unsigned long) + 130
4  libc++abi.dylib                0x12e90 __cxa_deleted_virtual + 22
5  UnityFramework                 0x348b2f4 GetAllocatorContainingPtr + 2263 (MemoryManager.cpp:2263)
6  UnityFramework                 0x3488eb4 Deallocate + 2198 (MemoryManager.cpp:2198)
7  UnityFramework                 0x34864e8 operator delete + 275 (MemoryManager.cpp:275)
8  UnityFramework                 0x3031304 future::HandlerThread::Run() + 77336
9  UnityFramework                 0x30322e4 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, std::__1::function<void ()>>>(void*) + 81400
10 libsystem_pthread.dylib        0x637c _pthread_start + 136
11 libsystem_pthread.dylib        0x1494 thread_start + 8

com.apple.uikit.eventfetch-thread
0  libsystem_kernel.dylib         0x1688 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x4d98 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0x4cb0 mach_msg_overwrite + 424
3  libsystem_kernel.dylib         0x4afc mach_msg + 24
4  CoreFoundation                 0x53a84 __CFRunLoopServiceMachPort + 160
5  CoreFoundation                 0x53130 __CFRunLoopRun + 1212
6  CoreFoundation                 0x52830 CFRunLoopRunSpecific + 588
7  Foundation                     0xb7500 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212
8  Foundation                     0xb7350 -[NSRunLoop(NSRunLoop) runUntilDate:] + 64
9  UIKitCore                      0x3e6358 -[UIEventFetcher threadMain] + 420
10 Foundation                     0xc86c8 __NSThread__start__ + 724
11 libsystem_pthread.dylib        0x637c _pthread_start + 136
12 libsystem_pthread.dylib        0x1494 thread_start + 8

caulk::deferred_logger
0  libsystem_kernel.dylib         0x1604 semaphore_wait_trap + 8
1  caulk                          0x4a0c caulk::semaphore::timed_wait(double) + 220
2  caulk                          0x48c4 caulk::concurrent::details::worker_thread::run() + 36
3  caulk                          0x480c void* caulk::thread_proxy<std::__1::tuple<caulk::thread::attributes, void (caulk::concurrent::details::worker_thread::*)(), std::__1::tuple<caulk::concurrent::details::worker_thread*>>>(void*) + 96
4  libsystem_pthread.dylib        0x637c _pthread_start + 136
5  libsystem_pthread.dylib        0x1494 thread_start + 8

caulk.messenger.shared:high
0  libsystem_kernel.dylib         0x1604 semaphore_wait_trap + 8
1  caulk                          0x4a0c caulk::semaphore::timed_wait(double) + 220
2  caulk                          0x48c4 caulk::concurrent::details::worker_thread::run() + 36
3  caulk                          0x480c void* caulk::thread_proxy<std::__1::tuple<caulk::thread::attributes, void (caulk::concurrent::details::worker_thread::*)(), std::__1::tuple<caulk::concurrent::details::worker_thread*>>>(void*) + 96
4  libsystem_pthread.dylib        0x637c _pthread_start + 136
5  libsystem_pthread.dylib        0x1494 thread_start + 8

com.apple.CoreMotion.MotionThread
0  libsystem_kernel.dylib         0x1688 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x4d98 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0x4cb0 mach_msg_overwrite + 424
3  libsystem_kernel.dylib         0x4afc mach_msg + 24
4  CoreFoundation                 0x53a84 __CFRunLoopServiceMachPort + 160
5  CoreFoundation                 0x53130 __CFRunLoopRun + 1212
6  CoreFoundation                 0x52830 CFRunLoopRunSpecific + 588
7  CoreFoundation                 0xbdcec CFRunLoopRun + 64
8  CoreMotion                     0x10084 (缺少 UUID ad76b51c2c19371888c6e6a9d73d5868)
9  libsystem_pthread.dylib        0x637c _pthread_start + 136
10 libsystem_pthread.dylib        0x1494 thread_start + 8

Thread
0  libsystem_kernel.dylib         0x71b0 __semwait_signal + 8
1  libsystem_c.dylib              0x17a78 nanosleep + 220
2  libsystem_c.dylib              0x75550 sleep + 52
3  UnityFramework                 0x32f7020 monitorCachedData + 162 (KSCrashCachedData.c:162)
4  libsystem_pthread.dylib        0x637c _pthread_start + 136
5  libsystem_pthread.dylib        0x1494 thread_start + 8

KSCrash Exception Handler (Secondary)
0  libsystem_kernel.dylib         0x1688 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x4d98 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0x2bfc thread_suspend + 108
3  UnityFramework                 0x32f4be4 handleExceptions + 281 (KSCrashMonitor_MachException.c:281)
4  libsystem_pthread.dylib        0x637c _pthread_start + 136
5  libsystem_pthread.dylib        0x1494 thread_start + 8

KSCrash Exception Handler (Primary)
0  libsystem_kernel.dylib         0x1688 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x4d98 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0x4cb0 mach_msg_overwrite + 424
3  libsystem_kernel.dylib         0x4afc mach_msg + 24
4  UnityFramework                 0x32f4c14 handleExceptions + 290 (KSCrashMonitor_MachException.c:290)
5  libsystem_pthread.dylib        0x637c _pthread_start + 136
6  libsystem_pthread.dylib        0x1494 thread_start + 8

com.apple.NSURLConnectionLoader
0  libsystem_kernel.dylib         0x1688 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x4d98 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0x4cb0 mach_msg_overwrite + 424
3  libsystem_kernel.dylib         0x4afc mach_msg + 24
4  CoreFoundation                 0x53a84 __CFRunLoopServiceMachPort + 160
5  CoreFoundation                 0x53130 __CFRunLoopRun + 1212
6  CoreFoundation                 0x52830 CFRunLoopRunSpecific + 588
7  CFNetwork                      0xfdee0 +[__CFN_CoreSchedulingSetRunnable _run:] + 416
8  Foundation                     0xc86c8 __NSThread__start__ + 724
9  libsystem_pthread.dylib        0x637c _pthread_start + 136
10 libsystem_pthread.dylib        0x1494 thread_start + 8

com.google.firebase.crashlytics.MachExceptionServer
0  libsystem_kernel.dylib         0x1688 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x4d98 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0x4cb0 mach_msg_overwrite + 424
3  libsystem_kernel.dylib         0x4afc mach_msg + 24
4  UnityFramework                 0x3072c08 FIRCLSMachExceptionServer + 192 (FIRCLSMachException.c:192)
5  libsystem_pthread.dylib        0x637c _pthread_start + 136
6  libsystem_pthread.dylib        0x1494 thread_start + 8

com.apple.CFStream.LegacyThread
0  libsystem_kernel.dylib         0x1688 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x4d98 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0x4cb0 mach_msg_overwrite + 424
3  libsystem_kernel.dylib         0x4afc mach_msg + 24
4  CoreFoundation                 0x53a84 __CFRunLoopServiceMachPort + 160
5  CoreFoundation                 0x53130 __CFRunLoopRun + 1212
6  CoreFoundation                 0x52830 CFRunLoopRunSpecific + 588
7  CoreFoundation                 0xbb698 _legacyStreamRunLoop_workThread + 300
8  libsystem_pthread.dylib        0x637c _pthread_start + 136
9  libsystem_pthread.dylib        0x1494 thread_start + 8

onLineCount
0  libsystem_kernel.dylib         0x1688 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x4d98 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0x4cb0 mach_msg_overwrite + 424
3  libsystem_kernel.dylib         0x4afc mach_msg + 24
4  CoreFoundation                 0x53a84 __CFRunLoopServiceMachPort + 160
5  CoreFoundation                 0x53130 __CFRunLoopRun + 1212
6  CoreFoundation                 0x52830 CFRunLoopRunSpecific + 588
7  Foundation                     0xb7500 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212
8  Foundation                     0xb73d4 -[NSRunLoop(NSRunLoop) run] + 64
9  UnityFramework                 0x31ad300 -[GLALifeCycleListener onLineCountThreadAction] + 87 (GLALifeCycleListener.m:87)
10 Foundation                     0xc86c8 __NSThread__start__ + 724
11 libsystem_pthread.dylib        0x637c _pthread_start + 136
12 libsystem_pthread.dylib        0x1494 thread_start + 8

Thread
0  libsystem_kernel.dylib         0x1410 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x4cc8 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0x1488 start_wqthread + 8

Thread
0  libsystem_kernel.dylib         0x1410 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x4cc8 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0x1488 start_wqthread + 8

Thread
0  libsystem_kernel.dylib         0x1410 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x4cc8 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0x1488 start_wqthread + 8

Thread
0  libsystem_kernel.dylib         0x1410 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x4cc8 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0x1488 start_wqthread + 8

The crashed thread does not look like something from Unity. Do you have native plugins?

We have some plugins, such as Firebase and DotNetty, but we can’t tell which plugins are causing the issue from the crash logs.

Search native plugins for std::thread and future.
How to fix it will be another matter, cause it seems that thread has to be ended before Unity shuts down.

I searched the entire project and found std::thread only in two places: IL2CPP/libil2cpp/os/Std/ThreadImpl.cpp and LofeltHaptics.framework/LofeltHaptics.

After disabling the LofeltHaptics.framework/LofeltHaptics plugin, Firebase is still reporting this crash. How should I continue investigating the issue?