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

Pendo SIGABRT #65

Closed Ghamza-Jd closed 1 year ago

Ghamza-Jd commented 1 year ago

Platform + Version iOS 16

SDK Version 2.19.1.6575

Framework Native

Describe the bug

We've been facing crashes on our iOS app from the Pendo library with SIGABRT.

The issue is freeing an unallocated memory.

malloc: *** error for object 0x280f0ce10: pointer being freed was not allocated

Then the system calls abort.

abort() called

Logs

Crashed: com.apple.root.user-initiated-qos.cooperative
0  libsystem_kernel.dylib         0x7578 __pthread_kill + 8
1  libsystem_pthread.dylib        0x7118 pthread_kill + 268
2  libsystem_c.dylib              0x1d178 abort + 180
3  libsystem_malloc.dylib         0x1e0e4 malloc_vreport + 908
4  libsystem_malloc.dylib         0x1e2c8 malloc_report + 64
5  libsystem_malloc.dylib         0x19b70 find_zone_and_free + 308
6  CoreFoundation                 0x13e74 -[__NSArrayM insertObject:atIndex:] + 348
7  Pendo                          0x39a54 -[PNDMutableArray addObject:] + 88
8  Pendo                          0x1246e8 -[PNDTriggersManager addTrackEvent:] + 80
9  Pendo                          0x61b10 +[PNDTrackEventsManager sendTrack:properties:] + 128
10 Pendo                          0x131af8 -[PendoManagerMediator track:properties:] + 244
11 Pendo                          0x15f34 -[PendoManager track:properties:] + 144
...
15 libswift_Concurrency.dylib     0x41948 swift::runJobInEstablishedExecutorContext(swift::Job*) + 416
16 libswift_Concurrency.dylib     0x42868 swift_job_runImpl(swift::Job*, swift::ExecutorRef) + 72
17 libdispatch.dylib              0x15944 _dispatch_root_queue_drain + 396
18 libdispatch.dylib              0x16158 _dispatch_worker_thread2 + 164
19 libsystem_pthread.dylib        0xda0 _pthread_wqthread + 228
20 libsystem_pthread.dylib        0xb7c start_wqthread + 8

Additional context

We're tracking screen views (we're not depending on the out-of-the-box service), and we're tracking some of the features being displayed (we're hiding some features behind a feature flag, so we want to have insights about what is being displayed). When switching between screens, the crash happens. It is inconsistent, but we suspect sending multiple track events simultaneously caused the crash.

MikePendo commented 1 year ago

@Ghamza-Jd Which SDK version do use? is it a native? steps to reproduce? Any chance you can make the bug according to bug format?

Ghamza-Jd commented 1 year ago

Hey @MikePendo, thanks for the response. I have updated the description.

MikePendo commented 1 year ago

@Ghamza-Jd If you updated to the latest SDK will u still have a crash, 2.19 is an old version we have fixed a lot of things since then

Ghamza-Jd commented 1 year ago

Will update and get back if the issue is resolved. Thanks!

Ghamza-Jd commented 1 year ago

I've updated it to version 2.22.1, and we found another issue with initializing the queue. And we couldn't reproduce the first issue

malloc: Incorrect checksum for freed object 0x1070b5480: probably modified after being freed. Corrupt value: 0x0

Crash report:

Crashed: pendo.api.initQueue
0  libsystem_kernel.dylib         0x7198 __pthread_kill + 8
1  libsystem_pthread.dylib        0xd5f8 pthread_kill + 208
2  libsystem_c.dylib              0x1c4b8 abort + 124
3  libsystem_malloc.dylib         0x1d0b8 malloc_vreport + 904
4  libsystem_malloc.dylib         0x1d330 malloc_zone_error + 100
5  libsystem_malloc.dylib         0x1cbf8 free_list_checksum_botch + 36
6  libsystem_malloc.dylib         0x4948 tiny_free_list_add_ptr + 752
7  libsystem_malloc.dylib         0x3a88 tiny_free_no_lock + 916
8  libsystem_malloc.dylib         0x4520 free_tiny + 416
9  CoreFoundation                 0x791b8 __CFStringDeallocate + 192
10 CoreFoundation                 0x77d14 _CFRelease + 324
11 CoreFoundation                 0x7e624 _CFStringCreateWithFormatAndArgumentsReturningMetadata + 252
12 CoreFoundation                 0x7b1b0 _CFStringCreateWithFormatAndArgumentsAux2 + 40
13 Foundation                     0x1924c +[NSString stringWithFormat:] + 64
14 Pendo                          0x13a60c -[PNDAnalyticsMessageManager putSync:] + 820
15 Pendo                          0x64a0c __44+[PNDTrackEventsUtils sendTrack:properties:]_block_invoke + 408
16 libdispatch.dylib              0x637a8 _dispatch_call_block_and_release + 24
17 libdispatch.dylib              0x64780 _dispatch_client_callout + 16
18 libdispatch.dylib              0xa298 _dispatch_lane_serial_drain$VARIANT$mp + 644
19 libdispatch.dylib              0xad70 _dispatch_lane_invoke$VARIANT$mp + 396
20 libdispatch.dylib              0x14dc8 _dispatch_workloop_worker_thread + 632
21 libsystem_pthread.dylib        0x1bd0 _pthread_wqthread + 284
22 libsystem_pthread.dylib        0x1720 start_wqthread + 8
Ghamza-Jd commented 1 year ago

And another one

malloc: Incorrect checksum for freed object 0x1070b5480: probably modified after being freed. Corrupt value: 0x0
Crashed: com.apple.main-thread
0  libsystem_kernel.dylib         0x7198 __pthread_kill + 8
1  libsystem_pthread.dylib        0xd5f8 pthread_kill + 208
2  libsystem_c.dylib              0x1c4b8 abort + 124
3  libsystem_malloc.dylib         0x1d0b8 malloc_vreport + 904
4  libsystem_malloc.dylib         0x1d330 malloc_zone_error + 100
5  libsystem_malloc.dylib         0x10654 nanov2_guard_corruption_detected + 40
6  libsystem_malloc.dylib         0xeb00 nanov2_allocate_outlined + 356
7  libobjc.A.dylib                0x5724 _objc_rootAllocWithZone + 36
8  UIKitCore                      0x41a954 -[UITraitCollection _traitCollectionRelevantForImageConfiguration] + 168
9  UIKitCore                      0x3ce90 -[UIImageConfiguration _initWithTraitCollection:] + 72
10 UIKitCore                      0x3cbc4 -[UITraitCollection imageConfiguration] + 52
11 UIKitCore                      0x92b00 -[UIImageView _symbolConfigurationForImage:] + 476
12 UIKitCore                      0x58bc4 -[UIImageView tintColorDidChange] + 256
13 UIKitCore                      0x5899c -[UIView _tintColorDidChange] + 164
14 UIKitCore                      0x58868 -[_UITintColorVisitor _visitView:] + 328
15 UIKitCore                      0x585cc _UIViewVisitorRecursivelyEntertainDescendingVisitors + 216
16 UIKitCore                      0x58674 _UIViewVisitorRecursivelyEntertainDescendingVisitors + 384
17 UIKitCore                      0x58674 _UIViewVisitorRecursivelyEntertainDescendingVisitors + 384
18 UIKitCore                      0x58674 _UIViewVisitorRecursivelyEntertainDescendingVisitors + 384
19 UIKitCore                      0x58674 _UIViewVisitorRecursivelyEntertainDescendingVisitors + 384
20 UIKitCore                      0x58674 _UIViewVisitorRecursivelyEntertainDescendingVisitors + 384
21 UIKitCore                      0x58674 _UIViewVisitorRecursivelyEntertainDescendingVisitors + 384
22 UIKitCore                      0x1e16c _UIViewVisitorEntertainDescendingTrackingVisitors + 564
23 UIKitCore                      0xc7634 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 232
24 UIKitCore                      0xf5b554 -[UIView _postMovedFromSuperview:] + 596
25 UIKitCore                      0x1d090 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1948
26 UIKitCore                      0x1a52fc +[UIViewControllerWrapperView wrapperViewForView:wrapperFrame:viewFrame:] + 252
27 UIKitCore                      0xb98bc -[UITabBarController _wrapperViewForViewController:] + 140
28 UIKitCore                      0x1eb024 -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 952
29 UIKitCore                      0x1eab98 -[UITabBarController _setSelectedViewController:] + 308
30 UIKitCore                      0x3092c -[UITabBarController setSelectedViewController:] + 80
31 UIKitCore                      0x70a514 -[UITabBarController _setSelectedViewControllerAndNotify:] + 424
32 UIKitCore                      0x70a358 -[UITabBarController _tabBarItemClicked:] + 44
33 UIKitCore                      0x22e764 -[UIApplication sendAction:to:from:forEvent:] + 96
34 Pendo                          0x6f554 __53+[PNDHookFunctions ret_BOOL_args_SelIdIdId_WithHook:]_block_invoke + 368
35 UIKitCore                      0x629bc0 -[UITabBar _sendAction:withEvent:] + 388
36 UIKitCore                      0x22e764 -[UIApplication sendAction:to:from:forEvent:] + 96
37 Pendo                          0x6f554 __53+[PNDHookFunctions ret_BOOL_args_SelIdIdId_WithHook:]_block_invoke + 368
38 UIKitCore                      0x22e484 -[UIControl sendAction:to:forEvent:] + 108
39 UIKitCore                      0x22de8c -[UIControl _sendActionsForEvents:withEvent:] + 268
40 UIKitCore                      0x62a92c -[UITabBar _buttonUp:] + 96
41 UIKitCore                      0x22e764 -[UIApplication sendAction:to:from:forEvent:] + 96
42 Pendo                          0x6f554 __53+[PNDHookFunctions ret_BOOL_args_SelIdIdId_WithHook:]_block_invoke + 368
43 UIKitCore                      0x22e484 -[UIControl sendAction:to:forEvent:] + 108
44 UIKitCore                      0x22de8c -[UIControl _sendActionsForEvents:withEvent:] + 268
45 UIKitCore                      0x22d944 -[UIControl touchesEnded:withEvent:] + 396
46 UIKitCore                      0xeeb18 -[UIWindow _sendTouchesForEvent:] + 1036
47 UIKitCore                      0xede2c -[UIWindow sendEvent:] + 3224
48 UIKitCore                      0xed118 -[UIApplication sendEvent:] + 744
49 UIKitCore                      0xeb38c __dispatchPreprocessedEventFromEventQueue + 1980
50 UIKitCore                      0x130d58 __processEventQueue + 5556
51 UIKitCore                      0xcdd30c updateCycleEntry + 156
52 UIKitCore                      0x5f778c _UIUpdateSequenceRun + 76
53 UIKitCore                      0xbf0354 schedulerStepScheduledMainSection + 140
54 UIKitCore                      0xbef8cc runloopSourceCallback + 80
55 CoreFoundation                 0xc9154 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
56 CoreFoundation                 0xd4dc8 __CFRunLoopDoSource0 + 172
57 CoreFoundation                 0x60044 __CFRunLoopDoSources0 + 232
58 CoreFoundation                 0x751b8 __CFRunLoopRun + 784
59 CoreFoundation                 0x79da0 CFRunLoopRunSpecific + 584
60 GraphicsServices               0x1998 GSEventRunModal + 160
61 UIKitCore                      0x37180c -[UIApplication _run] + 868
62 UIKitCore                      0x371484 UIApplicationMain + 312
63 Proximie                       0x58afd4 main + 15 (AppDelegate.swift:15)
64 ???                            0x1cdbe8344 (Missing)
MikePendo commented 1 year ago

@Ghamza-Jd Very strange we didnt get any complains from other customers yet. So now you see 2 different crashes. Let's have it more organized. Could you please open 2 different issues with those 2 different crashes. (any chance you could add a full apple crash log, it might have some additional Info that can help us) Regarding the last crash I don't think it's related to Pendo (I might be wrong). Yes, we see Pendo in the stack trace as we use swizzling BUT the call is propagated further to apple methods without any issue, and the issue happens in the end. If you remove Pendo will u be able to reproduce the last crash?

Ghamza-Jd commented 1 year ago

Sure, I will open two other issues, remove Pendo, and check if the app crashes. First Issue Thanks!