parse-community / Parse-SDK-iOS-OSX

The Apple SDK for Parse Platform (iOS, macOS, watchOS, tvOS)
https://parseplatform.org
Other
2.81k stars 864 forks source link

App crashes while retrieving current user #1678

Closed tobias61 closed 1 year ago

tobias61 commented 1 year ago

New Issue Checklist

Issue Description

During App Store review, reviewers faced an issue during which the app simply became unresponsive and eventually crashed. I have attached the crashlog below. I, myself, was not able to reproduce it but Apple reports the same issue again and again. Unfortunately, this blocks us from shipping updates.

From the crashlog, it seems like it gets stuck while retrieving the current user. This seems to occur on the main thread, hence the application becomes unresponsive, but also on threads 1, 5 and 6. However, I am just a beginner so any help would be much appreciated.

Steps to reproduce

I was not able to reproduce it. App Store review was using an iPad with version 15.7

Actual Outcome

Application gets stuck and eventually crashes while retrieving the current user

Expected Outcome

Application retrieves the current user and moves on

Environment

Client

Server

Logs

Thread 0 name:   Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib                 0x1baaacae8 semaphore_wait_trap + 8
1   libdispatch.dylib                      0x180b5a960 _dispatch_sema4_wait$VARIANT$mp + 24
2   libdispatch.dylib                      0x180b5afb0 _dispatch_semaphore_wait_slow + 148
3   Parse                                  0x103eb6470 -[BFTask(Private) waitForResult:withMainThreadWarning:] + 140
4   Parse                                  0x103f2fd3c +[PFUser currentUser] + 40
5   Townly                                 0x102c767b8 NotificationsTracker.stopTracking() + 960440 (NotificationsTracker.swift:47)
6   Townly                                 0x102d28344 @objc SceneDelegate.sceneWillResignActive(_:) + 1688388 (<compiler-generated>:0)
7   UIKitCore                              0x1836d9fb0 -[_UISceneLifecycleMonitor willResignActive] + 200
8   UIKitCore                              0x18334b5cc __111-[_UIWindowSceneFBSSceneLifecycleMonitor transitionToTargetState:fromState:withTransitionContext:preparations:]_block_invoke_2.93 + 316
9   UIKitCore                              0x18333dff8 _UIScenePerformActionsWithLifecycleActionMask + 96
10  UIKitCore                              0x1833f487c __111-[_UIWindowSceneFBSSceneLifecycleMonitor transitionToTargetState:fromState:withTransitionContext:preparations:]_block_invoke.92 + 128
11  UIKitCore                              0x1833518d8 ___UISceneLifecycleSettingsUpdateBlockWithCanvasAndTransitionContext_block_invoke_2 + 348
12  UIKitCore                              0x183494f58 -[_UIWindowSceneFBSSceneLifecycleMonitor transitionToTargetState:fromState:withTransitionContext:preparations:] + 596
13  UIKitCore                              0x183337a7c ___UISceneLifecycleSettingsUpdateBlockWithCanvasAndTransitionContext_block_invoke + 336
14  UIKitCore                              0x18333ed10 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 136
15  UIKitCore                              0x1833fa934 +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:actions:completion:] + 812
16  UIKitCore                              0x183340ad4 _UISceneSettingsDiffActionPerformChangesWithTransitionContext + 248
17  UIKitCore                              0x183425184 -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 356
18  UIKitCore                              0x18387af38 __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke.578 + 772
19  UIKitCore                              0x18336e77c -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 248
20  UIKitCore                              0x1833b051c -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 264
21  UIKitCore                              0x18333ce38 -[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:] + 448
22  FrontBoardServices                     0x192064328 -[FBSScene updater:didUpdateSettings:withDiff:transitionContext:completion:] + 500
23  FrontBoardServices                     0x19207b15c __94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke_2 + 124
24  FrontBoardServices                     0x192061bdc -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 232
25  FrontBoardServices                     0x192067a68 __94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke + 368
26  libdispatch.dylib                      0x180bba094 _dispatch_client_callout + 16
27  libdispatch.dylib                      0x180b5d150 _dispatch_block_invoke_direct$VARIANT$mp + 220
28  FrontBoardServices                     0x1920632ac __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 40
29  FrontBoardServices                     0x1920627c0 -[FBSSerialQueue _targetQueue_performNextIfPossible] + 176
30  FrontBoardServices                     0x192066960 -[FBSSerialQueue _performNextFromRunLoopSource] + 24
31  CoreFoundation                         0x180f1a4fc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
32  CoreFoundation                         0x180f2a62c __CFRunLoopDoSource0 + 204
33  CoreFoundation                         0x180e6c834 __CFRunLoopDoSources0 + 256
34  CoreFoundation                         0x180e71f08 __CFRunLoopRun + 768
35  CoreFoundation                         0x180e85250 CFRunLoopRunSpecific + 572
36  GraphicsServices                       0x1a17d4988 GSEventRunModal + 160
37  UIKitCore                              0x183687a88 -[UIApplication _run] + 1080
38  UIKitCore                              0x183420fc8 UIApplicationMain + 336
39  libswiftUIKit.dylib                    0x197806ee4 UIApplicationMain(_:_:_:_:) + 100
40  Townly                                 0x102b95108 main + 37128 (RegistrationProfileImageController.swift:0)
41  dyld                                   0x1038ac4d0 start + 444

Thread 1 name:   Dispatch queue: com.parse.livequery
Thread 1:
0   libsystem_kernel.dylib                 0x1baaacae8 semaphore_wait_trap + 8
1   libdispatch.dylib                      0x180b5a960 _dispatch_sema4_wait$VARIANT$mp + 24
2   libdispatch.dylib                      0x180b5afb0 _dispatch_semaphore_wait_slow + 148
3   Parse                                  0x103eb6470 -[BFTask(Private) waitForResult:withMainThreadWarning:] + 140
4   Parse                                  0x103f2fd3c +[PFUser currentUser] + 40
5   ParseLiveQuery                         0x1040c0fc0 specialized Client.didReceive(event:client:) + 112
6   Starscream                             0x1045f54a8 closure #1 in WebSocket.didReceive(event:) + 156
7   Starscream                             0x1045e6328 thunk for @escaping @callee_guaranteed () -> () + 28
8   libdispatch.dylib                      0x180bb9094 _dispatch_call_block_and_release + 24
9   libdispatch.dylib                      0x180bba094 _dispatch_client_callout + 16
10  libdispatch.dylib                      0x180b6073c _dispatch_lane_serial_drain$VARIANT$mp + 644
11  libdispatch.dylib                      0x180b611f4 _dispatch_lane_invoke$VARIANT$mp + 408
12  libdispatch.dylib                      0x180b6aec8 _dispatch_workloop_worker_thread + 632
13  libsystem_pthread.dylib                0x1db234e10 _pthread_wqthread + 284
14  libsystem_pthread.dylib                0x1db23493c start_wqthread + 8

Thread 2 name:  com.apple.uikit.eventfetch-thread
Thread 2:
0   libsystem_kernel.dylib                 0x1baaacaac mach_msg_trap + 8
1   libsystem_kernel.dylib                 0x1baaad07c mach_msg + 72
2   CoreFoundation                         0x180e6dd88 __CFRunLoopServiceMachPort + 368
3   CoreFoundation                         0x180e72090 __CFRunLoopRun + 1160
4   CoreFoundation                         0x180e85250 CFRunLoopRunSpecific + 572
5   Foundation                             0x182592eec -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 232
6   Foundation                             0x1825d2000 -[NSRunLoop(NSRunLoop) runUntilDate:] + 88
7   UIKitCore                              0x183606ef4 -[UIEventFetcher threadMain] + 512
8   Foundation                             0x1825dfbfc __NSThread__start__ + 792
9   libsystem_pthread.dylib                0x1db236348 _pthread_start + 116
10  libsystem_pthread.dylib                0x1db234948 thread_start + 8

Thread 3 name:   Dispatch queue: com.apple.NSURLSession-delegate
Thread 3:
0   libsystem_kernel.dylib                 0x1baaad688 __ulock_wait + 8
1   libdispatch.dylib                      0x180b5ad60 _dlock_wait + 52
2   libdispatch.dylib                      0x180b5ab4c _dispatch_thread_event_wait_slow$VARIANT$mp + 52
3   libdispatch.dylib                      0x180b67bfc __DISPATCH_WAIT_FOR_QUEUE__ + 320
4   libdispatch.dylib                      0x180b67820 _dispatch_sync_f_slow + 136
5   Parse                                  0x103f28314 -[PFURLSession _taskDelegateForTask:] + 148
6   Parse                                  0x103f28720 -[PFURLSession URLSession:dataTask:didReceiveResponse:completionHandler:] + 96
7   CFNetwork                              0x1816b64cc 0x181643000 + 472268
8   libdispatch.dylib                      0x180bb9094 _dispatch_call_block_and_release + 24
9   libdispatch.dylib                      0x180bba094 _dispatch_client_callout + 16
10  libdispatch.dylib                      0x180b6073c _dispatch_lane_serial_drain$VARIANT$mp + 644
11  libdispatch.dylib                      0x180b61224 _dispatch_lane_invoke$VARIANT$mp + 456
12  libdispatch.dylib                      0x180b6aec8 _dispatch_workloop_worker_thread + 632
13  libsystem_pthread.dylib                0x1db234e10 _pthread_wqthread + 284
14  libsystem_pthread.dylib                0x1db23493c start_wqthread + 8

Thread 4 name:  com.apple.NSURLConnectionLoader
Thread 4:
0   libsystem_kernel.dylib                 0x1baaacaac mach_msg_trap + 8
1   libsystem_kernel.dylib                 0x1baaad07c mach_msg + 72
2   CoreFoundation                         0x180e6dd88 __CFRunLoopServiceMachPort + 368
3   CoreFoundation                         0x180e72090 __CFRunLoopRun + 1160
4   CoreFoundation                         0x180e85250 CFRunLoopRunSpecific + 572
5   CFNetwork                              0x18188aaa8 0x181643000 + 2390696
6   Foundation                             0x1825dfbfc __NSThread__start__ + 792
7   libsystem_pthread.dylib                0x1db236348 _pthread_start + 116
8   libsystem_pthread.dylib                0x1db234948 thread_start + 8

Thread 5 name:   Dispatch queue: com.apple.root.user-initiated-qos.cooperative
Thread 5:
0   libsystem_kernel.dylib                 0x1baaacae8 semaphore_wait_trap + 8
1   libdispatch.dylib                      0x180b5a960 _dispatch_sema4_wait$VARIANT$mp + 24
2   libdispatch.dylib                      0x180b5afb0 _dispatch_semaphore_wait_slow + 148
3   Parse                                  0x103eb6470 -[BFTask(Private) waitForResult:withMainThreadWarning:] + 140
4   Parse                                  0x103f2fd3c +[PFUser currentUser] + 40
5   Townly                                 0x102c77230 (1) suspend resume partial function for specialized ParseBlockedUsersSynchronizer.synchronize() + 963120 (BlockedUsersSynchronizer.swift:19)
6   Townly                                 0x102c33421 (2) await resume partial function for closure #1 in AppCoordinator.loadBlockedUsers() + 685089 (AppCoordinator.swift:71)
7   Townly                                 0x102d343f9 (1) await resume partial function for specialized thunk for @escaping @callee_guaranteed @Sendable @async () -> (@out A) + 1737721 (<compiler-generated>:0)
8   libswift_Concurrency.dylib             0x1e8318295 completeTaskAndRelease(swift::AsyncContext*, swift::SwiftError*) + 1

Thread 6 name:   Dispatch queue: com.apple.root.user-initiated-qos.cooperative
Thread 6:
0   libsystem_kernel.dylib                 0x1baaacae8 semaphore_wait_trap + 8
1   libdispatch.dylib                      0x180b5a960 _dispatch_sema4_wait$VARIANT$mp + 24
2   libdispatch.dylib                      0x180b5afb0 _dispatch_semaphore_wait_slow + 148
3   Parse                                  0x103eb6470 -[BFTask(Private) waitForResult:withMainThreadWarning:] + 140
4   Parse                                  0x103f2fd3c +[PFUser currentUser] + 40
5   Townly                                 0x102c131fc (1) suspend resume partial function for NotificationsLocalSynchronizer.syncNotifications() + 553468 (NotificationsLocalSynchronizer.swift:31)
6   Townly                                 0x102c13e65 (4) await resume partial function for NotificationsLocalSynchronizer.syncNotificationsIfRequired() + 556645 (NotificationsLocalSynchronizer.swift:75)
7   Townly                                 0x102c45691 (2) await resume partial function for specialized thunk for @escaping @callee_guaranteed @Sendable @async () -> (@out A) + 759441 (<compiler-generated>:0)
8   libswift_Concurrency.dylib             0x1e8318295 completeTaskAndRelease(swift::AsyncContext*, swift::SwiftError*) + 1

Thread 7 name:  WebThread
Thread 7:
0   libsystem_kernel.dylib                 0x1baaacaac mach_msg_trap + 8
1   libsystem_kernel.dylib                 0x1baaad07c mach_msg + 72
2   CoreFoundation                         0x180e6dd88 __CFRunLoopServiceMachPort + 368
3   CoreFoundation                         0x180e72090 __CFRunLoopRun + 1160
4   CoreFoundation                         0x180e85250 CFRunLoopRunSpecific + 572
5   WebCore                                0x190437178 RunWebThread(void*) + 772
6   libsystem_pthread.dylib                0x1db236348 _pthread_start + 116
7   libsystem_pthread.dylib                0x1db234948 thread_start + 8

Thread 8 name:  AVAudioSession Notify Thread
Thread 8:
0   libsystem_kernel.dylib                 0x1baaacaac mach_msg_trap + 8
1   libsystem_kernel.dylib                 0x1baaad07c mach_msg + 72
2   CoreFoundation                         0x180e6dd88 __CFRunLoopServiceMachPort + 368
3   CoreFoundation                         0x180e72090 __CFRunLoopRun + 1160
4   CoreFoundation                         0x180e85250 CFRunLoopRunSpecific + 572
5   AudioSession                           0x189c2f478 CADeprecated::GenericRunLoopThread::Entry(void*) + 156
6   AudioSession                           0x189c387c8 CADeprecated::CAPThread::Entry(CADeprecated::CAPThread*) + 88
7   libsystem_pthread.dylib                0x1db236348 _pthread_start + 116
8   libsystem_pthread.dylib                0x1db234948 thread_start + 8

Thread 9:
0   libsystem_pthread.dylib                0x1db234934 start_wqthread + 0

Thread 10:
0   libsystem_pthread.dylib                0x1db234934 start_wqthread + 0

Thread 11:
0   libsystem_pthread.dylib                0x1db234934 start_wqthread + 0

Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x000000000000000e   x1: 0x0000000000000000   x2: 0x0000000000000103   x3: 0x00000002837feea0
    x4: 0xfffffffeeb1dec90   x5: 0x0000000000000020   x6: 0x0000000282092b00   x7: 0x0000000000000403
    x8: 0x0000000000000000   x9: 0x0000000000000000  x10: 0xffffffffffffffff  x11: 0x0000000000000000
   x12: 0x0000000000000002  x13: 0x0000000282094610  x14: 0x0000000000000000  x15: 0x00000001f3d00a18
   x16: 0xffffffffffffffdc  x17: 0x00000001db1ae88c  x18: 0x0000000000000000  x19: 0x000000028168a430
   x20: 0x000000028168a3f0  x21: 0xffffffffffffffff  x22: 0x0000000282092a40  x23: 0x0000000283bf1950
   x24: 0x0000000104c077d0  x25: 0x000000019bec2b8b  x26: 0x00000002809e1800  x27: 0x0000000000000001
   x28: 0x0000000104c077d0   fp: 0x000000016d271820   lr: 0x0000000180b5a960
    sp: 0x000000016d271810   pc: 0x00000001baaacae8 cpsr: 0x60000000
   far: 0x000000016d8b4000  esr: 0x56000080  Address size fault
parse-github-assistant[bot] commented 1 year ago

Thanks for opening this issue!

mtrezza commented 1 year ago

I'm closing this as it does not seem to be a Parse Apple SDK issue.

If this is a confirmed bug, please comment and we can re-open the issue.

tobias61 commented 1 year ago

@mtrezza This happens when current user is being retrieved, so why is it not related to the SDK? If you have any idea why this occurs, this would be very helpful.

mtrezza commented 1 year ago

The cause could be an SDK bug, but it's one of the most common features, so that would be surprising. From the logs it could be a threading issue in the custom code of your app. I also see LiveQuery in the logs, so without seeing your custom code it's really difficult to say.

Could you try to reproduce the issue in a minimal example and then share that code? With that we can reopen the issue.