facebook / facebook-ios-sdk

Used to integrate the Facebook Platform with your iOS & tvOS apps.
https://developers.facebook.com/docs/ios
Other
7.79k stars 3.55k forks source link

Seeing three crashes spike #1378

Closed steve-wang-ht closed 4 years ago

steve-wang-ht commented 4 years ago

Checklist

Environment

Describe your dev environment here, giving as many details as possible. If you have them, make sure to include:

Goals

Stop these crashes:

  1. NSInvalidArgumentException: -[__NSCFBoolean objectForKeyedSubscript:]: unrecognized selector sent to instance 0x1d47d5880

    at

    FBSDKRestrictiveDataFilterManager.m:74:11
    +[FBSDKRestrictiveDataFilterManager updateFilters:]
  2. NSInvalidArgumentException: -[__NSCFBoolean objectForKeyedSubscript:]: unrecognized selector sent to instance 0x1fd9a9880

    at

    FBSDKMonotonicTimeConvertMachUnitsToSeconds
  3. NSInvalidArgumentException: -[__NSCFBoolean objectForKeyedSubscript:]: unrecognized selector sent to instance 0x1d382bd98

    at

    fbsdkdfl_WKUserScriptClass

Expected Results

What do you expect to happen? This shouldn't be crashing

Actual Results

What actually happened? Can you provide a stack trace?

Steps to Reproduce

What are the steps necessary to reproduce this issue?

macdrevx commented 4 years ago

I'm seeing elevated crash rates of the first one mentioned here, which feels uncomfortably similar to #1373.

I'm also seeing the same crash reason inside of +[FBSDKEventDeactivationManager updateDeactivatedEvents:] (FBSDKEventDeactivationManager.m:76)

prachigauriar commented 4 years ago

At Grubhub, we’re seeing over 150 crashes an hour because of this issue.

joesus commented 4 years ago

@prachigauriar are you still seeing these today? Working theory is that they are cache-related as the root issue in #1373 is resolved. cc: @tianqibt

steve-wang-ht commented 4 years ago

I'm still seeing crashes for all three still. Is there any way we can clear the cache (remotely or new app release)?

macdrevx commented 4 years ago

@joesus I’m on the same team as @prachigauriar and I can confirm that we’re still seeing them today. +1 to any guidance on how we can clear the cache.

tianqibt commented 4 years ago

@macdrevx and @prachigauriar can you share the trending of the crashes? In SDK, the server configuration should be refreshed every hour with normal network condition, or if user reinstall the app, the cache will be cleaned. We are working on finding out what we can do to help clean the cache.

tianqibt commented 4 years ago

Also would you please share the sdk version still seeing crashes?

prachigauriar commented 4 years ago

@tianqibt We’re using FacebookSDK/LoginKit 5.3.0. In the last hour, we’ve had 305 crashes.

tianqibt commented 4 years ago

We had verified the server response for grubhub is correct. Also tried to download the app from app store, and did not observe any crash on our devices. Do you guys have any information about the pattern of devices seeing crash?

steve-wang-ht commented 4 years ago

We're still seeing this on HotelTonight, could you verify our server response as well? I'm not seeing any pattern, it seems across the board on devices, iOS version, etc.

tianqibt commented 4 years ago

@steve-wang-ht, we have checked server response for your app, and verified it is correct. We also download your app from app store, and no crash is observed on our test devices. We checked our monitoring data for crash, and found we received 6 crash reports from your app today, but the timestamp indicates the crashes actually happened on 5/6. Is there any way on your side to verify the actual happening time for those crashes?

steve-wang-ht commented 4 years ago
NSInvalidArgumentException: -[__NSCFBoolean objectForKeyedSubscript:]: unrecognized selector sent to instance 0x1f3999d00

0  CoreFoundation    ___exceptionPreprocess
1  libobjc.A.dylib   _objc_exception_throw
2  CoreFoundation    -[NSObject(NSObject) doesNotRecognizeSelector:]
3  CoreFoundation    ____forwarding___
4  CoreFoundation    ___forwarding_prep_0___
5  FBSDKCoreKit      fbsdkdfl_WKUserScriptClass
6  FBSDKCoreKit      FBSDKMonotonicTimeConvertMachUnitsToSeconds
7  FBSDKCoreKit      sum
8  FBSDKCoreKit      sum
9  FBSDKCoreKit      sum
10 FBSDKCoreKit      sum
11 FBSDKCoreKit      sum
12 CoreFoundation    ___NSARRAY_IS_CALLING_OUT_TO_A_BLOCK__
13 CoreFoundation    -[__NSArrayM enumerateObjectsWithOptions:usingBlock:]
14 FBSDKCoreKit      sum
15 FBSDKCoreKit      sum
16 FBSDKCoreKit      sum
17 libdispatch.dylib __dispatch_call_block_and_release
18 libdispatch.dylib __dispatch_client_callout
19 libdispatch.dylib __dispatch_main_queue_callback_4CF
20 CoreFoundation    ___CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
21 CoreFoundation    ___CFRunLoopRun
22 CoreFoundation    _CFRunLoopRunSpecific
23 GraphicsServices  _GSEventRunModal
24 UIKitCore         _UIApplicationMain
NSInvalidArgumentException: -[__NSCFBoolean objectForKeyedSubscript:]: unrecognized selector sent to instance 0x1f18d1d00

0  CoreFoundation    ___exceptionPreprocess
1  libobjc.A.dylib   _objc_exception_throw
2  CoreFoundation    -[NSObject(NSObject) doesNotRecognizeSelector:]
3  CoreFoundation    ____forwarding___
4  CoreFoundation    ___forwarding_prep_0___
5  FBSDKCoreKit      FBSDKMonotonicTimeConvertMachUnitsToSeconds
6  FBSDKCoreKit      FBSDKMonotonicTimeConvertMachUnitsToSeconds
7  FBSDKCoreKit      sum
8  FBSDKCoreKit      sum
9  FBSDKCoreKit      sum
10 FBSDKCoreKit      sum
11 FBSDKCoreKit      sum
12 CoreFoundation    ___NSARRAY_IS_CALLING_OUT_TO_A_BLOCK__
13 CoreFoundation    -[__NSArrayM enumerateObjectsWithOptions:usingBlock:]
14 FBSDKCoreKit      sum
15 FBSDKCoreKit      sum
16 FBSDKCoreKit      sum
17 libdispatch.dylib __dispatch_call_block_and_release
18 libdispatch.dylib __dispatch_client_callout
19 libdispatch.dylib __dispatch_main_queue_callback_4CF
20 CoreFoundation    ___CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
21 CoreFoundation    ___CFRunLoopRun
22 CoreFoundation    _CFRunLoopRunSpecific
23 GraphicsServices  _GSEventRunModal
24 UIKitCore         _UIApplicationMain
NSInvalidArgumentException: -[__NSCFBoolean objectForKeyedSubscript:]: unrecognized selector sent to instance 0x1c1359880

0  CoreFoundation    ___exceptionPreprocess
1  libobjc.A.dylib   _objc_exception_throw
2  CoreFoundation    -[NSObject(NSObject) doesNotRecognizeSelector:]
3  CoreFoundation    ____forwarding___
4  CoreFoundation    ___forwarding_prep_0___
5  Hotel Tonight     +[FBSDKRestrictiveDataFilterManager updateFilters:] (FBSDKRestrictiveDataFilterManager.m:74:11)
6  Hotel Tonight     +[FBSDKServerConfigurationManager processLoadRequestResponse:error:appID:] (FBSDKServerConfigurationManager.m:240:5)
7  Hotel Tonight     __78+[FBSDKServerConfigurationManager loadServerConfigurationWithCompletionBlock:]_block_invoke (FBSDKServerConfigurationManager.m:163:11)
8  Hotel Tonight     -[FBSDKGraphRequestMetadata invokeCompletionHandlerForConnection:withResults:error:] (FBSDKGraphRequestMetadata.m:41:5)
9  Hotel Tonight     __82-[FBSDKGraphRequestConnection processResultBody:error:metadata:canNotifyDelegate:]_block_invoke (FBSDKGraphRequestConnection.m:804:5)
10 Hotel Tonight     -[FBSDKGraphRequestConnection processResultBody:error:metadata:canNotifyDelegate:] (FBSDKGraphRequestConnection.m:838:3)
11 Hotel Tonight     __64-[FBSDKGraphRequestConnection completeWithResults:networkError:]_block_invoke (FBSDKGraphRequestConnection.m:787:5)
12 CoreFoundation    ___NSARRAY_IS_CALLING_OUT_TO_A_BLOCK__
13 CoreFoundation    -[__NSArrayM enumerateObjectsWithOptions:usingBlock:]
14 Hotel Tonight     -[FBSDKGraphRequestConnection completeWithResults:networkError:] (FBSDKGraphRequestConnection.m:767:3)
15 Hotel Tonight     -[FBSDKGraphRequestConnection completeFBSDKURLSessionWithResponse:data:networkError:] (FBSDKGraphRequestConnection.m:632:3)
16 Hotel Tonight     __36-[FBSDKGraphRequestConnection start]_block_invoke_3 (FBSDKGraphRequestConnection.m:242:7)
17 libdispatch.dylib __dispatch_call_block_and_release
18 libdispatch.dylib __dispatch_client_callout
19 libdispatch.dylib __dispatch_main_queue_callback_4CF$VARIANT$armv81
20 CoreFoundation    ___CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
21 CoreFoundation    ___CFRunLoopRun
22 CoreFoundation    _CFRunLoopRunSpecific
23 GraphicsServices  _GSEventRunModal
24 UIKitCore         _UIApplicationMain

These are a couple of stack traces regarding the 3 crashes

macdrevx commented 4 years ago

We have not observed the crash anymore with the latest release of the Grubhub app. We didn't modify our SDK usage, so perhaps the new release had the side effect of invalidating some caches that were continuing to cause the crash? Older versions of the app are continuing to report the crash.

pappalar commented 4 years ago

Getting these exact crashes again today

peterdk commented 4 years ago

Getting these crashes since 10 minutes. 15 users, 27 events. Nothing changed on our side.

NSInvalidArgumentException: -[NSNull count]: unrecognized selector sent to instance 0x1ea9421e0

0  CoreFoundation    ___exceptionPreprocess
1  libobjc.A.dylib   _objc_exception_throw
2  CoreFoundation    -[NSObject(NSObject) doesNotRecognizeSelector:]
3  CoreFoundation    ____forwarding___
4  CoreFoundation    ___forwarding_prep_0___
5  FBSDKCoreKit      FBSDKMonotonicTimeConvertMachUnitsToSeconds
6  FBSDKCoreKit      FBSDKMonotonicTimeConvertMachUnitsToSeconds
7  FBSDKCoreKit      sum
8  FBSDKCoreKit      sum
9  FBSDKCoreKit      sum
10 FBSDKCoreKit      sum
11 FBSDKCoreKit      sum
12 CoreFoundation    ___NSARRAY_IS_CALLING_OUT_TO_A_BLOCK__
13 CoreFoundation    -[__NSArrayM enumerateObjectsWithOptions:usingBlock:]
14 FBSDKCoreKit      sum
15 FBSDKCoreKit      sum
16 FBSDKCoreKit      sum
17 libdispatch.dylib __dispatch_call_block_and_release
18 libdispatch.dylib __dispatch_client_callout
19 libdispatch.dylib __dispatch_main_queue_callback_4CF
20 CoreFoundation    ___CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
21 CoreFoundation    ___CFRunLoopRun
22 CoreFoundation    _CFRunLoopRunSpecific
23 GraphicsServices  _GSEventRunModal
24 UIKitCore         _UIApplicationMain
25 APP      main (main.m:15:16)
26 libdyld.dylib     _start
marcinrabieko commented 4 years ago

Same here, error: 2020-07-10 12:44:08.381843+0200 CircleHood[64665:6686422] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull count]: unrecognized selector sent to instance 0x7fff8062d9d0'

Full call stack:


    0   CoreFoundation                      0x00007fff23e3cf0e __exceptionPreprocess + 350
    1   libobjc.A.dylib                     0x00007fff50ba89b2 objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff23e5dc34 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
    3   CoreFoundation                      0x00007fff23e4190c ___forwarding___ + 1436
    4   CoreFoundation                      0x00007fff23e43bf8 _CF_forwarding_prep_0 + 120
    5   FBSDKCoreKit                        0x000000010ccec950 +[FBSDKEventDeactivationManager updateDeactivatedEvents:] + 144
    6   FBSDKCoreKit                        0x000000010cd46c87 +[FBSDKServerConfigurationManager processLoadRequestResponse:error:appID:] + 3575
    7   FBSDKCoreKit                        0x000000010cd145f2 __69+[FBSDKGraphRequestPiggybackManager addServerConfigurationPiggyback:]_block_invoke + 178
    8   FBSDKCoreKit                        0x000000010cd11914 -[FBSDKGraphRequestMetadata invokeCompletionHandlerForConnection:withResults:error:] + 260
    9   FBSDKCoreKit                        0x000000010cd0d020 __82-[FBSDKGraphRequestConnection processResultBody:error:metadata:canNotifyDelegate:]_block_invoke + 256
    10  FBSDKCoreKit                        0x000000010cd0ce33 -[FBSDKGraphRequestConnection processResultBody:error:metadata:canNotifyDelegate:] + 1139
    11  FBSDKCoreKit                        0x000000010cd0c940 __64-[FBSDKGraphRequestConnection completeWithResults:networkError:]_block_invoke + 1504
    12  CoreFoundation                      0x00007fff23e0b287 __NSARRAY_IS_CALLING_OUT_TO_A_BLOCK__ + 7
    13  CoreFoundation                      0x00007fff23d511f4 -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 228
    14  FBSDKCoreKit                        0x000000010cd0c1e4 -[FBSDKGraphRequestConnection completeWithResults:networkError:] + 1124
    15  FBSDKCoreKit                        0x000000010cd0abf6 -[FBSDKGraphRequestConnection completeFBSDKURLSessionWithResponse:data:networkError:] + 2310
    16  FBSDKCoreKit                        0x000000010cd0725d __36-[FBSDKGraphRequestConnection start]_block_invoke_3 + 189
    17  FBSDKCoreKit                        0x000000010cd0f1c8 __73-[FBSDKGraphRequestConnection invokeHandler:error:response:responseData:]_block_invoke + 72
    18  libdispatch.dylib                   0x0000000111752f11 _dispatch_call_block_and_release + 12
    19  libdispatch.dylib                   0x0000000111753e8e _dispatch_client_callout + 8
    20  libdispatch.dylib                   0x0000000111761d97 _dispatch_main_queue_callback_4CF + 1149
    21  CoreFoundation                      0x00007fff23da0909 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    22  CoreFoundation                      0x00007fff23d9b459 __CFRunLoopRun + 2041
    23  CoreFoundation                      0x00007fff23d9a944 CFRunLoopRunSpecific + 404
    24  GraphicsServices                    0x00007fff38ba6c1a GSEventRunModal + 139
    25  UIKitCore                           0x00007fff48c8b9ec UIApplicationMain + 1605
    26  CircleHood                          0x0000000109d5313b main + 75
    27  libdyld.dylib                       0x00007fff51a231fd start + 1
    28  ???                                 0x0000000000000001 0x0 + 1

I am using Cocoapods to include the library. The version I am using is pod 'FBSDKLoginKit', '6.2.0'

rjt3662 commented 4 years ago

I'm also having crash on app launch but the error is a bit different: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull count]: unrecognized selector sent to instance 0x7fff8062d9d0' Started suddenly before 10-15 minutes. Also, I'm using Swift Package Dependencies. I hope it doesn't makes any difference.

azubala commented 4 years ago

Yup the case is that events dict is nil, crashes our app on startup as well:

Screenshot 2020-07-10 at 13 01 13
jerrylee007 commented 4 years ago

Also have the same issue here.

haarj commented 4 years ago

Same here

jesusmateos1234 commented 4 years ago

Same, events seems like an NSNull instance so, the if conditional if ([[NSNull alloc] init]) returns true and call to this method being event an NSNULL that not responds to count property

TeaNguyen commented 4 years ago

Same issue

Screen Shot 2020-07-10 at 18 16 10
mattiacantalu commented 4 years ago

Same here (again!)

 FBSDKEventDeactivationManager.m line 64
+[FBSDKEventDeactivationManager updateDeactivatedEvents:] 
azubala commented 4 years ago

Bug status page can be found here: https://developers.facebook.com/status/issues/1739188102911114/

rjt3662 commented 4 years ago

The crash seems to persist in real device but not in simulator. I'm also confused by saying this. LoL

marcinrabieko commented 4 years ago

The crash seems to persist in real device but not in simulator.

It crash simulator too.

stale[bot] commented 4 years ago

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.