pendo-io / pendo-mobile-sdk

Pendo captures product usage data, gathers user feedback, and lets you communicate in-app to onboard, educate, and guide users to value
https://www.pendo.io
Other
57 stars 2 forks source link

Crash on 3.1.0 on iPadOS on `deepUnwrap()` #117

Closed msrutek-paylocity closed 4 months ago

msrutek-paylocity commented 4 months ago

Platform + Version

iPadOS 17.1.0 (iPad Pro (11-inch, 3rd generation))

SDK Version

3.1.0

Framework

Native

Describe the bug

Crash on Pendo's deepUnwrap().

Screenshot 2024-03-01 at 15 08 35
Crashed: com.apple.main-thread
0  libswiftCore.dylib             0x37c70c <redacted> + 196
1  libswiftCore.dylib             0x37c8fc <redacted> + 692
2  libswiftCore.dylib             0x428fc $ss27_bridgeAnythingToObjectiveCyyXlxlF + 224
3  Pendo                          0x1384d8 deepUnwrap(_:) + 5056
4  Pendo                          0x121c98 static DumpNode.makeNode(name:value:parent:depth:_:) + 13216
5  Pendo                          0x12f9d8 DumpTree._scan_children(children:parent:visitedItems:depth:maxDepth:) + 9736
6  Pendo                          0x12f7e8 DumpTree._dump(_:maxDepth:visitedItems:parent:depth:superClassScanEnable:) + 9240
7  Pendo                          0x12faa0 DumpTree._scan_children(children:parent:visitedItems:depth:maxDepth:) + 9936
8  Pendo                          0x12f7e8 DumpTree._dump(_:maxDepth:visitedItems:parent:depth:superClassScanEnable:) + 9240
9  Pendo                          0x12faa0 DumpTree._scan_children(children:parent:visitedItems:depth:maxDepth:) + 9936
10 Pendo                          0x12f7e8 DumpTree._dump(_:maxDepth:visitedItems:parent:depth:superClassScanEnable:) + 9240
11 Pendo                          0x12faa0 DumpTree._scan_children(children:parent:visitedItems:depth:maxDepth:) + 9936
12 Pendo                          0x12f7e8 DumpTree._dump(_:maxDepth:visitedItems:parent:depth:superClassScanEnable:) + 9240
13 Pendo                          0x12faa0 DumpTree._scan_children(children:parent:visitedItems:depth:maxDepth:) + 9936
14 Pendo                          0x12f7e8 DumpTree._dump(_:maxDepth:visitedItems:parent:depth:superClassScanEnable:) + 9240
15 Pendo                          0x12f040 DumpTree.makeRoot(value:name:) + 7280
16 Pendo                          0x1323b0 specialized static DumpTree.pnd_dump(value:parentValue:name:indent:maxDepth:printingOptions:descriptionLength:pruneEnabled:) + 20448
17 Pendo                          0x12f230 @objc static DumpTree.pnd_dump(value:parentValue:name:indent:maxDepth:printingOptions:descriptionLength:pruneEnabled:) + 7776
18 Pendo                          0x131bd0 specialized static DumpTree.pnd_dump(topMostController:topMostControllerCoversScreen:name:indent:maxDepth:printingOption:descriptionLength:pruneEnabled:enableSwiftUIInsideUIKitScan:) + 18432
19 Pendo                          0x12ed98 @objc static DumpTree.pnd_dump(topMostController:topMostControllerCoversScreen:name:indent:maxDepth:printingOption:descriptionLength:pruneEnabled:enableSwiftUIInsideUIKitScan:) + 6600
20 Pendo                          0x118764 -[PNDScreenManager swiftUIDataAppend:fromWindow:rootViewController:] + 732
21 Pendo                          0x1180ac -[PNDScreenManager screenDataFor:] + 216
22 Pendo                          0x117dcc -[PNDScreenManager screenChanged] + 56
23 Pendo                          0x1177a8 __44-[PNDScreenManager triggerScreenScanOfType:]_block_invoke.48 + 508
24 Pendo                          0x10a298 -[PNDDebouncer fireNow] + 36
25 Foundation                     0x71a3d4 __NSFireTimer + 96
26 CoreFoundation                 0x8a964 <redacted> + 32
27 CoreFoundation                 0x8a60c <redacted> + 972
28 CoreFoundation                 0x89c38 <redacted> + 288
29 CoreFoundation                 0x83d60 <redacted> + 1856
30 CoreFoundation                 0x831f4 CFRunLoopRunSpecific + 608
31 GraphicsServices               0x655c GSEventRunModal + 164
32 UIKitCore                      0xcf0da4 <redacted> + 888
33 UIKitCore                      0xcf57c0 UIApplicationMain + 340
34 REDACTED                       0x961c main + 9 (AppDelegate.swift:9)
35 ???                            0x22c7ed8e0 (Missing)

To Reproduce

🤷 yet unknown

Expected behavior

No crash.

MikePendo commented 4 months ago

@msrutek-paylocity can you please verify you indeed on latest 3.1.0.8165 as we fixed that exact crash. Do you have the app available on Appstore that we can try? (as we I am pretty sure that crash was fixed)

msrutek-paylocity commented 4 months ago

@MikePendo

Can you please verify you indeed on latest 3.1.0.8165 as we fixed that exact crash.

Inspecting the production ipa file, we see that Pendo.framework contains (among other things)

<key>CFBundleShortVersionString</key>
<string>3.1.0</string>
<key>CFBundleVersion</key>
<string>8165</string>
<key>PNDBundleVersion</key>
<string>8165</string>

So we believe we're on the latest build.

Do you have the app available on Appstore that we can try?

Yes, we do - https://apps.apple.com/us/app/paylocity/id652438572

MikePendo commented 4 months ago

@MaximShnirman Can you please look in to it, I more than sure we have released that fix

msrutek-paylocity commented 4 months ago

Curiously enough, we only see the crashes on the 3.1.0 version, while our setup has not changed. 🤔

@MikePendo @MaximShnirman did you have time to look at this? It is affecting our production users and would be great if we could ship a fix soon.

MikePendo commented 4 months ago

@msrutek-paylocity if we provide you a custom SDK would you be able to verify that you dont have the crash any more?

msrutek-paylocity commented 4 months ago

@MikePendo yes, but it might take some time until we roll it out and see if there are no more crashes.

MikePendo commented 4 months ago

@msrutek-paylocity do you have specific page where the crash happens? is I the crash reproducible (can we reproduce it)? (or you just see it on firebase)

msrutek-paylocity commented 4 months ago

@MikePendo We don't have a specific steps to reproduce yet. However, in all of the cases, the crash occurs very early in the app lifecycle.

Looking at the timeframe, we can see that the app gets to run for only about ~0.3 seconds before crashing.

Screenshot 2024-03-06 at 15 44 12

This makes us think - could calling Pendo's track(_:properties:) from different threads cause the deepUnwrap() failure?

MikePendo commented 4 months ago

@msrutek-paylocity So I tried to reproduce the crash but I cant login in to the app, so I can test only the first pages. We will release a HF next week that will fix 2 crashes we had discovered. I have tried to register with my SSN but it didnt let me. any idea ho I can pass to the actual app? do you know if the crash happened for the login users ? (deepWarap() method get called on screen change it doesnt relater to track event.)

shlomipendo commented 4 months ago

@msrutek-paylocity Hey, at this point, is it possible to open the issue with Pendo support with all of the information you have? This will help us to prioritize the investigation work on it.

msrutek-paylocity commented 4 months ago

@MikePendo

We will release a HF next week that will fix 2 crashes we had discovered.

Looking forward to that!

I have tried to register with my SSN but it didnt let me. any idea ho I can pass to the actual app?

You'd need to be assigned to a company. We'll send over test credentials via the support ticket @shlomipendo if that's needed.

do you know if the crash happened for the login users ?

Yes, it looks like at least one of the crashes happened for a user that had just installed the app and opened it for the first time.

(deepUnwrap() method get called on screen change it doesnt relater to track event.)

@MikePendo this leads me to another question - what if we have set up similar to the following

struct App: View {
    var body: some View {
        Group {
            // dynamic content that can rapidly change for whatever reason
        }
        .pendoEnableSwiftUI()
    }
}

could the rapidly chaning content cause the issue with deepUnwrap()? 🤔

MikePendo commented 4 months ago

@msrutek-paylocity .pendoEnableSwiftUI() is redundant (since 3.1)you can remove it. (not related to the crash, we updated the docs) we will release the new sdk early next week. Any chance firebase shows you on which page the crash happened? (when we will have access we can just have more load tests on that page) In firebase can we make sure that the crash happened on the app production version that indeed has the 3.1 sdk. (There is also a good chance the crash will be resolved by new release, but I would like to indeed make sure it is solved)

msrutek-paylocity commented 4 months ago

Any chance firebase shows you on which page the crash happened?

Unfortunately, we weren't able to deduce that information. But it appears to be very early in the app lifecycle - so it might be a second or third SwiftUI View that's been shown to the user - without any real interaction for the user's part.

In firebase can we make sure that the crash happened on the app production version that indeed has the 3.1 sdk.

Checked once again, this happens on our build 4738 - which is the latest version currently available in the AppStore - and does indeed contain Pendo 3.1.0, build number 8165.

MikePendo commented 4 months ago

@msrutek-paylocity 3.1.1 sdk was just released, 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.

msrutek-paylocity commented 4 months ago

@MikePendo Thank you. If the crashes continue, we'll open another issue.