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

Crash in FBSDKRestrictiveDataFilterManager.m line 80 #1374

Closed clayjonezie closed 4 years ago

clayjonezie 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

What do you want to achieve?

We are using FBSDK in our app as an authentication option

Expected Results

What do you expect to happen?

I would like FBSDK to not crash

Actual Results

What actually happened? Can you provide a stack trace?

FBSDK is crashing at a large volume.

Steps to Reproduce

What are the steps necessary to reproduce this issue?

I'm not sure yet, this is happening intermittently (but at a high volume) in the field.

Code Samples & Details

Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x1a5c2896c __exceptionPreprocess
1  libobjc.A.dylib                0x1a5941028 objc_exception_throw
2  CoreFoundation                 0x1a5b26dcc -[NSOrderedSet initWithSet:copyItems:]
3  CoreFoundation                 0x1a5c2d048 ___forwarding___
4  CoreFoundation                 0x1a5c2f3a0 _CF_forwarding_prep_0
5  FBSDKCoreKit                   0x1039830cc +[FBSDKRestrictiveDataFilterManager updateFilters:] + 80 (FBSDKRestrictiveDataFilterManager.m:80)
6  FBSDKCoreKit                   0x103985f34 +[FBSDKServerConfigurationManager processLoadRequestResponse:error:appID:] + 240 (FBSDKServerConfigurationManager.m:240)
7  FBSDKCoreKit                   0x103985750 __78+[FBSDKServerConfigurationManager loadServerConfigurationWithCompletionBlock:]_block_invoke + 161 (FBSDKServerConfigurationManager.m:161)
8  FBSDKCoreKit                   0x103969c5c -[FBSDKGraphRequestMetadata invokeCompletionHandlerForConnection:withResults:error:] + 41 (FBSDKGraphRequestMetadata.m:41)
9  FBSDKCoreKit                   0x103967534 __82-[FBSDKGraphRequestConnection processResultBody:error:metadata:canNotifyDelegate:]_block_invoke + 806 (FBSDKGraphRequestConnection.m:806)
10 FBSDKCoreKit                   0x103967428 -[FBSDKGraphRequestConnection processResultBody:error:metadata:canNotifyDelegate:] + 839 (FBSDKGraphRequestConnection.m:839)
11 FBSDKCoreKit                   0x103967038 __64-[FBSDKGraphRequestConnection completeWithResults:networkError:]_block_invoke + 788 (FBSDKGraphRequestConnection.m:788)
12 CoreFoundation                 0x1a5bfa66c __NSARRAY_IS_CALLING_OUT_TO_A_BLOCK__
13 CoreFoundation                 0x1a5af822c -[__NSArrayM enumerateObjectsWithOptions:usingBlock:]
14 FBSDKCoreKit                   0x103966dfc -[FBSDKGraphRequestConnection completeWithResults:networkError:] + 767 (FBSDKGraphRequestConnection.m:767)
15 FBSDKCoreKit                   0x1039662b0 -[FBSDKGraphRequestConnection completeFBSDKURLSessionWithResponse:data:networkError:] + 634 (FBSDKGraphRequestConnection.m:634)
16 FBSDKCoreKit                   0x10396443c __36-[FBSDKGraphRequestConnection start]_block_invoke_3 + 242 (FBSDKGraphRequestConnection.m:242)
17 libdispatch.dylib              0x1a58ccb7c _dispatch_call_block_and_release
18 libdispatch.dylib              0x1a58cdfd8 _dispatch_client_callout
19 libdispatch.dylib              0x1a58d9cc8 _dispatch_main_queue_callback_4CF
20 CoreFoundation                 0x1a5ba3cc8 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
21 CoreFoundation                 0x1a5b9ea24 __CFRunLoopRun
22 CoreFoundation                 0x1a5b9df40 CFRunLoopRunSpecific
23 GraphicsServices               0x1afe2e534 GSEventRunModal
24 UIKitCore                      0x1a9d29580 UIApplicationMain
25 AllTrails                      0x10233876c main + 21 (UIDevice+Storage.swift:21)
26 libdyld.dylib                  0x1a5a1ce18 start
andyjohns commented 4 years ago

If you're really curious about what they're doing, just capture it with Charles Proxy. On my app it looks like they're making four calls, three POSTs and a GET, to graph.facebook.com. Haven't spent any time analyzing it, but it looks like they're sending some basic info about the running environment. I see the SDK version in there, our SDK key. Looks like configuration data coming back. Analytics tracking I expect....

so898 commented 4 years ago

Maybe it's time to reverse-engineering FB SDK and making a real open source FB login SDK.

krunalsshah commented 4 years ago

Our iOS app is still reporting crashes, for others, have your app's recovered 100%? Snippet from our error monitoring & reporting tool, still alerting the crash.

-[__NSCFBoolean objectForKeyedSubscript:]: unrecognized selector sent to instance 0x1e8da5d00

Anyone from the Facebook core team can provide a detailed analysis of the problem?

The question to the Facebook core team

Can we have a configuration to lazy load the initialization only when the app feature requires it?

mrpuzzler commented 4 years ago

Same here:

Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x182aa4a48 __exceptionPreprocess
1  libobjc.A.dylib                0x1827cbfa4 objc_exception_throw
2  CoreFoundation                 0x1829a85a8 -[NSOrderedSet initWithSet:copyItems:]
3  CoreFoundation                 0x182aa8af4 ___forwarding___
4  CoreFoundation                 0x182aaaa7c _CF_forwarding_prep_0
5  Game                           0x10058c31c +[FBSDKRestrictiveDataFilterManager updateFilters:] + 80 (FBSDKRestrictiveDataFilterManager.m:80)
6  Game                           0x10058eda8 +[FBSDKServerConfigurationManager processLoadRequestResponse:error:appID:] + 241 (FBSDKServerConfigurationManager.m:241)
7  Game                           0x10058e600 __78+[FBSDKServerConfigurationManager loadServerConfigurationWithCompletionBlock:]_block_invoke + 163 (FBSDKServerConfigurationManager.m:163)
8  Game                           0x1005783c0 -[FBSDKGraphRequestMetadata invokeCompletionHandlerForConnection:withResults:error:] + 41 (FBSDKGraphRequestMetadata.m:41)
9  Game                           0x100575cdc __82-[FBSDKGraphRequestConnection processResultBody:error:metadata:canNotifyDelegate:]_block_invoke + 806 (FBSDKGraphRequestConnection.m:806)
10 Game                           0x100575bd0 -[FBSDKGraphRequestConnection processResultBody:error:metadata:canNotifyDelegate:] + 839 (FBSDKGraphRequestConnection.m:839)
11 Game                           0x1005757e0 __64-[FBSDKGraphRequestConnection completeWithResults:networkError:]_block_invoke + 788 (FBSDKGraphRequestConnection.m:788)
12 CoreFoundation                 0x182a7795c __NSARRAY_IS_CALLING_OUT_TO_A_BLOCK__
13 CoreFoundation                 0x18297aed0 -[__NSArrayM enumerateObjectsWithOptions:usingBlock:]
14 Game                           0x1005755a4 -[FBSDKGraphRequestConnection completeWithResults:networkError:] + 767 (FBSDKGraphRequestConnection.m:767)
15 Game                           0x100574a60 -[FBSDKGraphRequestConnection completeFBSDKURLSessionWithResponse:data:networkError:] + 634 (FBSDKGraphRequestConnection.m:634)
16 Game                           0x100572c9c __36-[FBSDKGraphRequestConnection start]_block_invoke_3 + 242 (FBSDKGraphRequestConnection.m:242)
freezy7 commented 4 years ago

The crash is still report, and it make the firebase could not refresh out new data. 😠

mattiacantalu commented 4 years ago

Same situation here.. We're using 'FBSDKLoginKit', '5.15.1' (built with Xcode 11.3.1) and the crash is reported live on our users! Please Facebook, provide a fix asap 😰

bhvk commented 4 years ago

Are we ready to ask the real questions here?

Why the heck does Facebook do unwanted requests during my apps startup? What kind of info are they sending back to their servers?

@kazzkiq Checkout Off-Facebook activity logging : https://en-gb.facebook.com/off-facebook-activity They are going to be the new NSA I presume.

BradKwon commented 4 years ago

I've got some crash report of this last night but it looks stable now although I have tried to log in via Facebook app once. However, better to keep monitoring it since there is not clear fix yet. My app uses SDK v5.6.0 and logged in from Germany.

sree127 commented 4 years ago

Same. Looks "kinda" stable now. No crashes in the last 60 mins at least. 👀

pepejeria commented 4 years ago

https://www.theverge.com/2020/5/6/21250023/facebook-sdk-login-spotify-tinder-tiktok-ios-iphone-crash

“Earlier today, a new release of Facebook included a change that triggered crashes for some users in some apps using the Facebook iOS SDK,” a Facebook spokesperson said in a statement to The Verge. “We identified the issue quickly and resolved it. We apologize for any inconvenience.”

mqlsq commented 4 years ago

启动后你他娘的瞎更新啥?能不能安分一点儿???

我们的所有App都中招

我们也是,损失惨重

mifi commented 4 years ago

This is why I like to keep the number of native dependencies in my react-native apps to the minimum

syedanabimam commented 4 years ago

image

elecCore commented 4 years ago

启动后你他娘的瞎更新啥?能不能安分一点儿???

我们的所有App都中招

我们也是,损失惨重

心都碎了,苦苦维持线上1‰的崩溃率,一个更新给我拉升了2%纯涨了2%!是2%!不是2‰!

AustinConlon commented 4 years ago

This thread should be canonized in the Computer History Museum.

DeepakTivari commented 4 years ago

Facebook and their spywares

dongshuju commented 4 years ago

启动后你他娘的瞎更新啥?能不能安分一点儿???

我们的所有App都中招

我们也是,损失惨重

心都碎了,苦苦维持线上1‰的崩溃率,一个更新给我拉升了2%纯涨了2%!是2%!不是2‰!

一夜回到解放前

AustinConlon commented 4 years ago

In 2014 Facebook updated the company mantra and it was a wonderful thought. Any chance we could have it added to this repository's README?

tumblr_n4uvx6ZXSk1sxqyhyo1_1280

santaasus commented 4 years ago

I have some issue in restrictiveParams[eventName][@"is_deprecated_event"], but there isn't condition for dictionary like [restrictiveParams objectForKey], there is force unwrap by key

AustinConlon commented 4 years ago

All rise for the Facebook iOS SDK anthem.

Anti-Patterns Coding practices you should avoid Anti-Patterns So your app don’t crater like a meteoroid

Whether you’re a newbie or here since NeXTSTEP 3.3 There’s a chance you’ve picked up some bad habits So take my advice, make your code play nice Or the bugs will multiply like rabbits Doo, doo da doo doo

Anti-Patterns Yeah, you know they’re gonna bite you somewhere down the line Anti-Patterns Even if the code seems to work at the time

RubenKelevra commented 4 years ago

Quite interesting how many apps report each startup to Facebook... probably with the user ID.

You should consider to remove the Facebook functionality from your app entirely.

balazserd commented 4 years ago

Quite interesting how many apps report each startup to Facebook... probably with the user ID.

You should consider to remove the Facebook functionality from your app entirely.

Yup. If you actually look at what Facebook does is it immediately sends all device info + carrier and also adds an advertisement ID.

I bet a lot of apps don't disclose this information in their privacy policies.

PatoGuereque commented 4 years ago

I don't know what's scarier, the fact that this basically acted as a remote kill switch for hundreds of apps or that the SDK silently sends data on startup

allenday commented 4 years ago

Maybe it's time to reverse-engineering FB SDK and making a real open source FB login SDK.

Maybe it's time that we take responsibility for managing our own private keys and move beyond SSO services for personal data.

ArtFeel commented 4 years ago

@balazserd It also swizzle all your UIView, UITextField, UIControl, etc., and add StoreKit observer, to know all about what your users see and theirs purchases.

allenday commented 4 years ago

I don't know what's scarier, the fact that this basically acted as a remote kill switch for hundreds of apps or that the SDK silently sends data on startup

The functional code should be scary to you.

The kill switch should be scary to FB.

The latter because it raised FB's intentional behavior of harvesting user data to the level of awareness of developers.

nirui commented 4 years ago

In 2014 Facebook updated the company mantra and it was a wonderful thought. Any chance we could have it added to this repository's README?

tumblr_n4uvx6ZXSk1sxqyhyo1_1280

The app crashed while trying to output INFRASTRUCTURE.

cailinpitt commented 4 years ago

This was a real eye-opening experience. Might have to stop using a lot of the apps that have been communicating with Facebook without my knowledge.

behdaad commented 4 years ago

Let this be a lesson to all of us. We all make mistakes, even the best of us. Stay safe, stay humble.

petermjones commented 4 years ago

Facebook fixing the server configuration is not good enough. At least two things must be done:

  1. SDK should not crash, regardless of what information comes back from Facebook's servers.
  2. Full transparency as to why it is connecting and what information is being shared.

As App writers, we're deliberately ignoring the fact that the more dependencies you have, the more brittle our systems become. We need to re-think that strategy.

tianqibt commented 4 years ago

A new release of Facebook included a change that triggered crashes for some users in some apps using the Facebook iOS SDK. We identified the issue quickly and resolved it. We apologize for any inconvenience

krunalsshah commented 4 years ago

Thanks for fixing the issue.

Our iOS app is still reporting crashes, for others, not sure if the apps have recovered 100%? @tianqibt what do your monitoring tools show?

We'd appreciate more details.

Snippet from our error monitoring & reporting tool, still alerting the crash.

-[__NSCFBoolean objectForKeyedSubscript:]: unrecognized selector sent to instance 0x1e8da5d00
timuren commented 4 years ago

How many apps out there still appear to be impacted?

akhilpothana commented 4 years ago

Facebook fixing the server configuration is not good enough. At least two things must be done:

  1. SDK should not crash, regardless of what information comes back from Facebook's servers.
  2. Full transparency as to why it is connecting and what information is being shared.

As App writers, we're deliberately ignoring the fact that the more dependencies you have, the more brittle our systems become. We need to re-think that strategy.

@petermjones exactly! especially the fact that even a large well versed tech company's sdk can break

lordzsolt commented 4 years ago

Thanks for fixing the issue.

Our iOS app is still reporting crashes, for others, not sure if the apps have recovered 100%? @tianqibt what do your monitoring tools show?

We'd appreciate more details.

  • Why does the initialization call fire at launch time, and not lazily loaded?
  • Is there a way to configure the SDK such that it could lazily load? And could that change propogate to react-native-fbsdk?

Snippet from our error monitoring & reporting tool, still alerting the crash.

-[__NSCFBoolean objectForKeyedSubscript:]: unrecognized selector sent to instance 0x1e8da5d00

How would you expect Facebook to track all your users if they don't fire at first launch?

virtadpt commented 4 years ago

They are going to be the new NSA I presume.

"Going to be?"

kconner commented 4 years ago

A new release of Facebook included a change that triggered crashes for some users in some apps using the Facebook iOS SDK. We identified the issue quickly and resolved it. We apologize for any inconvenience

@tianqibt To be clear, are you saying this was fixed on the server side, and released apps should no longer exhibit the crash? It's not necessary to update apps with a new Facebook SDK version?