pendo-io/pendo-mobile-sdk

Crash on Vision Pro when running setup

Closed this issue · 4 comments

Platform + Version
iPadOS/VisionOS (iPad apps run in VisionOS seem to identify as iPadOS)

SDK Version
3.1.0.8165

Framework
Native SwiftUI

Describe the bug
As soon as PendoManager.shared.setup(<key>) is called the app crashes

To Reproduce

  1. From Xcode build existing app that has iPadOS build to VisionOS simulator
  2. Run app and navigate to point where code calls PendoManager.shared.setup(<key>) (probably on startup)
  3. Crash

Expected behavior
App doesn't crash (verified that commenting out .setup() stops crashing)

Logs

# Crashlytics - Stack trace
# Application: com.myapp.appdev
# Platform: apple
# Version: 24.03.04 (4262)
# Issue: d3299578874b69b71663321c087aec25
# Session: 52dbf281df444bd6b2d6051286588f2d_DNE_0_v2
# Date: Fri Mar 08 2024 13:17:08 GMT+0000 (Greenwich Mean Time)

Crashed: com.apple.main-thread
0  libswiftCore.dylib             0x37f3b0 _swift_buildDemanglingForMetadata + 48
1  libswiftCore.dylib             0x37ff18 _swift_buildDemanglingForMetadata + 2968
2  libswiftCore.dylib             0x37aee0 <redacted> + 500
3  libswiftCore.dylib             0x37b3bc swift_getTypeName + 412
4  libswiftCore.dylib             0x18653c <redacted> + 56
5  libswiftCore.dylib             0x1856d4 <redacted> + 2048
6  libswiftCore.dylib             0x12a224 $sSS10describingSSx_tclufC + 2144
7  Pendo                          0x156300 -[PNDBindingManager .cxx_destruct] + 11300
8  Pendo                          0x153a30 -[PNDBindingManager .cxx_destruct] + 852
9  Pendo                          0x1645d0 __swift_instantiateConcreteTypeFromMangledName + 4548
10 Pendo                          0x164650 __swift_instantiateConcreteTypeFromMangledName + 4676
11 Pendo                          0x164650 __swift_instantiateConcreteTypeFromMangledName + 4676
12 Pendo                          0x164650 __swift_instantiateConcreteTypeFromMangledName + 4676
13 Pendo                          0x164650 __swift_instantiateConcreteTypeFromMangledName + 4676
14 Pendo                          0x166ed0 __swift_instantiateConcreteTypeFromMangledName + 15044
15 Pendo                          0x164134 __swift_instantiateConcreteTypeFromMangledName + 3368
16 Pendo                          0x1667cc __swift_instantiateConcreteTypeFromMangledName + 13248
17 Pendo                          0x163fcc __swift_instantiateConcreteTypeFromMangledName + 3008
18 Pendo                          0x14c928 -[PNDScreenManager swiftUIDataAppend:fromWindow:rootViewController:] + 856
19 Pendo                          0x14c154 -[PNDScreenManager screenDataFor:] + 272
20 Pendo                          0x14bdb4 -[PNDScreenManager screenChanged] + 72
21 Pendo                          0x14b6c0 __44-[PNDScreenManager triggerScreenScanOfType:]_block_invoke.122 + 580
22 Pendo                          0x13b690 -[PNDDebouncer fireNow] + 44
23 Foundation                     0x71a3d4 __NSFireTimer + 96
24 CoreFoundation                 0x8a964 <redacted> + 32
25 CoreFoundation                 0x8a60c <redacted> + 972
26 CoreFoundation                 0x89c38 <redacted> + 288
27 CoreFoundation                 0x83d60 <redacted> + 1856
28 CoreFoundation                 0x831f4 CFRunLoopRunSpecific + 608
29 GraphicsServices               0x655c GSEventRunModal + 164
30 UIKitCore                      0xcf0da4 <redacted> + 888
31 UIKitCore                      0xcf57c0 UIApplicationMain + 340
32 MyApp                          0x3ce440 main + 15 (AppDelegate.swift:15)
33 ???                            0x22987d8e0 (Missing)

Thread
0  libsystem_kernel.dylib         0x701c __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x30b8 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0xa5c0 start_wqthread + 8

Thread
0  libsystem_kernel.dylib         0x701c __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x30b8 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0xa5c0 start_wqthread + 8

pendo.api.initQueue
0  libsystem_kernel.dylib         0x6df4 __ulock_wait + 8
1  libdispatch.dylib              0x5ac4 <redacted> + 56
2  libdispatch.dylib              0x5e70 <redacted> + 56
3  Pendo                          0x761c8 -[PendoAPI initAgainstServerWithSession:] + 188
4  Pendo                          0x756c4 -[PendoAPI runBlock:onQueueIfNeeded:] + 104
5  Pendo                          0x7604c -[PendoAPI initSDKWithParams:initWithoutVisitor:] + 1624
6  Pendo                          0x1368d0 __68-[PendoManagerMediator initSDK:withParams:shouldInitWithoutVisitor:]_block_invoke + 5000
7  libdispatch.dylib              0x347c <redacted> + 32
8  libdispatch.dylib              0x50d4 <redacted> + 20
9  libdispatch.dylib              0xc668 <redacted> + 748
10 libdispatch.dylib              0xd198 <redacted> + 380
11 libdispatch.dylib              0x17dd8 <redacted> + 288
12 libdispatch.dylib              0x1764c <redacted> + 404
13 libsystem_pthread.dylib        0x306c _pthread_wqthread + 288
14 libsystem_pthread.dylib        0xa5c0 start_wqthread + 8

Thread
0  libsystem_kernel.dylib         0x701c __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x30b8 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0xa5c0 start_wqthread + 8

Thread
0  libsystem_kernel.dylib         0x701c __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x30b8 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0xa5c0 start_wqthread + 8

com.google.fira.worker
0  libsystem_kernel.dylib         0x927c stat + 8
1  libsqlite3.dylib               0x186f0 sqlite3_finalize + 8588
2  libsqlite3.dylib               0x158830 sqlite3_sourceid + 824284
3  libsqlite3.dylib               0x18014 sqlite3_finalize + 6832
4  libsqlite3.dylib               0x17394 sqlite3_finalize + 3632
5  libsqlite3.dylib               0x2ef7c sqlite3_step + 7116
6  libsqlite3.dylib               0x2d788 sqlite3_step + 984
7  MyApp                          0x86cbf8 -[APMSqliteStore columnsForTableWithName:error:] + 4320332792
8  MyApp                          0x86c4e0 -[APMSqliteStore validateTableWithName:requiredColumnNames:addOnColumns:error:] + 4320330976
9  MyApp                          0x86c0a0 -[APMSqliteStore ensureTableWithName:createSQL:requiredColumnNames:addOnColumns:error:] + 4320329888
10 MyApp                          0x86b558 -[APMSqliteStore ensureTableWithName:elementaryColumnInfo:addOnColumnInfo:error:] + 4320327000
11 MyApp                          0x86bcc0 -[APMSqliteStore ensureTableWithName:elementaryColumnInfo:addOnColumnInfo:modifyColumnInfo:error:] + 4320328896
12 MyApp                          0x7efae0 -[APMDatabase ensureAllTables] + 4319820512
13 MyApp                          0x7ee780 -[APMDatabase initializeDatabaseResourcesWithContext:databasePath:error:] + 4319815552
14 MyApp                          0x7e6078 -[APMDatabase initWithDatabaseName:persistedConfig:error:] + 4319780984
15 MyApp                          0x80e31c __47-[APMMeasurement startMeasurementOnWorkerQueue]_block_invoke + 4319945500
16 MyApp                          0x80df98 -[APMMeasurement startMeasurementOnWorkerQueue] + 4319944600
17 MyApp                          0x80d864 -[APMMeasurement setEnabledOnWorkerQueue:] + 4319942756
18 MyApp                          0x80d77c __29-[APMMeasurement setEnabled:]_block_invoke + 4319942524
19 MyApp                          0x865044 __51-[APMScheduler scheduleOnWorkerQueueBlockID:block:]_block_invoke + 4320301124
20 libdispatch.dylib              0x347c <redacted> + 32
21 libdispatch.dylib              0x50d4 <redacted> + 20
22 libdispatch.dylib              0xc668 <redacted> + 748
23 libdispatch.dylib              0xd198 <redacted> + 380
24 libdispatch.dylib              0x17dd8 <redacted> + 288
25 libdispatch.dylib              0x1764c <redacted> + 404
26 libsystem_pthread.dylib        0x306c _pthread_wqthread + 288
27 libsystem_pthread.dylib        0xa5c0 start_wqthread + 8

com.apple.uikit.eventfetch-thread
0  libsystem_kernel.dylib         0x44c8 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0xc1f8 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0xc48c mach_msg_overwrite + 436
3  libsystem_kernel.dylib         0xc2cc mach_msg + 24
4  CoreFoundation                 0x89a18 <redacted> + 160
5  CoreFoundation                 0x83ad8 <redacted> + 1208
6  CoreFoundation                 0x831f4 CFRunLoopRunSpecific + 608
7  Foundation                     0x6f17a4 <redacted> + 212
8  Foundation                     0x6f19d4 <redacted> + 64
9  UIKitCore                      0xda7eec <redacted> + 420
10 Foundation                     0x7182d0 <redacted> + 716
11 libsystem_pthread.dylib        0x1190 _pthread_start + 136
12 libsystem_pthread.dylib        0xa5cc thread_start + 8

Thread
0  libsystem_kernel.dylib         0x701c __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x30b8 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0xa5c0 start_wqthread + 8

com.google.firebase.crashlytics.MachExceptionServer
0  MyApp                          0x489518 FIRCLSProcessRecordAllThreads + 393 (FIRCLSProcess.c:393)
1  MyApp                          0x4898f8 FIRCLSProcessRecordAllThreads + 424 (FIRCLSProcess.c:424)
2  MyApp                          0x49734c FIRCLSHandler + 34 (FIRCLSHandler.m:34)
3  MyApp                          0x497b50 FIRCLSMachExceptionServer + 521 (FIRCLSMachException.c:521)
4  libsystem_pthread.dylib        0x1190 _pthread_start + 136
5  libsystem_pthread.dylib        0xa5cc thread_start + 8

Thread
0  libsystem_kernel.dylib         0x701c __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x30b8 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0xa5c0 start_wqthread + 8

com.apple.root.user-initiated-qos
0  libsystem_kernel.dylib         0x6df4 __ulock_wait + 8
1  libdispatch.dylib              0x5ac4 <redacted> + 56
2  libdispatch.dylib              0x5e70 <redacted> + 56
3  Pendo                          0x97140 -[PendoAPIHelper getAccessTokenFromServer:error:] + 1544
4  Pendo                          0x97630 -[PendoAPIHelper getAccessTokenFromServer:error:] + 2808
5  Pendo                          0x96558 __33-[PendoAPIHelper getAccessToken:]_block_invoke + 80
6  libdispatch.dylib              0x347c <redacted> + 32
7  libdispatch.dylib              0x50d4 <redacted> + 20
8  libdispatch.dylib              0x16b90 <redacted> + 864
9  libdispatch.dylib              0x171c0 <redacted> + 156
10 libsystem_pthread.dylib        0x3030 _pthread_wqthread + 228
11 libsystem_pthread.dylib        0xa5c0 start_wqthread + 8

Thread
0  libsystem_pthread.dylib        0xa5b8 <redacted> + 6

Thread
0  libsystem_kernel.dylib         0x701c __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x30b8 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0xa5c0 start_wqthread + 8

Thread
0  libsystem_kernel.dylib         0x701c __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x30b8 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0xa5c0 start_wqthread + 8

com.apple.NSURLConnectionLoader
0  libsystem_kernel.dylib         0x44c8 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0xc1f8 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0xc48c mach_msg_overwrite + 436
3  libsystem_kernel.dylib         0xc2cc mach_msg + 24
4  CoreFoundation                 0x89a18 <redacted> + 160
5  CoreFoundation                 0x83ad8 <redacted> + 1208
6  CoreFoundation                 0x831f4 CFRunLoopRunSpecific + 608
7  CFNetwork                      0x25aa28 _CFURLStorageSessionDisableCache + 69136
8  Foundation                     0x7182d0 <redacted> + 716
9  libsystem_pthread.dylib        0x1190 _pthread_start + 136
10 libsystem_pthread.dylib        0xa5cc thread_start + 8

com.apple.SwiftUI.AsyncRenderer
0  libsystem_kernel.dylib         0x44c8 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0xc1f8 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0xc48c mach_msg_overwrite + 436
3  libsystem_kernel.dylib         0xc2cc mach_msg + 24
4  CoreFoundation                 0x89a18 <redacted> + 160
5  CoreFoundation                 0x83ad8 <redacted> + 1208
6  CoreFoundation                 0x831f4 CFRunLoopRunSpecific + 608
7  Foundation                     0x6f17a4 <redacted> + 212
8  Foundation                     0x6f1980 <redacted> + 64
9  SwiftUI                        0x87d79c <redacted> + 23832
10 SwiftUI                        0x87d8d0 <redacted> + 24140
11 Foundation                     0x7182d0 <redacted> + 716
12 libsystem_pthread.dylib        0x1190 _pthread_start + 136
13 libsystem_pthread.dylib        0xa5cc thread_start + 8

Sample Code
n/a

Additional context
Works fine in iPadOS (and iOS) natively

@benjamin-es-hall
We will release a fix for it early next week

@benjamin-es-hall
maybe you have some small sample project we could try on our side to reproduce it with exact same crash trace?

@benjamin-es-hall
3.1.1 sdk was just release, please note we didnt managed reproduce the exact stack trace of you crash.
We discovered a similar crash to yours that seems to be the root cause.
If you have any sample project you want us to try or exact scenario on you app please share

@MikePendo I tried creating a new app that purely called setup but it wouldn't crash. I'm thinking it may have been due to new app having pure SwiftUI entry point where in our actual app it is still going through App/Scene delegate.

However I tested 3.1.1 and the issue seems to be resolved! Thank you for the speedy work!