[UIThreadSafeNode createPeripheral]: unrecognized selector sent to instance - ios

I tried to search about createPeripheral and i had no luck finding any information about it. Is there anyone here who had the same crash as this?
[UIThreadSafeNode createPeripheral]: unrecognized selector sent to instance
Which class does createPeripheral belong to?
How do you handle this crash?
note: there's not much information in the crash log
stackTrace =
(
0 CoreFoundation 0x31dcd2bb <redacted> + 186
1 libobjc.A.dylib 0x39a7297f objc_exception_throw + 30
2 CoreFoundation 0x31dd0e07 <redacted> + 170
3 CoreFoundation 0x31dcf531 <redacted> + 392
4 CoreFoundation 0x31d26f68 _CF_forwarding_prep_0 + 24
5 UIKit 0x33d4bf99 <redacted> + 52
6 UIKit 0x33bda80f <redacted> + 38
7 UIKit 0x33bda431 <redacted> + 404
8 UIKit 0x33f1ad19 <redacted> + 236
9 libdispatch.dylib 0x39e98621 <redacted> + 80
9 libdispatch.dylib 0x39e98621 <redacted> + 80
10 libdispatch.dylib 0x39e894b7 <redacted> + 22
11 libdispatch.dylib 0x39e8adcb <redacted> + 226
12 CoreFoundation 0x31da0f3b <redacted> + 1290
13 CoreFoundation 0x31d13ebd CFRunLoopRunSpecific + 356
14 CoreFoundation 0x31d13d49 CFRunLoopRunInMode + 104
15 GraphicsServices 0x358d72eb GSEventRunModal + 74
16 UIKit 0x33c29301 UIApplicationMain + 1120
...
);

Apologies for adding to an old post, but I do have a strong reproduction case for this bug. Open any software keyboard on the iPhone6+ (or iPhone6+ simulator) in a WebView. Put something in the paste-buffer, then click the paste button.
I haven't solved it yet, but I thought this might help if anyone is lost in google for this bug.

I've just got a similar crash report.
There is UIWebBrowserView in the call stack. Maybe it is a bug in it.
Our application uses UIWebView to show a simple html page, and I receive random crashes in WebView regulary. I have no idea what to do with it.

In my case this error occured when I tried to customize -inputaccessoryview on contenteditable div.
I believe createPeripheral has something to deal with Keyboard display as
webView.keyboardDisplayRequiresUserAction = NO;
solved this crash for me.

Related

-[UIThreadSafeNode canPerformAction:withSender:]: unrecognized selector sent to instance

I am facing this crash in my iOS app.
Fatal Exception: NSInvalidArgumentException
0 CoreFoundation 0x1b9079c30 __exceptionPreprocess
1 libobjc.A.dylib 0x1b8d940c8 objc_exception_throw
2 CoreFoundation 0x1b8f77fc0 -[NSOrderedSet initWithSet:copyItems:]
3 CoreFoundation 0x1b907e3d4 ___forwarding___
4 CoreFoundation 0x1b9080570 _CF_forwarding_prep_0
5 UIKitCore 0x1bcf33444 -[UIKeyboardImpl deleteForwardAndNotify:]
6 UIKitCore 0x1bcf39154 __57-[UIKeyboardImpl acceptPredictiveInput:executionContext:]_block_invoke
7 UIKitCore 0x1bcf5b0c8 -[UIKeyboardTaskExecutionContext returnExecutionToParentWithInfo:]
8 UIKitCore 0x1bcf366ec __100-[UIKeyboardImpl addWordTerminator:afterSpace:afterAcceptingCandidate:elapsedTime:executionContext:]_block_invoke
9 UIKitCore 0x1bcf5b0c8 -[UIKeyboardTaskExecutionContext returnExecutionToParentWithInfo:]
10 UIKitCore 0x1bcf2bdc0 __55-[UIKeyboardImpl handleKeyboardInput:executionContext:]_block_invoke_2
11 UIKitCore 0x1bcf5cd70 -[UIKeyboardTaskEntry execute:]
12 UIKitCore 0x1bcf5b6d4 -[UIKeyboardTaskQueue continueExecutionOnMainThread]
13 libobjc.A.dylib 0x1b8d8faf0 -[NSObject performSelector:withObject:]
14 Foundation 0x1b946ec10 __NSThreadPerformPerform
15 CoreFoundation 0x1b8ff5260 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
16 CoreFoundation 0x1b8ff51b4 __CFRunLoopDoSource0
17 CoreFoundation 0x1b8ff4920 __CFRunLoopDoSources0
18 CoreFoundation 0x1b8fef7ec __CFRunLoopRun
19 CoreFoundation 0x1b8fef098 CFRunLoopRunSpecific
20 GraphicsServices 0x1c3159534 GSEventRunModal
21 UIKitCore 0x1bd10f7ac UIApplicationMain
22 Haraj 0x102fc6058 main + 15 (main.m:15)
23 libdyld.dylib 0x1b8e6ef30 <redacted>
So far over a 100 crashes has been reported. This is happening only in iOS 12 and iOS 13.
I am not able to find how this is happening and how to reproduce it.
The stack trace does not show any of my app's code.
I have uploaded the full crash report here.
Any help would be highly appreciated.
This seems to be a regression of an ancient bug related to "forward delete" on iOS text entry: http://www.openradar.me/15114422
I believe it has regressed because of the new "swipe to type" keyboard.
You have 2 options to fix:
Upgrade your deprecated UIWebView to a WKWebView
Hacky solution: insert the missing selector on UIThreadSafeNode at runtime.
Here's a code example of how to insert the missing selector:
BOOL canPerformAction(id withSender) {
return false;
}
- (void)viewDidLoad {
[super viewDidLoad];
Class class = NSClassFromString(#"UIThreadSafeNode");
class_addMethod(class, #selector(canPerformAction:withSender:), (IMP)canPerformAction, "##:");
}
You should probably put the method insertion somewhere that only loads once, like in the AppDelegate.
Here's the full example project if you need it:
https://github.com/elliotfiske/UIWebView-TextEntry-CrashFix/tree/master
How to reproduce:
Create a text entry form in a UIWebView, type some words, then move the cursor to the exact END of a word in the middle of the sentence.
Then, choose any of the predictive text suggestions. See the bug in action here:

ios exception analyse NSInternalInconsistencyException

My app crash with a NSInternalInconsistencyException like this
Exception reason:NSInternalInconsistencyException
Exception name:Can't cancel on a touch that isn't already active!
Exception stack:(
0 CoreFoundation 0x0000000191a4d1d0 <redacted> + 148
1 libobjc.A.dylib 0x000000019048455c objc_exception_throw + 56
2 CoreFoundation 0x0000000191a4d08c <redacted> + 0
3 Foundation 0x000000019250502c <redacted> + 112
4 UIKit 0x0000000197fd1960 <redacted> + 404
5 UIKit 0x0000000197fcf970 <redacted> + 1648
6 libdispatch.dylib 0x00000001908d61fc <redacted> + 24
7 libdispatch.dylib 0x00000001908d61bc <redacted> + 16
8 libdispatch.dylib 0x00000001908e43dc <redacted> + 928
9 libdispatch.dylib 0x00000001908d99a4 <redacted> + 652
10 libdispatch.dylib 0x00000001908e634c <redacted> + 572
11 libdispatch.dylib 0x00000001908e60ac <redacted> + 124
12 libsystem_pthread.dylib 0x0000000190adf2a0 _pthread_wqthread + 1288
13 libsystem_pthread.dylib 0x0000000190aded8c start_wqthread + 4
)
How do i analyse the log? Like What do those number tags mean,"+ 148" "+ 56"...? How to detect the code that have invoked this exception.
Is this a crash from a release build of the app, or do you have it in Xcode? If in Xcode please provide the code causing the crash?
Looking at your report, the line
Can't cancel on a touch that isn't already active!
seems very telling. I would look through your code for anywhere you are interacting with a UITouch object, or perhaps a UIGestureRecognizer. My guess would be that somewhere you are manually calling to cancel an interaction that you should not be, and there is a race condition where that can sometimes happen after the system has already cancelled the touch (or vice versa, I guess).

iOS Exception Backtrace - App entry not symbolicating

I have received the below exception backtrace from Apple for an app I had submitted to the app store. I have symbolicated the log but my app's entry has not symbolicated. Any idea what I can do to achieve that? Please see Entry # 14 below which provides more detail. Any help would be much appreciated
Last Exception Backtrace:
0 CoreFoundation 0x1810cadb0 __exceptionPreprocess + 124
1 libobjc.A.dylib 0x18072ff80 objc_exception_throw + 56
2 UIKit 0x186b6d268 -[UIPopoverPresentationController presentationTransitionWillBegin] + 2884
3 UIKit 0x186581fb0 __71-[UIPresentationController _initViewHierarchyForPresentationSuperview:]_block_invoke + 1640
4 UIKit 0x1865800c8 __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 332
5 UIKit 0x1864d30c8 _runAfterCACommitDeferredBlocks + 292
6 UIKit 0x1864e0a80 _cleanUpAfterCAFlushAndRunDeferredBlocks + 92
7 UIKit 0x1862125a4 _afterCACommitHandler + 96
8 CoreFoundation 0x181080728 _CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
9 CoreFoundation 0x18107e4cc __CFRunLoopDoObservers + 372
10 CoreFoundation 0x18107e8fc __CFRunLoopRun + 928
11 CoreFoundation 0x180fa8c50 CFRunLoopRunSpecific + 384
12 GraphicsServices 0x182890088 GSEventRunModal + 180
13 UIKit 0x18628a088 UIApplicationMain + 204
14 MyApp 0x1000fb144 0x1000e4000 + 94532
15 libdyld.dylib 0x180b468b8 start + 4
Finally solved the problem. I was invoking UIAlertController in my code to present an action sheet with various options. To cater to devices that don't have a camera, I had added a conditional statement to directly present an ImagePicker instead of an action sheet.
iPAD testing was carried out only on the simulator which doesn't have a camera, thus directly invoking the ImagePicker. When he Conditional statement was removed, it tried presenting the Action Sheet through a PopoverPresentationController and crashed - as is evident in statement 2 of the Exception Backtrace.
I subsequently added the following code to fix the oversight:
if let popOver = optionMenu.popoverPresentationController {
popOver.sourceRect = sender.bounds
popOver.sourceView = sender
}

iOS Keyboard Extension crash before any of my code runs

I have been getting crash reports like this for a keyboard extension I have developed and am either confused about how to read the stack trace or why it is occurring or both and I was hoping someone could help me clear this up.
Below is the stack trace:
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0xd15db9df
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x37949f66 objc_msgSend + 5
1 UIKit 0x2cd57f05 -[_UIViewControllerTransitionContext completeTransition:] + 52
2 UIKit 0x2d10ac1f __95-[_UIWindowAnimationController _performLayoutAnimationWithContext:windowGeometryUpdatingBlock:]_block_invoke88 + 26
3 UIKit 0x2cc7b8e1 -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 308
4 UIKit 0x2cc7b4f9 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 184
5 UIKit 0x2cc7b40f -[UIViewAnimationState animationDidStop:finished:] + 70
6 QuartzCore 0x2c660fe7 CA::Layer::run_animation_callbacks(void*) + 234
7 libdispatch.dylib 0x37ecdc6f _dispatch_client_callout + 22
8 libdispatch.dylib 0x37ed9553 _dispatch_main_queue_callback_4CF$VARIANT$mp + 1322
9 CoreFoundation 0x295ac889 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 8
10 CoreFoundation 0x295aafa9 __CFRunLoopRun + 1512
11 CoreFoundation 0x294f69a1 CFRunLoopRunSpecific + 476
12 CoreFoundation 0x294f67b3 CFRunLoopRunInMode + 106
13 GraphicsServices 0x30e911a9 GSEventRunModal + 136
14 UIKit 0x2cca7635 UIApplicationMain + 1440
15 libxpc.dylib 0x3806f9e3 _xpc_objc_main + 706
16 libxpc.dylib 0x38071009 xpc_main + 168
17 Foundation 0x2a3ec289 service_connection_handler + 162
18 PlugInKit 0x32c5ff75 -[PKService run] + 508
19 PlugInKit 0x32c5fc4b +[PKService main] + 58
20 PlugInKit 0x32c5ffa9 +[PKService _defaultRun:arguments:] + 20
21 libextension.dylib 0x371b60c5 NSExtensionMain + 48
22 libdyld.dylib 0x37f0baaf start + 2
In the left column where it lists the libraries (correct term?) I don't see any reference to my code. In other crash logs there is always some reference to a class in my app or something but I don't see that in this one. What does that mean? Is the crash occurring before my code executes and this is an Apple issue I can ignore?
It's an Apple Bug. The keyboard extension I work on has a nearly identical crash report. Fortunately, this only seems to happen on iOS 8, though I have seen a similar one that affects iOS 9.
I would file a bug report with Apple, and include a copy of the stack trace.

UIButton _setTitleFrozen crash

I have weird crash related to UIButton class. I have not found anything similar on SO yet. The log I get comes from Crashlytics so I also don't know which part of code is causing the issue. I put crash log below, may be some of you have already found out what is creating the problem.
EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0xd1712d18
0 libobjc.A.dylib objc_msgSend + 5 _setTitleFrozen:
1 UIKit 32-[UIButton _beginTitleAnimation]_block_invoke853 + 28
2 UIKit -[UIViewAnimationBlockDelegate_didEndBlockAnimation:finished:context:] + 308
3 UIKit -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 184
4 UIKit -[UIViewAnimationState animationDidStop:finished:] + 70
5 QuartzCore CA::Layer::run_animation_callbacks(void*) + 234
6 libdispatch.dylib _dispatch_client_callout + 22
7 libdispatch.dylib _dispatch_main_queue_callback_4CF$VARIANT$mp + 712
8 CoreFoundation __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE_ + 8
9 CoreFoundation __CFRunLoopRun + 1512
10 CoreFoundation CFRunLoopRunSpecific + 476
11 CoreFoundation CFRunLoopRunInMode + 106
12 GraphicsServices GSEventRunModal + 136
13 UIKit UIApplicationMain + 1440
Changing the button type from System to Custom resolved this crash for me.
In my case this crash occurred because I was changing the button title right before removing it from the view hierarchy (by dismissing its parent view's VC) while the title change animation was still running.

Resources