TestFlight app always crashing when initially opening app

I've noticed recently that from TestFlight one of our apps always crashes on startup. It's very odd as our internal QA build launches without issue. We updated our Xcode project to support the latest 14.3 changes which perhaps could be related.

I'm seeing this semaphore_wait_trap in the crash log and am wondering if that could be related to the crash. I also see this 'VM - (arg = 0x0) pmap_enter retried due to resource shortage' though seems like a red herring and probably isn't wants going on.

Here is part the crash report. Anyone have any ideas?

Incident Identifier: 7954C11A-2DB1-4194-BE15-91EE3910C930
Beta Identifier:     474F50A9-7EFA-4F17-8459-03EBF49D8EA5
Hardware Model:      iPhone13,2
Process:             TheApp [4651]
Path:                /private/var/containers/Bundle/Application/9F217725-E09A-49BE-83C4-6603999887F1/TheApp.app/TheApp
Identifier:          com.company.blah
Version:             2.30.3 (5)
AppStoreTools:       15A240a
AppVariant:          1:iPhone13,2:16
Beta:                YES
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           com.company.blah [2914]

Date/Time:           2023-09-18 09:05:32.4529 -0500
Launch Time:         2023-09-18 09:05:31.9719 -0500
OS Version:          iPhone OS 16.6.1 (20G81)
Release Type:        User
Baseband Version:    3.80.01
Report Version:      104

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x0000000105910c78
Termination Reason: SIGNAL 5 Trace/BPT trap: 5
Terminating Process: exc handler [4651]

Triggered by Thread:  0

Kernel Triage:
VM - (arg = 0x0) pmap_enter retried due to resource shortage


Thread 0 name:   Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   TheApp                   	       0x105910c78 static MetricsSystem.bootstrap(_:) + 20794488 (Metrics.swift:21)
1   TheApp                   	       0x104e75a2c AppDelegate.bootstrapMetricSystem() + 9673260 (<compiler-generated>:0)
2   TheApp                   	       0x104e75a90 @objc AppDelegate.bootstrapMetricSystem() + 9673360 (<compiler-generated>:0)
3   TheApp                   	       0x1045531fc -[AppDelegate setUpCrashAnalytics] + 94716 (AppDelegate.m:602)
4   TheApp                   	       0x104550ad8 -[AppDelegate application:didFinishLaunchingWithOptions:] + 84696 (AppDelegate.m:140)
5   UIKitCore                     	       0x1955e3054 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 300
6   UIKitCore                     	       0x1955e278c -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 2848
7   UIKitCore                     	       0x1955e1768 -[UIApplication _runWithMainScene:transitionContext:completion:] + 856
8   UIKitCore                     	       0x1955e13b4 -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 132
9   UIKitCore                     	       0x195329664 _UIScenePerformActionsWithLifecycleActionMask + 112
10  UIKitCore                     	       0x195667850 __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 216
11  UIKitCore                     	       0x195519c5c -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 220
12  UIKitCore                     	       0x195519a84 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 620
13  UIKitCore                     	       0x195519634 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 252
14  UIKitCore                     	       0x195519500 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 148
15  UIKitCore                     	       0x195c06a68 +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:fromCurrentState:actions:completion:] + 736
16  UIKitCore                     	       0x195ca5074 _UISceneSettingsDiffActionPerformChangesWithTransitionContextAndCompletion + 224
17  UIKitCore                     	       0x1953c6c70 -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 316
18  UIKitCore                     	       0x1958381ac __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke.223 + 556
19  UIKitCore                     	       0x195497c60 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 216
20  UIKitCore                     	       0x195497ad0 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 244
21  UIKitCore                     	       0x195497028 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 520
22  UIKitCore                     	       0x195496db4 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 288
23  FrontBoardServices            	       0x1a92a42e4 -[FBSScene _callOutQueue_agent_didCreateWithTransitionContext:completion:] + 344
24  FrontBoardServices            	       0x1a92e4068 __92-[FBSWorkspaceScenesClient createSceneWithIdentity:parameters:transitionContext:completion:]_block_invoke.80 + 120

Thread 5 name:   Dispatch queue: com.ecomnetwork.concurrent (QOS: UNSPECIFIED)
Thread 5:
0   libsystem_kernel.dylib        	       0x1d21dec20 semaphore_wait_trap + 8
1   libdispatch.dylib             	       0x19a6f0448 _dispatch_sema4_wait + 28
2   libdispatch.dylib             	       0x19a6f0afc _dispatch_semaphore_wait_slow + 132
3   TheApp                   	       0x105475d80 UserStatus.currentlyInMainMode() + 15965568 (UserStatus.swift:340)
4   TheApp                   	       0x105475f78 @objc UserStatus.currentlyInMainMode() + 15966072 (<compiler-generated>:0)
5   TheApp                   	       0x104e75348 closure #1 in AppDelegate.initializeRegistrationOfSource() + 9671496 (AppDelegateExtensions.swift:0)
6   APIKit                       	       0x1088a25ac JSONOperation.execute() + 2270636 (JSONOperation.swift:31)
7   APIKit                       	       0x108814184 @objc GroupOperation.start() + 1687940 (<compiler-generated>:0)
8   Foundation                    	       0x18d5111ec __NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION__ + 16

Thread 10 name:  JavaScriptCore libpas scavenger
Thread 10:
0   libsystem_kernel.dylib        	       0x1d21df578 __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x1f3065078 _pthread_cond_wait + 1232
2   JavaScriptCore                	       0x1a6a7bd84 scavenger_thread_main + 1620
3   libsystem_pthread.dylib       	       0x1f305e6b8 _pthread_start + 148
4   libsystem_pthread.dylib       	       0x1f305db88 thread_start + 8

Answered by dmoros in 765042022

This was much easier than I originally thought. Issue turned out to be within our Metrics tracking system.

Accepted Answer

This was much easier than I originally thought. Issue turned out to be within our Metrics tracking system.

TestFlight app always crashing when initially opening app
 
 
Q