Skip to content
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

-[NSNull count]: unrecognized selector sent to instance 0x22d0ed7f0 #1430

Closed
Neil20170220 opened this issue Jul 10, 2020 · 122 comments
Closed

-[NSNull count]: unrecognized selector sent to instance 0x22d0ed7f0 #1430

Neil20170220 opened this issue Jul 10, 2020 · 122 comments

Comments

@Neil20170220
Copy link

Neil20170220 commented Jul 10, 2020

SDK version: iOS 6.5.2

图片

@Neil20170220
Copy link
Author

Please help

@ferico55
Copy link

Screen Shot 2020-07-10 at 17 37 06

here's better stack trace

@barisyazganc
Copy link

Same here! shame on you FB!! what should we do now? just wait for them to release their mistake and rollback?

@shengyang998
Copy link

#1374

@vladambartsumyan
Copy link

same here
pod 'FBSDKCoreKit', '5.5.0'
pod 'FBSDKShareKit', '5.5.0'
pod 'FBSDKLoginKit', '5.5.0'

@danwey
Copy link

danwey commented Jul 10, 2020

same here
6.3.0 and 5.0.2

@georgescumihai
Copy link

Version 7.0 same issue

@TheyCallMeTank
Copy link

same
pod 'FBSDKCoreKit', '5.8.0'
pod 'FBSDKLoginKit', '5.8.0'
pod 'FBSDKShareKit', '5.8.0'

@jolyot
Copy link

jolyot commented Jul 10, 2020

same here

Using FBSDKCoreKit (5.13.1)
Using FBSDKLoginKit (5.13.1)

@yaminoma
Copy link

Same Issue
When will it be fixed?

@olenhad
Copy link

olenhad commented Jul 10, 2020

Same issue here with 5.5.0

@racer1988
Copy link

+1

@zavsby
Copy link

zavsby commented Jul 10, 2020

Same here, more then 500K of crashes for only last 20 minutes... Is anybody from FB stuff here? It seems the same crashes we had several months ago when almost all apps were affected and not launching.

@Sanich63
Copy link

Screenshot 2020-07-10 at 14 54 12

@acali18
Copy link

acali18 commented Jul 10, 2020

Same issue, right where @Sanich63 shows on the screenshot

@fireup
Copy link

fireup commented Jul 10, 2020

OH COME ON! Not again! Your crash has halted Firebase crashlytics again!

@DarrenDuXuan
Copy link

image
restrictive_data_filter_params NSNull.count

@jonashinge
Copy link

same here using 7.0.0.

@dvdchr
Copy link

dvdchr commented Jul 10, 2020

I'm suspecting that this might be a backend related issue from FB side, because crash happens on an app that's released a month ago with no update whatsoever to FB SDK. Maybe some wrong values gets sent from their feature flag server or something, and causes crash on the client.

Hope FB can roll back whatever changes quickly.

@magnett
Copy link

magnett commented Jul 10, 2020

7.0.0 is crashing, 7.1.1 seems stable

@hemanthmpkumar
Copy link

+1

@abuharsky
Copy link

+1 crashing

1 similar comment
@Balashov152
Copy link

+1 crashing

@Tomoy
Copy link

Tomoy commented Jul 10, 2020

Oh god, this is happening again, crashing to all my users

@darlanxw
Copy link

+1 crashing

@zavsby
Copy link

zavsby commented Jul 10, 2020

Seems it's night in US and no one react from FB...

@Mehul1437
Copy link

Same here +1 crashing

@demensdeum
Copy link

@apogodin must be:
@interface NSNull (FacebookFix)

@hardW
Copy link

hardW commented Jul 10, 2020

For me updating FBSDKLoginKit and FBSDKShareKit to 5.15.1 (was 5.5.0) seem to fix an issue. Please double check.

@apogodin
Copy link

@apogodin must be:
@interface NSNull (FacebookFix)

"FacebookFix" should be in investing in ObjC developers

@iliaprokhorov
Copy link

@apogodin This case is raising warning in Swift

@sandeee1928
Copy link

sandeee1928 commented Jul 10, 2020

Here’s the facebook bug page, https://developers.facebook.com/support/bugs/329763701368293/

@Suvitruf
Copy link

2fb0e0593a6a0a07de957de7bf14fe3b

@sergey-zhuravel
Copy link

pidary zaebali

@Salman144017
Copy link

For me updating FBSDKLoginKit and FBSDKShareKit to 5.15.1 (was 5.5.0) seem to fix an issue. Please double check.

I am using 5.15.1 and it was crashing initially but now its fixed for about half an hour ago.

@Ricowere
Copy link

FB guys; The problem seems to be happening when a NSNull object is been passed by parameter... So nullable annotation here was not enough...

You will have to revisit all the library to add a if is instance of NSNull then return? 😄

https://github.com/facebook/facebook-ios-sdk/blob/master/FBSDKCoreKit/FBSDKCoreKit/AppEvents/Internal/EventDeactivation/FBSDKEventDeactivationManager.m#L71

https://github.com/facebook/facebook-ios-sdk/blob/master/FBSDKCoreKit/FBSDKCoreKit/AppEvents/Internal/EventDeactivation/FBSDKEventDeactivationManager.m#L99

https://github.com/facebook/facebook-ios-sdk/blob/master/FBSDKCoreKit/FBSDKCoreKit/AppEvents/Internal/EventDeactivation/FBSDKEventDeactivationManager.m#L112

@cruftyoldsysadmin
Copy link

Using anything from Facebook is considered harmful to your business, unless you are Facebook.

@Salman144017
Copy link

It has started working now. I believe they reverted the change.

I am using 5.15.1 and it was crashing initially but now its fixed for about half an hour ago. Try updating to 5.15.1.

@hardW
Copy link

hardW commented Jul 10, 2020

For me updating FBSDKLoginKit and FBSDKShareKit to 5.15.1 (was 5.5.0) seem to fix an issue. Please double check.

I am using 5.15.1 and it was crashing initially but now its fixed for about half an hour ago.

If to switch back to 5.5.0 for me it crashes even now( So I guess there is fix that is working for 5.15.1 (or lower?) now.

@dyumin
Copy link

dyumin commented Jul 10, 2020

Temporary fix while developing

@interface NSNull (Fix)
- (NSUInteger)count;
@end
...
@implementation NSNull (Fix)
- (NSUInteger)count
{
    return 0;
}
@end

It's also possible to swizzle updateFilters: and call original implementation with empty NSDictionary in case NSNull is passed. This should do the trick for production hotfix.

@own2pwn
Copy link

own2pwn commented Jul 10, 2020

nu 4e zato O(n) mojem

@TheNamesJamesW
Copy link

TheNamesJamesW commented Jul 10, 2020

This should do the trick for production hotfix

How quickly can your app be submitted, reviewed, approved and then have users update? Before FB issues a fix?
What a Race Condition! 🏎

@diskman86
Copy link

Seems Facebook fixed it. Can anyone confirm?

@alekseenkodev
Copy link

alekseenkodev commented Jul 10, 2020

Seems Facebook fixed it. Can anyone confirm?

yes

@chriscborg
Copy link

yes fixed

@zavsby
Copy link

zavsby commented Jul 10, 2020

yes, it's fixed now.

@abekert abekert mentioned this issue Jul 10, 2020
4 tasks
@varyP
Copy link

varyP commented Jul 10, 2020

Might not be crashing, but we are unable to verify token from our backend. Guess facebook has turned if off for a while.

@Mart-Bogdan
Copy link

You should definitely RIIR to make it more memory-safe!

@joesus
Copy link
Contributor

joesus commented Jul 10, 2020

Duplicate of #1427

@joesus joesus marked this as a duplicate of #1427 Jul 10, 2020
@joesus joesus closed this as completed Jul 10, 2020
@mzying2013
Copy link

我写了一个关于这个问题的文章,包含以后此类问题的预防方法: https://blog.mzying.com/index.php/archives/231/

@wangguan1
Copy link

我写了一个关于这个问题的文章,包含以后此类问题的预防方法: https://blog.mzying.com/index.php/archives/231/

这个bug服了,OC里基本类型检查都没有

joesus pushed a commit to joesus/facebook-ios-sdk that referenced this issue Jul 15, 2020
facebook#1439)

Summary:
- [x] sign [contributor license agreement](https://developers.facebook.com/opensource/cla)
- [ ] I've ensured that all existing tests pass and added tests (when/where necessary)
- [ ] I've updated the documentation (when/where necessary) and [Changelog](CHANGELOG.md) (when/where necessary)
- [ ] I've added the proper label to this pull request (e.g. `bug` for bug fixes)

## Pull Request Details

## Issues
- [1430](facebook#1430)
- [1432](facebook#1432)
Describe what you accomplished in this pull request (for example, what happens before the change, and after the change)

1. In my case, in the response in the `serverConfigurationRequest`, the value for `restrictive_data_filter_params` is `null`. Yes!!! `null` is a valid value in [`JSON` starndard](https://www.json.org/json-en.html).
![image](https://user-images.githubusercontent.com/7471672/87173868-f5d8c400-c308-11ea-81fd-699c5443a43e.png)

2. Then after FB using `[NSJSONSerialization JSONObjectWithData: options: error:]` to serialize this object, it returns `NSNull` object without error, which is under expectation from Apple side. According to Apple's doc, `NSNull` is a singleton object. Yes!!!, it is a valid object, not like `nil`, which you can guard using `if (obj)` statement

![image](https://user-images.githubusercontent.com/7471672/87174136-57009780-c309-11ea-9a0a-ca24369e96f9.png)

3. So, when FB try to use `if (serializedObj) { ... }` to guard this edge cases in many places, it is actually useless. Here `serializedObj` is a singleton object, the result is YES then it continues to send message, then, `unrecoginized selector` .  This issue haven't been fixed. Next time, when the server side sends an another object with `null`, we will see another disaster, a third disaster.

So,  I made these changes for 3 reason:

1. `null` is a valid value in [`JSON` starndard](https://www.json.org/json-en.html).
2. `[NSJSONSerialization JSONObjectWithData: options: error:]` will return `NSNull` singleton object for `null` value in Object, it is under expectation.
3. There are too many places in this SDK using the result of `[NSJSONSerialization JSONObjectWithData: options: error:]` without check `NSNull`.  This is could be an easier way to handle this edge case.

Pull Request resolved: facebook#1439

Test Plan: **Add your test plan here**

Differential Revision: D22484108

Pulled By: joesus

fbshipit-source-id: 42e2c42074885e683b627b499e65a8144fdcc2b2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests