Facebook iOS SDK [NSNull count]: unrecognized selector crash BIG - ios

Issue started about 11:20 UK time, and it affects many big applications like spotify, waze, medium and so on.
It looks like it related with event managers and analytics. Some of the apps that crashed 10 min ago, seems working now.
Can it be solved by changing any facebook dev settings?
Anyone able to solve it without waiting Facebook to solve?
For more info:
https://developers.facebook.com/status/issues/1739188102911114/
https://github.com/facebook/facebook-ios-sdk/issues/1430
https://developers.facebook.com/support/bugs/329763701368293/
4 CoreFoundation 0x00007fff23e43bf8 _CF_forwarding_prep_0 + 120
5 FBSDKCoreKit 0x000000010f736f3a +[FBSDKRestrictiveDataFilterManager updateFilters:] + 62
6 FBSDKCoreKit 0x000000010f739a0c +[FBSDKServerConfigurationManager processLoadRequestResponse:error:appID:] + 1912
7 FBSDKCoreKit 0x000000010f739281 __78+[FBSDKServerConfigurationManager loadServerConfigurationWithCompletionBlock:]_block_invoke + 62
8 FBSDKCoreKit 0x000000010f729110 -[FBSDKGraphRequestMetadata invokeCompletionHandlerForConnection:withResults:error:] + 143
9 FBSDKCoreKit 0x000000010f7269fe __82-[FBSDKGraphRequestConnection processResultBody:error:metadata:canNotifyDelegate:]_block_invoke + 142
10 FBSDKCoreKit 0x000000010f72690d -[FBSDKGraphRequestConnection processResultBody:error:metadata:canNotifyDelegate:] + 636
11 FBSDKCoreKit 0x000000010f72654d __64-[FBSDKGraphRequestConnection completeWithResults:networkError:]_block_invoke + 398

From my side, in the response, there is null value. Yes!!! null is a kind of primitive type in JSON specification.
Then after FB using [NSJSONSerialization JSONObjectWithData: options: error:] to serialize this object, it returns NSNull object without error. 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
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 now. Next time, when the server side sends an another object with null, we will see another disaster.
Updated:
FB is trying to fix this issue

Related

iOS 10 Preferences crashes when trying to add my custom keyboard

I am trying to develop my custom keyboard extension.
When i am trying to actually enable my keyboard from the settings it crashes. I go settings->general->keyboard->keyboards -> settings app crashes here.
My device log look like this:
2 CoreFoundation 0x183774108 +[NSException raise:format:] + 116
3 Foundation 0x18415f45c -[NSCountedSet addObject:] + 92
4 KeyboardSettings 0x1984a8058 +[TIKeyboardListController keyboardDisplayNameForIdentifier:] + 476
5 KeyboardSettings 0x1984a41a8 -[TIInputModeTableCell title] + 168
.....
So seems like this is somehow related to my extension display name. It is "SebastianCatKeyboard". I've tried to change it several times but crash is still there.
When i remove my container app with extension settings are not crashing. So this is definitely related to my keyboard.
I would really appreciate any help.
Many thanks.

CoreBluetooth [CBPeripheralManager respondToRequest:withResult:] assertion failure

Getting a strange crash fairly commonly among iPhones sending data between each other over bluetooth. After a lot of effort I still cannot reproduce it in the debugger.
Crash log:
NSInternalInconsistencyException
Invalid parameter not satisfying: request != nil
3 Foundation 0x0000000186d28ed4 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 108
4 CoreBluetooth 0x0000000185aec808 -[CBPeripheralManager respondToRequest:withResult:] + 156
5 CoreBluetooth 0x0000000185aee410 -[CBPeripheralManager handleSetAttributeValues:] + 1104
Don't know what triggers the peripheral manager to call handleSetAttributeValues or where the nil value is coming from here.
There is only one place in the codebase where I call [CBPeripheralManager respondToRequest:withResult:] and I have safeguards around it to ensure that it will never get called if request is nil.

splashboardd SIGABRT crash in IOS -- what could it mean?

I'm running corona SDK with a chartboost plugin, and I'm experiencing crashes about 20% of the time at startup, when I try to initialize the plugin (which I can't edit, I don't have the source).
Here's the symbolicated crash report: http://pastebin.com/id1AsjmN
I've been reading up a little on how to make sense of these crash reports, and from what I understand, these two frames in the main thread:
9 CoreFoundation 0x295d9008 +[NSException raise:format:arguments:] + 100
10 Foundation 0x2a2d8bc4 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 88
Are the most critical to understanding my problem. How can I understand what these lines mean? The "object:file:lineNumber:description:" and "raise:format:arguments:" business seems almost cruel, because I feel like those should be filled in with information that would help me -- what class, and line number we're talking about. Am I right? Are these placeholders in the error message? What am I not grokking here? Is there ANY way of knowing where this error came from?
It's not symbolicated crash log. To be more precise, partially symbolicated.
9 CoreFoundation 0x295d9008 +[NSException raise:format:arguments:] + 100
10 Foundation 0x2a2d8bc4 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 88
11 UIKit 0x2d00946e -[UINib initWithNibName:directory:bundle:] + 158
12 UIKit 0x2d00955c +[UINib nibWithNibName:bundle:] + 56
13 splashboardd 0x000bee8c 0xbc000 + 11916
Somewhere in your splashboard code something is called (0x000bee8c 0xbc000 + 11916 - not symbolicated). This calls +[UINib nibWithName:bundle:], which calls -[UINib initWithNibName:directory:bundle:], which causes your crash.
Google for How to symbolicate crash log and when you'll succeed, 0xbc000 + 11916 will be replaced with class name, method name, line number, ... That's the place where the problem is. Also that's the reason why you should keep debug symbols for your app as well. To be able to symbolicate it.
Also sometimes there's useful info in console as well. Additional messages, which can help you with debugging.

SceneKit crash in unknown (internal?) method

I'm trying to integrate some third-party SceneKit code into my app, and I'm experiencing a mysterious crash. Oddly, the crash gives no error or log in Xcode, and the stack trace is just "UIApplicationMain". No helpful info there.
The code works in the third-party app where I got it and I've copied it wholesale, so I know it must be some delegate call or some framework that I haven't included, etc. But this is my first experience with SceneKit so I'm having trouble closing in on what it could be.
The crash happens during an event where the user taps on the screen and a new 3D object is added to the scene. I've breakpointed all the associated methods, and the crash seems to be happening in the in-between time, presumably the internal SceneKit functionality, so I can't pinpoint it.
My Crashlytics report, though, did pick up some info, which I have included here:
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x00981ea8 _objc_empty_cache
1 SceneKit 0x015e0273 __28-[SCNPhysicsBody _setOwner:]_block_invoke + 214
2 SceneKit 0x016b05b5 C3DTransactionFlush + 2014
3 CoreFoundation 0x00bff86e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
4 CoreFoundation 0x00bff7b0 __CFRunLoopDoObservers + 400
5 CoreFoundation 0x00bf51ea __CFRunLoopRun + 1226
6 CoreFoundation 0x00bf4a5b CFRunLoopRunSpecific + 443
7 CoreFoundation 0x00bf488b CFRunLoopRunInMode + 123
8 GraphicsServices 0x043042c9 GSEventRunModal + 192
9 GraphicsServices 0x04304106 GSEventRun + 104
10 UIKit 0x01b99106 UIApplicationMain + 1526
11 SW LiveSheet 0x0007888a main (main.m:14)
12 libdyld.dylib 0x04e61ac9 start + 1
A search of my project finds no examples of SCNPhysicsBody _setOwner:, so I'm assuming that is an internal SceneKit method?
Does anyone know what might be causing a crash like this? I'll include any methods that might be relevant (if you tell me what they might be), but the series of methods to create the object is very long, so it didn't seem productive to blindly copy it all here. Plus, as I said, the crash seems to be happening "between the methods" anyway.
Does anyone recognize this error? Or are there any common "getting started with SceneKit" mistakes that I might be making, that could lead to this? I know the code works because it works in the other project, it's just a matter of what got lost in translation. Also, the scene does load successfully before the tap begins the process of adding the new object.
Can anyone point me in the right direction? Even just an idea of where to investigate would be appreciated.
Thanks for helping out a SceneKit newbie!
Weirdly, the answer ended up being just running the app on a device. I never could figure out what was wrong in the Simulator, but as soon as I tried running it on a device, it worked without changing anything!
Frustrating, to try to hunt down a solution for such a weird thing, but hopefully this will help anyone who experiences something similar.
If you're doing something with SceneKit and you're getting a bizarre error like this, try running it on a device before you tear too much of your hair out.

VectorKit MapKit stack overflow crash

We are seeing a strange crash in our map based iOS app that I cannot figure out. Basically as some point the following lines of code repeat over and over, more than 100 times in crash log:
6 VectorKit 0x000000019050c6f8 __86-[VKMapCameraController _animateToPosition:pitch:yaw:duration:timingCurve:completion:]_block_invoke347 + 40
7 VectorKit 0x0000000190485a30 -[VKAnimation _stopAnimation:] + 140
8 VectorKit 0x0000000190488b20 -[VKMapCameraController setYaw:animated:] + 100
9 MapKit 0x000000018540263c -[MKMapView snapToNorth:] + 148
before finally calling:
0 CoreFoundation 0x0000000183251e38 _CFArrayReplaceValues + 152
1 CoreFoundation 0x000000018332876c __CFRepositionTimerInMode + 108
2 CoreFoundation 0x000000018332876c __CFRepositionTimerInMode + 108
3 CoreFoundation 0x0000000183272630 CFRunLoopTimerSetNextFireDate + 580
4 MapKit 0x00000001853e8588 -[MKMapView _didChangeRegionMidstream:] + 196
5 MapKit 0x0000000185404e90 -[MKMapView mapLayer:didChangeRegionAnimated:] + 60
where _CGArrayReplaceValues crashes with a EXC_BAD_ACCESS KERN_PROTECTION_FAILURE at 0x000000016fccbef0 error.
I'd like to point out we never directly call any of the methods in this crash report, in fact VectorKit is completely private Apple framework. The only thing we ever do in the app remotely related is call basic setRegion:animated: methods, usually after a user taps an annotation to center on said annotation. It is also worth pointing out this only happens on iOS 8. Not a single iOS 7 crash has been reported.
Here is a link for full crash report: http://crashes.to/s/f09eb96c753
Any help is appreciated. Thank you.
Try enabling NSZombieEnabled. Once enabled, when an object reaches a retain count of 0, instead of being deallocated it'll morph itself into an NSZombie instance. When a zombie receives a message it will log a warning rather than crashing or behaving in an unpredictable way.
To be quite honest i'm not really sure why this is only crashing on iOS 8 and not iOS 7 but a EXC_BAD_ACCESS signal is the result of passing an invalid pointer to a system call, so you might be dereferencing a null pointer somewhere.
If the above NSZombieEnabled doesn't uncover the issue then try using the Static Analyzer.

Resources