OneSignal / OneSignal-iOS-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your native iOS app with OneSignal. https://onesignal.com
Other
496 stars 263 forks source link

[Bug]: [OneSignalTracker applicationBackgrounded] crashed my app on production #1448

Closed terminox closed 5 months ago

terminox commented 5 months ago

What happened?

I found this crash in Crashlytics report. It's a production build on one of my user.

Steps to reproduce?

As I didn't face it myself, according to the report, I guess it on the app start, but I don't know a certain way to reproduce it.

What did you expect to happen?

I expected the app not to crash since I only used basic functionalities.

OneSignal iOS SDK version

Release 5.1.0

iOS version

14

Specific iOS version

* iOS 14.7.1

Relevant log output

Crashed: com.apple.main-thread
0  libsystem_kernel.dylib         0x277b0 __pthread_kill + 8
1  libsystem_pthread.dylib        0xa9c0 pthread_kill + 212
2  libsystem_c.dylib              0x73a38 abort + 120
3  libsystem_malloc.dylib         0x1d0a8 _malloc_put + 554
4  libsystem_malloc.dylib         0x1d31c malloc_zone_error + 100
5  libsystem_malloc.dylib         0x6808 szone_free + 460
6  libswiftCore.dylib             0x2f6ac8 _swift_release_dealloc + 28
7  OneSignalUser                  0x38ffc block_destroy_helper + 1196
8  OneSignalUser                  0x35ee4 __swift_noop_void_return + 19232
9  OneSignalUser                  0x38ad4 __swift_noop_void_return + 30480
10 OneSignalOSCore                0x8e90 __swift_instantiateConcreteTypeFromMangledName + 4288
11 OneSignalUser                  0x86fc __swift_project_boxed_opaque_existential_1 + 14568
12 OneSignalFramework             0xd54c +[OneSignalTracker applicationBackgrounded] + 276
13 CoreFoundation                 0x7ce4c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20
14 CoreFoundation                 0x7ce0c ___CFXRegistrationPost_block_invoke + 48
15 CoreFoundation                 0x7c3f8 _CFXRegistrationPost + 400
16 CoreFoundation                 0x7bdf0 _CFXNotificationPost + 696
17 Foundation                     0x6704 -[NSNotificationCenter postNotificationName:object:userInfo:] + 60
18 UIKitCore                      0xb2adcc -[UIApplication _deactivateForReason:notify:] + 1540
19 UIKitCore                      0x206ddc -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 260
20 UIKitCore                      0x2071d4 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 740
21 UIKitCore                      0x206a90 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 336
22 UIKitCore                      0x20e72c __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 188
23 UIKitCore                      0x64538c +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:actions:completion:] + 812
24 UIKitCore                      0x743184 _UISceneSettingsDiffActionPerformChangesWithTransitionContext + 248
25 UIKitCore                      0x20e420 -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 356
26 UIKitCore                      0x4dae4 __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke + 772
27 UIKitCore                      0x4c590 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 248
28 UIKitCore                      0x4d730 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 220
29 UIKitCore                      0x66bef4 -[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:] + 464
30 FrontBoardServices             0x9504 -[FBSScene updater:didUpdateSettings:withDiff:transitionContext:completion:] + 456
31 FrontBoardServices             0x31ab4 __94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke_2 + 124
32 FrontBoardServices             0x16420 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 232
33 FrontBoardServices             0x31a00 __94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke + 368
34 libdispatch.dylib              0x61298 _dispatch_client_callout + 16
35 libdispatch.dylib              0x65b8 _dispatch_block_invoke_direct$VARIANT$mp + 224
36 FrontBoardServices             0x54e04 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 40
37 FrontBoardServices             0x54acc -[FBSSerialQueue _targetQueue_performNextIfPossible] + 404
38 FrontBoardServices             0x54fa0 -[FBSSerialQueue _performNextFromRunLoopSource] + 28
39 CoreFoundation                 0x9a8a8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
40 CoreFoundation                 0x9a7a8 __CFRunLoopDoSource0 + 204
41 CoreFoundation                 0x99afc __CFRunLoopDoSources0 + 256
42 CoreFoundation                 0x94018 __CFRunLoopRun + 768
43 CoreFoundation                 0x937d0 CFRunLoopRunSpecific + 572
44 GraphicsServices               0x3570 GSEventRunModal + 160
45 UIKitCore                      0xb302d0 -[UIApplication _run] + 1052
46 UIKitCore                      0xb3584c UIApplicationMain + 164

Code of Conduct

nan-li commented 5 months ago

Hi @terminox thanks for reporting. We made crash fixes in Release 5.1.3 and Release 5.1.6.

This stacktrace should be resolved by one of those releases.

Please upgrade to version 5.1.6 or later, and let us know of any crashes still remain.

terminox commented 5 months ago

@nan-li Thank you so much! 😄