Skip to content

Parse iOS SDK 1.8.5 - App freezes on initializeFacebookWithApplicationLaunchOptions (iOS 9) #302

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

Closed
alexvolchek opened this issue Sep 21, 2015 · 6 comments
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Milestone

Comments

@alexvolchek
Copy link

Hi!
I've faced with weird application freeze on the next launch after user logged in facebook using [PFFacebookUtils logInInBackgroundWithReadPermissions:]. I'm using xcode 7.0, iOS 9.0 and latest SDKs:
Installing Bolts (1.2.2)
Installing FBSDKCoreKit (4.6.0)
Installing FBSDKLoginKit (4.6.0)
Installing FBSDKShareKit (4.6.0)
Installing Parse (1.8.5)
Installing ParseFacebookUtilsV4 (1.8.5)
Also Info.plist updated according to App Transport Security policy.
Thanks for any info or help!
screenshot 2015-09-21 13 46 45

@nlutsenko
Copy link
Contributor

Hey @alexvolchek, this sounds super strange.
Any chance you can post a stack trace for all the threads of your application?

@parse-github-bot
Copy link

Thank you for your feedback. We prioritize issues that have clear and concise repro steps. Please see our Bug Reporting Guidelines about what information should be added to this issue.

Please try the latest SDK. Our release notes have details about what issues were fixed in each release.

In addition, you might find the following resources helpful:

@alexvolchek
Copy link
Author

@nlutsenko hope it helps, looking forward to any info. Thanks!

thread #1: tid = 0x53a37, 0x0000000197ff8c6c libsystem_kernel.dylibsemaphore_wait_trap + 8, queue = 'com.apple.main-thread' frame #0: 0x0000000197ff8c6c libsystem_kernel.dylibsemaphore_wait_trap + 8
frame #1: 0x0000000100c43cbc libdispatch.dylib_dispatch_semaphore_wait_slow + 244 frame #2: 0x000000010099c334 Parse-[BFTask(self=0x0000000145f32130, _cmd="waitForResult:withMainThreadWarning:", error=0x0000000000000000, warningEnabled=NO) waitForResult:withMainThreadWarning:] + 228 at BFTask+Private.m:112
frame #3: 0x0000000100a8eef8 Parse-[PFUser(self=0x000000014700cb30, _cmd="synchronizeAuthDataWithAuthType:", authType=@"facebook") synchronizeAuthDataWithAuthType:] + 436 at PFUser.m:390 frame #4: 0x0000000100a99c58 Parse-[PFUserAuthenticationController registerAuthenticationDelegate:forAuthType:](self=0x0000000145de16c0, _cmd="registerAuthenticationDelegate:forAuthType:", delegate=0x0000000145de0760, authType=@"facebook") + 652 at PFUserAuthenticationController.m:60
frame #5: 0x0000000100c1358c ParseFacebookUtilsV4+[PFFacebookUtils initializeFacebookWithApplicationLaunchOptions:] + 236 frame #6: 0x000000010004f5ec OffersAround-[AppDelegate application:didFinishLaunchingWithOptions:](self=0x0000000145f12d30, _cmd="application:didFinishLaunchingWithOptions:", application=0x0000000145f0c820, launchOptions=0x0000000000000000) + 188 at AppDelegate.m:34
frame #7: 0x00000001880a31a0 UIKit-[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 400 frame #8: 0x00000001882cbe7c UIKit-[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 2904
frame #9: 0x00000001882d01c0 UIKit-[UIApplication _runWithMainScene:transitionContext:completion:] + 1660 frame #10: 0x00000001882cd300 UIKit-[UIApplication workspaceDidEndTransaction:] + 168
frame #11: 0x000000018c81f7ec FrontBoardServices-[FBSSerialQueue _performNext] + 184 frame #12: 0x000000018c81fb6c FrontBoardServices-[FBSSerialQueue _performNextFromRunLoopSource] + 56
frame #13: 0x0000000182a905a4 CoreFoundation__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24 frame #14: 0x0000000182a90038 CoreFoundation__CFRunLoopDoSources0 + 540
frame #15: 0x0000000182a8dd38 CoreFoundation__CFRunLoopRun + 724 frame #16: 0x00000001829bcdc0 CoreFoundationCFRunLoopRunSpecific + 384
frame #17: 0x000000018809c0c8 UIKit-[UIApplication _run] + 460 frame #18: 0x0000000188096f60 UIKitUIApplicationMain + 204
frame #19: 0x0000000100050034 OffersAroundmain(argc=1, argv=0x000000016fdcfa68) + 124 at main.m:14 frame #20: 0x0000000197ef68b8 libdyld.dylibstart + 4

thread #3: tid = 0x53a75, 0x0000000197ff8c84 libsystem_kernel.dylibsemaphore_timedwait_trap + 8, queue = 'com.apple.CoreLocation.ConnectionClient.0x145df5b00.events' frame #0: 0x0000000197ff8c84 libsystem_kernel.dylibsemaphore_timedwait_trap + 8
frame #1: 0x0000000100c43c68 libdispatch.dylib_dispatch_semaphore_wait_slow + 160 frame #2: 0x000000018325edc8 CoreLocation___lldb_unnamed_function15$$CoreLocation + 372
frame #3: 0x000000018326383c CoreLocation___lldb_unnamed_function79$$CoreLocation + 388 frame #4: 0x000000018329df38 CoreLocation___lldb_unnamed_function1455$$CoreLocation + 164
frame #5: 0x000000018329bb8c CoreLocation___lldb_unnamed_function1372$$CoreLocation + 140 frame #6: 0x000000018329bac0 CoreLocation___lldb_unnamed_function1371$$CoreLocation + 60
frame #7: 0x000000018329cd0c CoreLocation___lldb_unnamed_function1412$$CoreLocation + 376 frame #8: 0x000000019810d30c libxpc.dylib_xpc_connection_call_event_handler + 68
frame #9: 0x000000019810b0b4 libxpc.dylib_xpc_connection_mach_event + 2132 frame #10: 0x0000000100c31e2c libdispatch.dylib_dispatch_client_callout4 + 16
frame #11: 0x0000000100c3639c libdispatch.dylib_dispatch_mach_msg_invoke + 708 frame #12: 0x0000000100c3ea0c libdispatch.dylib_dispatch_queue_drain + 1576
frame #13: 0x0000000100c353fc libdispatch.dylib_dispatch_mach_invoke + 600 frame #14: 0x0000000100c3ea0c libdispatch.dylib_dispatch_queue_drain + 1576
frame #15: 0x0000000100c35a20 libdispatch.dylib_dispatch_queue_invoke + 464 frame #16: 0x0000000100c3ea0c libdispatch.dylib_dispatch_queue_drain + 1576
frame #17: 0x0000000100c35a20 libdispatch.dylib_dispatch_queue_invoke + 464 frame #18: 0x0000000100c31d30 libdispatch.dylib_dispatch_client_callout + 16
frame #19: 0x0000000100c40f38 libdispatch.dylib_dispatch_root_queue_drain + 2344 frame #20: 0x0000000100c40600 libdispatch.dylib_dispatch_worker_thread3 + 132
frame #21: 0x00000001980d9478 libsystem_pthread.dylib`_pthread_wqthread + 1092

thread #4: tid = 0x53a76, 0x0000000198012fe8 libsystem_kernel.dylib__psynch_cvwait + 8, queue = 'com.apple.root.default-qos' frame #0: 0x0000000198012fe8 libsystem_kernel.dylibpsynch_cvwait + 8
frame #1: 0x00000001980dacfc libsystem_pthread.dylib_pthread_cond_wait + 648 frame #2: 0x00000001839f9c40 Foundation-[__NSOperationInternal _waitUntilFinished:] + 132
frame #3: 0x000000018392cf6c Foundation-[__NSObserver _doit:] + 232 frame #4: 0x0000000182a7e6ac CoreFoundation__CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER
+ 20
frame #5: 0x0000000182a7decc CoreFoundation_CFXRegistrationPost + 396 frame #6: 0x0000000182a7dc4c CoreFoundation___CFXNotificationPost_block_invoke + 60
frame #7: 0x0000000182ae3434 CoreFoundation-[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1532 frame #8: 0x00000001829be834 CoreFoundation_CFXNotificationPost + 368
frame #9: 0x000000018392a2fc Foundation-[NSNotificationCenter postNotificationName:object:userInfo:] + 68 frame #10: 0x0000000100498638 FBSDKCoreKit-[FBSDKAccessTokenCacheV3 clearCache](self=0x0000000145ef8d60, _cmd="clearCache") + 144 at FBSDKAccessTokenCacheV3.m:49
frame #11: 0x0000000100498310 FBSDKCoreKit__42-[FBSDKAccessTokenCache cacheAccessToken:]_block_invoke(.block_descriptor=<unavailable>, obj=FBSDKAccessTokenCacheV3, idx=2, stop=NO) + 92 at FBSDKAccessTokenCache.m:62 frame #12: 0x00000001829d66f0 CoreFoundation__53-[__NSArrayI enumerateObjectsWithOptions:usingBlock:]_block_invoke + 100
frame #13: 0x00000001829cd440 CoreFoundation-[__NSArrayI enumerateObjectsWithOptions:usingBlock:] + 188 frame #14: 0x0000000100498280 FBSDKCoreKit-[FBSDKAccessTokenCache cacheAccessToken:](self=0x0000000145f0e920, _cmd="cacheAccessToken:", token=<unavailable) + 252 at FBSDKAccessTokenCache.m:60
frame #15: 0x0000000100496604 FBSDKCoreKit+[FBSDKAccessToken setCurrentAccessToken:](self=FBSDKAccessToken, _cmd="setCurrentAccessToken:", token=0x000000014700a5d0) + 672 at FBSDKAccessToken.m:96 frame #16: 0x0000000100c14d94 ParseFacebookUtilsV4-[PFFacebookAuthenticationProvider restoreAuthenticationWithAuthData:] + 380
frame #17: 0x0000000100a9a688 Parse__85-[PFUserAuthenticationController restoreAuthenticationAsyncWithAuthData:forAuthType:]_block_invoke(.block_descriptor=<unavailable>) + 68 at PFUserAuthenticationController.m:96 frame #18: 0x000000010044acb4 Bolts__55-[BFTask continueWithExecutor:block:cancellationToken:]_block_invoke_2(.block_descriptor=) + 124 at BFTask.m:334
frame #19: 0x0000000100c31d70 libdispatch.dylib_dispatch_call_block_and_release + 24 frame #20: 0x0000000100c31d30 libdispatch.dylib_dispatch_client_callout + 16
frame #21: 0x0000000100c40f38 libdispatch.dylib_dispatch_root_queue_drain + 2344 frame #22: 0x0000000100c40600 libdispatch.dylib_dispatch_worker_thread3 + 132
frame #23: 0x00000001980d9478 libsystem_pthread.dylib`_pthread_wqthread + 1092

thread #5: tid = 0x53a79, 0x000000019801459c libsystem_kernel.dylibkevent_qos + 8, queue = 'com.apple.libdispatch-manager' frame #0: 0x000000019801459c libsystem_kernel.dylibkevent_qos + 8
frame #1: 0x0000000100c46328 libdispatch.dylib_dispatch_mgr_invoke + 232 frame #2: 0x0000000100c33fac libdispatch.dylib_dispatch_mgr_thread + 52

thread #6: tid = 0x53a7e, 0x00000001980134e0 libsystem_kernel.dylib__semwait_signal + 8, name = 'gputools.smt_poll.0x145edbb60' frame #0: 0x00000001980134e0 libsystem_kernel.dylib__semwait_signal + 8
frame #1: 0x0000000197f31e2c libsystem_c.dylibnanosleep + 212 frame #2: 0x0000000197f31d4c libsystem_c.dylibusleep + 68
frame #3: 0x0000000100ca0ae0 GPUToolsCoresmt_poll_thread_entry(void*) + 140 frame #4: 0x00000001980dbb3c libsystem_pthread.dylib_pthread_body + 156
frame #5: 0x00000001980dbaa0 libsystem_pthread.dylib`_pthread_start + 156

thread #7: tid = 0x53a80, 0x0000000197ff8c6c libsystem_kernel.dylibsemaphore_wait_trap + 8, queue = 'com.dashbouquet.OffersAround.EA79692E-8AB8-4051-B265-51D8ADB7F968-1120-000001179CB3B6BD.events.serial' frame #0: 0x0000000197ff8c6c libsystem_kernel.dylibsemaphore_wait_trap + 8
frame #1: 0x00000001980d297c libsystem_platform.dylib_os_semaphore_wait + 24 frame #2: 0x0000000100c3d428 libdispatch.dylib_dispatch_barrier_sync_f_slow + 600
frame #3: 0x0000000100814f34 Mapbox+[MGLAccountManager sharedManager] + 304 frame #4: 0x0000000100815188 Mapbox+[MGLAccountManager accessToken] + 36
frame #5: 0x00000001007fb4f8 Mapbox-[MGLMapboxEvents flush] + 48 frame #6: 0x00000001007fa970 Mapbox__37-[MGLMapboxEvents pushTurnstileEvent]_block_invoke + 640
frame #7: 0x0000000100c31d70 libdispatch.dylib_dispatch_call_block_and_release + 24 frame #8: 0x0000000100c31d30 libdispatch.dylib_dispatch_client_callout + 16
frame #9: 0x0000000100c3e7f0 libdispatch.dylib_dispatch_queue_drain + 1036 frame #10: 0x0000000100c35a20 libdispatch.dylib_dispatch_queue_invoke + 464
frame #11: 0x0000000100c40908 libdispatch.dylib_dispatch_root_queue_drain + 760 frame #12: 0x0000000100c40600 libdispatch.dylib_dispatch_worker_thread3 + 132
frame #13: 0x00000001980d9478 libsystem_pthread.dylib`_pthread_wqthread + 1092

thread #8: tid = 0x53a81, 0x0000000198013c0c libsystem_kernel.dylib__workq_kernreturn + 8 frame #0: 0x0000000198013c0c libsystem_kernel.dylib__workq_kernreturn + 8
frame #1: 0x00000001980d9538 libsystem_pthread.dylib`_pthread_wqthread + 1284

thread #9: tid = 0x53a82, 0x0000000198013c0c libsystem_kernel.dylib__workq_kernreturn + 8 frame #0: 0x0000000198013c0c libsystem_kernel.dylib__workq_kernreturn + 8
frame #1: 0x00000001980d9538 libsystem_pthread.dylib`_pthread_wqthread + 1284

thread #12: tid = 0x53a87, 0x0000000198013c0c libsystem_kernel.dylib__workq_kernreturn + 8 frame #0: 0x0000000198013c0c libsystem_kernel.dylib__workq_kernreturn + 8
frame #1: 0x00000001980d9538 libsystem_pthread.dylib`_pthread_wqthread + 1284

thread #10: tid = 0x53a8d, 0x0000000198013c0c libsystem_kernel.dylib__workq_kernreturn + 8 frame #0: 0x0000000198013c0c libsystem_kernel.dylib__workq_kernreturn + 8
frame #1: 0x00000001980d9538 libsystem_pthread.dylib`_pthread_wqthread + 1284

thread #11: tid = 0x53a8e, 0x0000000198013c0c libsystem_kernel.dylib__workq_kernreturn + 8 frame #0: 0x0000000198013c0c libsystem_kernel.dylib__workq_kernreturn + 8
frame #1: 0x00000001980d9538 libsystem_pthread.dylib`_pthread_wqthread + 1284

thread #13: tid = 0x53a8f, 0x0000000198013c0c libsystem_kernel.dylib__workq_kernreturn + 8 frame #0: 0x0000000198013c0c libsystem_kernel.dylib__workq_kernreturn + 8
frame #1: 0x00000001980d9538 libsystem_pthread.dylib`_pthread_wqthread + 1284

@nlutsenko
Copy link
Contributor

It does help! Thank you for the stacktrace!
I am going to investigate further, but so far looks like it deadlocks due to FBSDK trying to post a notification on the main thread (and we are blocking the main thread while it happens).
I think I know a way to fix it, as well as test my hypothesis, but will investigate further! Thank you!

@nlutsenko
Copy link
Contributor

Yup, I was right about the assumption.
I can reproduce the problem if I subscribe to FBSDKAccessTokenDidChangeNotification on the main thread.

Looking into the way to fix it.

@nlutsenko nlutsenko added this to the 1.8.6 milestone Sep 23, 2015
@nlutsenko nlutsenko added type:bug Impaired feature or lacking behavior that is likely assumed and removed needs investigation labels Sep 23, 2015
@alexvolchek
Copy link
Author

Great news, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

No branches or pull requests

3 participants