-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: [OneSignalUserDefaults saveDoubleForKey:withValue:] crash #1387
Comments
Looks related to my earlier report involving OneSignalUserDefaults: #1365. Is there any progress at all on reproducing and fixing these? |
Hi @jakubpetrik thank you for reporting. I am not sure that this crash is due to OneSignal. I see from the stack trace that the application is losing focus with The last call from OneSignal is this line which just calls
I did some digging online and came across this post that looks related. The poster followed up with their root cause.
Do you have any components that are observing User Defaults? |
Hi @nan-li. We only use AppStorage wrappers in our app (pure SwiftUI app). What's puzzling is that this issue started to appear only after adding OneSignal to our app and it seems to happen only in the production. |
This seems super unlikely to me. Sure a notification is posted to Your linked post about the dismissed ViewController also doesn’t match any scenario that could be happening in my projects where I’m also seeing this crash. Nor did I see anything like this crash before upgrading to SDK V5, which suggests I don’t have problematic observation code hanging around. It seems most likely to me that this is a concurrency issue in the OneSignal SDK just like the other recent crash reports appear to be. |
Hi @jakubpetrik thank you for that update. That is informative as AppStorage works with A high-level search about AppStorage and UserDefaults took me to this thread. This comment may be what is happening in your crash reported as observers are called listening to UserDefaults.
It may be no other of your app dependencies are writing to UserDefaults at the end of the app lifecycle. |
Hi @danhalliday
Your crash reports look like a different issue that the SDK is not handling well. We are working on the fix for those crashes. |
Got the same issue from firebase crashlytics
|
Hi @jakubpetrik, checking in on this issue for you? Hi @alphapokedex, your stack trace looks like this post: #1409. We released a fix for this crash in Release 5.1.6. Please update and let us know if your crashes are resolved, or what crashes are still ongoing. |
What happened?
App crashed on start
Steps to reproduce?
What did you expect to happen?
App should not crash.
OneSignal iOS SDK version
5.1.3
iOS version
15
Specific iOS version
Relevant log output
Crashed: com.apple.main-thread 0 SwiftUI 0x1281818 OUTLINED_FUNCTION_4 + 9336 1 SwiftUI 0xdfb3b0 OUTLINED_FUNCTION_15 + 21652 2 SwiftUI 0xdfaec8 OUTLINED_FUNCTION_15 + 20396 3 SwiftUI 0x175803c OUTLINED_FUNCTION_2 + 13856 4 SwiftUI 0x1758120 OUTLINED_FUNCTION_2 + 14084 5 SwiftUI 0x1b7bbf8 OUTLINED_FUNCTION_18 + 17484 6 SwiftUI 0xd6e370 objectdestroyTm + 20668 7 SwiftUI 0xd6e67c objectdestroyTm + 21448 8 SwiftUI 0xd6f21c objectdestroyTm + 24424 9 SwiftUI 0x11474c0 OUTLINED_FUNCTION_11 + 40 10 SwiftUI 0x1977230 OUTLINED_FUNCTION_4 + 2828 11 SwiftUI 0x1977948 OUTLINED_FUNCTION_4 + 4644 12 SwiftUI 0xd6e9e8 objectdestroyTm + 22324 13 SwiftUI 0xd6f0c4 objectdestroyTm + 24080 14 SwiftUI 0xd6f1a0 objectdestroyTm + 24300 15 CoreFoundation 0x2fc78 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 148 16 CoreFoundation 0x2f640 ___CFXRegistrationPost_block_invoke + 88 17 CoreFoundation 0x2f588 _CFXRegistrationPost + 440 18 CoreFoundation 0x2ead8 _CFXNotificationPost + 724 19 Foundation 0x2b7e4 -[NSNotificationCenter postNotificationName:object:userInfo:] + 92 20 OneSignalCore 0x10d48 -[OneSignalUserDefaults saveDoubleForKey:withValue:] + 72 21 OneSignalFramework 0xda0c +[OneSignalTracker updateLastClosedTime] + 96 22 OneSignalFramework 0xd46c +[OneSignalTracker applicationBackgrounded] + 52 23 CoreFoundation 0x2fc78 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 148 24 CoreFoundation 0x2f640 ___CFXRegistrationPost_block_invoke + 88 25 CoreFoundation 0x2f588 _CFXRegistrationPost + 440 26 CoreFoundation 0x2ead8 _CFXNotificationPost + 724 27 Foundation 0x2b7e4 -[NSNotificationCenter postNotificationName:object:userInfo:] + 92 28 UIKitCore 0x5eca10 -[_UISceneLifecycleMonitor willResignActive] + 240 29 UIKitCore 0x18fbb0 __111-[_UIWindowSceneFBSSceneLifecycleMonitor transitionToTargetState:fromState:withTransitionContext:preparations:]_block_invoke_5 + 332 30 UIKitCore 0x18e988 _UIScenePerformActionsWithLifecycleActionMask + 112 31 UIKitCore 0x2a5524 __111-[_UIWindowSceneFBSSceneLifecycleMonitor transitionToTargetState:fromState:withTransitionContext:preparations:]_block_invoke_4 + 156 32 UIKitCore 0x13a1cc ___UISceneLifecycleSettingsUpdateBlockWithCanvasAndTransitionContext_block_invoke_2 + 296 33 UIKitCore 0x139d00 -[_UIWindowSceneFBSSceneLifecycleMonitor transitionToTargetState:fromState:withTransitionContext:preparations:] + 680 34 UIKitCore 0x139310 ___UISceneLifecycleSettingsUpdateBlockWithCanvasAndTransitionContext_block_invoke + 308 35 UIKitCore 0x13900c __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 116 36 UIKitCore 0x138f34 +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:fromCurrentState:actions:completion:] + 736 37 UIKitCore 0x1387bc _UISceneSettingsDiffActionPerformChangesWithTransitionContextAndCompletion + 224 38 UIKitCore 0x13846c -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 316 39 UIKitCore 0x4b787c __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke.225 + 612 40 UIKitCore 0x1375f0 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 216 41 UIKitCore 0x137460 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 244 42 UIKitCore 0x1372a0 -[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:] + 336 43 FrontBoardServices 0xd99c -[FBSScene updater:didUpdateSettings:withDiff:transitionContext:completion:] + 624 44 FrontBoardServices 0xd70c __94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke_2 + 152 45 FrontBoardServices 0xd5a8 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 168 46 FrontBoardServices 0xd4c4 __94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke + 344 47 libdispatch.dylib 0x4300 _dispatch_client_callout + 20 48 libdispatch.dylib 0x7d48 _dispatch_block_invoke_direct + 284 49 FrontBoardServices 0x99ec __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 52 50 FrontBoardServices 0x996c -[FBSMainRunLoopSerialQueue _targetQueue_performNextIfPossible] + 240 51 FrontBoardServices 0x9844 -[FBSMainRunLoopSerialQueue _performNextFromRunLoopSource] + 28 52 CoreFoundation 0x37acc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 53 CoreFoundation 0x36d48 __CFRunLoopDoSource0 + 176 54 CoreFoundation 0x3555c __CFRunLoopDoSources0 + 340 55 CoreFoundation 0x34238 __CFRunLoopRun + 828 56 CoreFoundation 0x33e18 CFRunLoopRunSpecific + 608 57 GraphicsServices 0x35ec GSEventRunModal + 164 58 UIKitCore 0x22f2fc -[UIApplication _run] + 888 59 UIKitCore 0x22e938 UIApplicationMain + 340 60 SwiftUI 0x114d354 OUTLINED_FUNCTION_31 + 604 61 SwiftUI 0x114d198 OUTLINED_FUNCTION_31 + 160 62 SwiftUI 0xdca434 OUTLINED_FUNCTION_26 + 2196 63 App 0x4b41d0 main + 52 (redacted) 64 ??? 0x1c3cf7d44 (Missing)
Code of Conduct
The text was updated successfully, but these errors were encountered: