Appboy / appboy-ios-sdk

Public repo for the Braze iOS SDK
https://www.braze.com
Other
165 stars 142 forks source link

Crash in `ABKPersistentData.m line 329` #219

Closed mathaeus closed 4 years ago

mathaeus commented 4 years ago

-[ABKPersistentData synchronizeDataToUserDefaults:] crashes. Only happened a handful of times from what I can see. Please have a look nevertheless. Thx.

SDK version 3.21.1. I had a look at 3.21.2 and 3.21.3. No mentioning of this being fixed there.

Model: iPhone 6s
Orientation: Face Up
RAM free: 80.63 MB
Disk free: 599.52 MB
Operating System
Version: 12.3.1 (16F203)
Orientation: Portrait
Jailbroken: No
Crashed: NSOperationQueue 0x282c54260 (QOS: UNSPECIFIED)
0  libobjc.A.dylib                0x23120fbf0 objc_retain + 16
1  CoreFoundation                 0x23204b5d0 CFBasicHashCreateCopy + 784
2  CoreFoundation                 0x231f7b63c CFDictionaryCreateCopy + 128
3  CoreFoundation                 0x232055134 __40-[_CFXPreferences synchronizeEverything]_block_invoke + 32
4  CoreFoundation                 0x231f14ae4 -[_CFXPreferences(SourceAdditions) withSources:] + 92
5  CoreFoundation                 0x231f15b50 -[_CFXPreferences synchronizeEverything] + 104
6  CoreFoundation                 0x23205a3c4 _CFPrefsSynchronizeForProcessTermination + 84
7  Foundation                     0x23297724c -[NSUserDefaults(NSUserDefaults) synchronize] + 64
8  Appboy_iOS_SDK                 0x101f34220 -[ABKPersistentData synchronizeDataToUserDefaults:] + 329 (ABKPersistentData.m:329)
9  CoreFoundation                 0x232024900 __invoking___ + 144
10 CoreFoundation                 0x231f064d0 -[NSInvocation invoke] + 292
11 Foundation                     0x2329d8cc4 -[NSInvocationOperation main] + 40
12 Foundation                     0x23298d8c8 -[__NSOperationInternal _start:] + 740
13 Foundation                     0x232a83c7c __NSOQSchedule_f + 272
14 libdispatch.dylib              0x231a5ca38 _dispatch_call_block_and_release + 24
15 libdispatch.dylib              0x231a5d7d4 _dispatch_client_callout + 16
16 libdispatch.dylib              0x231a02018 _dispatch_continuation_pop$VARIANT$mp + 412
17 libdispatch.dylib              0x231a016dc _dispatch_async_redirect_invoke + 600
18 libdispatch.dylib              0x231a0e02c _dispatch_root_queue_drain + 372
19 libdispatch.dylib              0x231a0e8d0 _dispatch_worker_thread2 + 128
20 libsystem_pthread.dylib        0x231c3d1b4 _pthread_wqthread + 464
21 libsystem_pthread.dylib        0x231c3fcd4 start_wqthread + 4
hokstuff commented 4 years ago

Hi @mathaeus,

Thanks for filing this issue with the details and stack trace. We are looking into it and tracking internally - thanks!

Best, Daniel

hokstuff commented 4 years ago

I'm closing out this public issue since we are looking at it internally. Please add any additional information that would help with the investigation as you come across it - thank you!

mathaeus commented 4 years ago

Hi @hokstuff

Another crash with a somewhat different stack trace.

Crashed: NSOperationQueue 0x129da5270 (QOS: UNSPECIFIED)
0  libobjc.A.dylib                0x1b6b28140 objc_release + 16
1  Foundation                     0x1b7193284 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKeys:count:maybeOldValuesDict:maybeNewValuesDict:usingBlock:] + 644
2  Foundation                     0x1b70e3aa0 -[NSObject(NSKeyValueObservingPrivate) _notifyObserversOfChangeFromValuesForKeys:toValuesForKeys:] + 808
3  CoreFoundation                 0x1b6cce39c -[CFPrefsSource forEachObserver:] + 312
4  CoreFoundation                 0x1b6ccfd54 -[CFPrefsSource _notifyObserversOfChangeFromValuesForKeys:toValuesForKeys:] + 92
5  CoreFoundation                 0x1b6e1f5a8 ___CFPrefsDeliverPendingKVONotificationsGuts_block_invoke + 432
6  CoreFoundation                 0x1b6d2df44 __CFDictionaryApplyFunction_block_invoke + 24
7  CoreFoundation                 0x1b6e072f8 CFBasicHashApply + 136
8  CoreFoundation                 0x1b6d2dee4 CFDictionaryApplyFunction + 184
9  CoreFoundation                 0x1b6e1b77c _CFPrefsDeliverPendingKVONotificationsGuts + 260
10 CoreFoundation                 0x1b6e1b65c -[_CFXPreferences _deliverPendingKVONotifications] + 88
11 CoreFoundation                 0x1b6d4fadc __108-[_CFXPreferences(SearchListAdditions) withSearchListForIdentifier:container:cloudConfigurationURL:perform:]_block_invoke + 412
12 CoreFoundation                 0x1b6d4f350 normalizeQuintuplet + 356
13 CoreFoundation                 0x1b6cbf570 -[_CFXPreferences(SearchListAdditions) withSearchListForIdentifier:container:cloudConfigurationURL:perform:] + 124
14 CoreFoundation                 0x1b6cc2628 -[_CFXPreferences setValue:forKey:appIdentifier:container:configurationURL:] + 108
15 CoreFoundation                 0x1b6e1d9f0 _CFPreferencesSetAppValueWithContainerAndConfiguration + 132
16 Foundation                     0x1b70de670 -[NSUserDefaults(NSUserDefaults) setObject:forKey:] + 64
17 Freeletics                     0x1014449b8 -[ABKPersistentData synchronizeDataToUserDefaults:] + 348 (ABKPersistentData.m:348)
18 CoreFoundation                 0x1b6decc20 __invoking___ + 144
19 CoreFoundation                 0x1b6cbcd30 -[NSInvocation invoke] + 300
20 Foundation                     0x1b70feaa0 -[NSInvocationOperation main] + 44
21 Foundation                     0x1b71ad628 __NSOPERATION_IS_INVOKING_MAIN__ + 20
22 Foundation                     0x1b70b4d60 -[NSOperation start] + 732
23 Foundation                     0x1b71ae020 __NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION__ + 20
24 Foundation                     0x1b71adaec __NSOQSchedule_f + 180
25 libdispatch.dylib              0x1b6a657dc _dispatch_block_async_invoke2 + 104
26 libdispatch.dylib              0x1b6ab3184 _dispatch_client_callout + 16
27 libdispatch.dylib              0x1b6a5ba3c _dispatch_continuation_pop$VARIANT$mp + 412
28 libdispatch.dylib              0x1b6a5b190 _dispatch_async_redirect_invoke + 600
29 libdispatch.dylib              0x1b6a67fa4 _dispatch_root_queue_drain + 376
30 libdispatch.dylib              0x1b6a68770 _dispatch_worker_thread2 + 128
31 libsystem_pthread.dylib        0x1b6b02b48 _pthread_wqthread + 212
32 libsystem_pthread.dylib        0x1b6b05760 start_wqthread + 8
Model: iPhone 6s
Version: 13.3.1 (17D50)
mathaeus commented 4 years ago

Hi @hokstuff, another one with a slightly different stack trace. Have you already fixed this issue? This one's about: [ABKPersistentData(DataVersioning) persistMostRecentSdkVersion]

Crashed: NSOperationQueue 0x103d08a30 (QOS: UNSPECIFIED)
0  libobjc.A.dylib                0x1823541a0 objc_retain + 16
1  CoreFoundation                 0x1831c5b50 +[__NSArrayI __new::::] + 184
2  CoreFoundation                 0x18304b514 -[NSArray initWithArray:range:copyItems:] + 464
3  UIKit                          0x18cd0fa20 +[_UICanvas canvases] + 32
4  UIKit                          0x18cd0f958 +[_UIApplicationCanvas canvases] + 52
5  UIKit                          0x18cd0f8bc +[_UIApplicationCanvas mostActiveCanvas] + 28
6  UIKit                          0x18cd0f86c -[UIApplication isSuspended] + 32
7  UIKit                          0x18d050780 UpdateSystemSoundActiveStatus + 72
8  UIKit                          0x18d05092c IsSystemSoundEnabled + 104
9  UIKit                          0x18d050760 UpdateSystemSoundActiveStatus + 40
10 UIKit                          0x18cf217cc -[UIDevice _updateSystemSoundActiveStatus:] + 144
11 CoreFoundation                 0x183110c3c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20
12 CoreFoundation                 0x1831101b8 _CFXRegistrationPost + 428
13 CoreFoundation                 0x18310ff14 ___CFXNotificationPost_block_invoke + 216
14 CoreFoundation                 0x18318d84c -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1408
15 CoreFoundation                 0x183046f38 _CFXNotificationPost + 384
16 Foundation                     0x183ab7bbc -[NSNotificationCenter postNotificationName:object:userInfo:] + 68
17 Freeletics                     0x10144e098 +[ABKPersistentData(DataVersioning) persistMostRecentSdkVersion] + 52 (ABKPersistentData+dataVersioning.m:52)
18 Freeletics                     0x101401b2c -[ABKPersistentData synchronizeDataToUserDefaults:] + 353 (ABKPersistentData.m:353)
19 CoreFoundation                 0x183186580 __invoking___ + 144
20 CoreFoundation                 0x183065748 -[NSInvocation invoke] + 284
21 Foundation                     0x183ba7308 -[NSInvocationOperation main] + 40
22 Foundation                     0x183ae7cac -[__NSOperationInternal _start:] + 848
23 Foundation                     0x183ba876c __NSOQSchedule_f + 404
24 libdispatch.dylib              0x182a70ae4 _dispatch_client_callout + 16
25 libdispatch.dylib              0x182a78f18 _dispatch_continuation_pop$VARIANT$mp + 424
26 libdispatch.dylib              0x182a77850 _dispatch_async_redirect_invoke$VARIANT$mp + 604
27 libdispatch.dylib              0x182a7dd30 _dispatch_root_queue_drain + 588
28 libdispatch.dylib              0x182a7da80 _dispatch_worker_thread3 + 120
29 libsystem_pthread.dylib        0x182da3fac _pthread_wqthread + 1176
30 libsystem_pthread.dylib        0x182da3b08 start_wqthread + 4
hokstuff commented 4 years ago

Hi @mathaeus,

Thank you for attaching the stack traces! I'll add them to our notes so we can try to get to the bottom of what is going on within that class. We will try to prioritize this accordingly to investigate and alleviate the crashes we are seeing within that file.