ios webview pop crash - ios

Dose anybody know what is the crash when webview pop, it happen sometime.
0 libobjc.A.dylib 0x0000000190c8ef30 objc_msgSend (respondsToSelector:) + 16
1 CoreFoundation 0x0000000192248078 ____forwarding___ + 404
2 CoreFoundation 0x000000019214259c _CF_forwarding_prep_0 + 80
3 CoreFoundation 0x000000019224a160 ___invoking___ + 144
4 CoreFoundation 0x000000019213dc3c -[NSInvocation invoke] + 284
5 WebCore 0x0000000196cea200 HandleDelegateSource(void*) + 108
6 CoreFoundation 0x00000001921f2278 ___CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
7 CoreFoundation 0x00000001921f1bc0 ___CFRunLoopDoSources0 + 524
8 CoreFoundation 0x00000001921ef7c0 ___CFRunLoopRun + 804
9 CoreFoundation 0x000000019211e048 CFRunLoopRunSpecific + 436
10 GraphicsServices 0x0000000193ba1198 GSEventRunModal + 172
11 UIKit 0x00000001980f8628 -[UIApplication _run] + 684
12 UIKit 0x00000001980f3360 UIApplicationMain + 208
13 HuaYang 0x00000001007dc894 main (main.m:21)
14 libdyld.dylib 0x00000001911005b8 _dyld_process_info_notify_release + 36

objc_msgSend (respondsToSelector:) - This is a memory management issue. You will need to replicate the conditions of the crash with Zombies turned on and check once else another option stop loading the webView and remove the delegate before leaving the view:
objective C
- (void)viewWillDisappear:(BOOL)animated{
[yourwebViewname setDelegate:nil];
[yourwebViewname stopLoading];
}
swift
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
yourwebViewname.delegate = nil
yourwebViewname.stopLoading()
}

Related

iOS 13: Searchbar crashing when cancel is hit repeatedly

I'm getting a crash when users click the cancel button repeatedly:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Nested internal _UISearchBar transitions not yet supported. This is an internal UIKit bug.'
Steps:
Launch a window with the search bar showing.
Make the search bar text field the first responder. I have the cancel button enabled, so it shows up.
Tap on the location of the cancel button a few times.
Watch the app crash.
Log:
*** First throw call stack:
(
0 CoreFoundation 0x00007fff23b98bde __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff503b5b20 objc_exception_throw + 48
2 CoreFoundation 0x00007fff23b98958 +[NSException raise:format:arguments:] + 88
3 Foundation 0x00007fff255eb6f5 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 191
4 UIKitCore 0x00007fff468697ba -[_UISearchBarVisualProviderIOS prepareForTransitionToSearchLayoutState:] + 1306
5 UIKitCore 0x00007fff46869174 -[_UISearchBarVisualProviderIOS driveTransitionToSearchLayoutState:] + 180
6 UIKitCore 0x00007fff471c046a __68-[_UISearchControllerTransplantSearchBarAnimator animateTransition:]_block_invoke.98 + 107
7 UIKitCore 0x00007fff4762a1e6 +[UIView(UIViewAnimationWithBlocks) _setupAnimationWithDuration:delay:view:options:factory:animations:start:animationStateGenerator:completion:] + 528
8 UIKitCore 0x00007fff4762a795 +[UIView(UIViewAnimationWithBlocks) animateWithDuration:delay:options:animations:completion:] + 99
9 UIKitCore 0x00007fff471bfc15 -[_UISearchControllerTransplantSearchBarAnimator animateTransition:] + 862
10 UIKitCore 0x00007fff46b2c49e ___UIViewControllerTransitioningRunCustomTransition_block_invoke_2 + 54
11 UIKitCore 0x00007fff46c41ece +[UIInputResponderController _pinInputViewsForInputResponderController:onBehalfOfResponder:duringBlock:] + 99
12 UIKitCore 0x00007fff46b2c432 ___UIViewControllerTransitioningRunCustomTransition_block_invoke.645 + 180
13 UIKitCore 0x00007fff47628751 +[UIView(Animation) _setAlongsideAnimations:toRunByEndOfBlock:] + 175
14 UIKitCore 0x00007fff46b2c2b8 _UIViewControllerTransitioningRunCustomTransition + 553
15 UIKitCore 0x00007fff46a0fccb __56-[UIPresentationController runTransitionForCurrentState]_block_invoke.452 + 2632
16 UIKitCore 0x00007fff4716b85a _runAfterCACommitDeferredBlocks + 352
17 UIKitCore 0x00007fff4715c63c _cleanUpAfterCAFlushAndRunDeferredBlocks + 248
18 UIKitCore 0x00007fff4718bc6e _afterCACommitHandler + 85
19 CoreFoundation 0x00007fff23afaeb7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
20 CoreFoundation 0x00007fff23af594e __CFRunLoopDoObservers + 430
21 CoreFoundation 0x00007fff23af5fca __CFRunLoopRun + 1514
22 CoreFoundation 0x00007fff23af56b6 CFRunLoopRunSpecific + 438
23 GraphicsServices 0x00007fff3815cbb0 GSEventRunModal + 65
24 UIKitCore 0x00007fff47162a67 UIApplicationMain + 1621
25 Properly 0x000000010d3426d2 main + 80
26 libdyld.dylib 0x00007fff5123bcf5 start + 1
27 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Simple solution could be disable cancel button upon tapping once. And then perform the operation under it and when process gets completed you can enable it if you want.
find the below fix for this issue.
var isSeachBarAnimationCompleted: Bool = false
func didPresentSearchController(_ searchController: UISearchController) {
DispatchQueue.main.async(execute:
{
self.isSeachBarAnimationCompleted = true
searchController.searchBar.becomeFirstResponder()
})
}
func searchBarCancelButtonClicked(_ searchBar: UISearchBar)
{
guard self.isSeachBarAnimationCompleted else
{
return
}
self.isSeachBarAnimationCompleted = false
//Do you code here...
}
Hope this will resolve the issue.

EXC_SOFTWARE / UNCAUGHT_NS_EXCEPTION

I have a crash occurring in life app which I can not reproduce on my devices. I have not been able to figure out what causes it. I studied to crash report but seem not to be able to understand what is causing this.
1 CoreFoundation __exceptionPreprocess + 1241536
2 libobjc.A.dylib objc_exception_throw + 34136
3 CoreFoundation -[NSObject(NSObject) doesNotRecognizeSelector:] + 1270388
4 CoreFoundation ___forwarding___ + 1258100
5 CoreFoundation _CF_forwarding_prep_0 + 185752
6 GLKit -[GLKViewController setPaused:] + 144836
7 GLKit -[GLKViewController _pauseByNotification] + 142828
8 CoreFoundation __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 823848
9 CoreFoundation _CFXRegistrationPost + 821548
10 CoreFoundation ___CFXNotificationPost_block_invoke + 820904
11 CoreFoundation -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1276824
12 CoreFoundation _CFXNotificationPost + 44016
13 Foundation -[NSNotificationCenter postNotificationName:object:userInfo:] + 26152
14 UIKit -[UIApplication _deactivateForReason:notify:] + 491392
15 UIKit __61-[UIApplication _sceneSettingsPreLifecycleEventDiffInspector]_block_invoke + 2711892
16 FrontBoardServices __52-[FBSSettingsDiffInspector inspectDiff:withContext:]_block_invoke.27 + 144868
17 Foundation __NSIndexSetEnumerate + 788368
18 BaseBoard -[BSSettingsDiff inspectChangesWithBlock:] + 208636
19 FrontBoardServices -[FBSSettingsDiff inspectOtherChangesWithBlock:] + 120484
20 FrontBoardServices -[FBSSettingsDiffInspector inspectDiff:withContext:] + 144320
21 UIKit __70-[UIApplication scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke + 2717116
22 UIKit -[UIApplication scene:didUpdateWithDiff:transitionContext:completion:] + 2716256
23 UIKit -[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:] + 6065056
24 FrontBoardServices __80-[FBSSceneImpl updater:didUpdateSettings:withDiff:transitionContext:completion:]_block_invoke.376 + 52104
25 FrontBoardServices __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 239800
26 FrontBoardServices -[FBSSerialQueue _performNext] + 239396
27 FrontBoardServices -[FBSSerialQueue _performNextFromRunLoopSource] + 240332
28 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 905844
29 CoreFoundation __CFRunLoopDoSources0 + 904124
30 CoreFoundation __CFRunLoopRun + 894908
31 CoreFoundation CFRunLoopRunSpecific + 36932
32 GraphicsServices GSEventRunModal + 49556
33 UIKit -[UIApplication _run] + 504568
34 UIKit UIApplicationMain + 483376
35 XXX main (XXXViewController.swift:14)
36 libdyld.dylib
start + 17844
Line 35 (only mention of code I wrote) is the XXXViewController class definition line:
class XXXViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
...
}
This ViewController calls an observer, which seems to be the problem. I am making sure the I remove all observers in the ViewControllers that use them in the deinit function.
deinit {
NSNotificationCenter.defaultCenter().removeObserver(self)
}
Does anybody have an idea what else could be going wrong?
UPDATE:
I register the observer like this ini init() (should I use viewDidLoad instead?):
NSNotificationCenter.defaultCenter().addObserver(self, selector:#selector(YViewController.dataUpdate(_:)), name: "DataChanged", object: nil)
and post the notification like this:
NSNotificationCenter.defaultCenter().postNotificationName("DataChanged", object: self, userInfo: nil)
The YViewController dataUpdate is as follows:
func dataUpdate(notification: NSNotification) {
//Some stuff is done
}
I use swift 2.0 for now and the crash has happened on iOS version 10.0.1-10.1.1
Just in case anybody lands here. The problem was that I was overwriting the base view of the GLKViewController instead of adding the new view as a subview. This became easily clear, when I switched to Crashlytics, which had more information about the crash.

weird SIGSEGV crash in iOS

About 10+ crash reported by crittercism.
Name: SIGSEGV
Reason: SEGV_MAPERR
Seems it is a UIScrollView/UITableView animating or scrolling issue.
How can I find the root cause?
Stack:
0
libobjc.A.dylib 0x0000000195fafbd0 objc_msgSend + 12
1
UIKit 0x00000001892b1db8 -[UIScrollView(UIScrollViewInternal) _delegateScrollViewAnimationEnded] + 64
2
UIKit 0x00000001892b1d30 -[UIScrollView(UIScrollViewInternal) _scrollViewAnimationEnded:finished:] + 204
3
UIKit 0x0000000189366814 -[UIAnimator stopAnimation:] + 500
4
UIKit 0x0000000189366248 -[UIAnimator(Static) _advanceAnimationsOfType:withTimestamp:] + 332
5
QuartzCore 0x0000000188b4629c CA::Display::DisplayLinkItem::dispatch() + 28
6
QuartzCore 0x0000000188b46134 CA::Display::DisplayLink::dispatch_items() + 320
7
IOKit 0x0000000185921470 IODispatchCalloutFromCFMessage + 372
8
CoreFoundation 0x0000000184712dc4 __CFMachPortPerform + 176
9
CoreFoundation 0x0000000184727a54 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
10
CoreFoundation 0x00000001847279b4 __CFRunLoopDoSource1 + 432
11
CoreFoundation 0x0000000184725934 __CFRunLoopRun + 1636
12
CoreFoundation 0x00000001846512d4 CFRunLoopRunSpecific + 392
13
GraphicsServices 0x000000018de676fc GSEventRunModal + 164
14
UIKit 0x0000000189216fac UIApplicationMain + 1484
15
MyApp 0x000000010001d280 main (main.m:14)
16
libdyld.dylib 0x000000019661aa08 start + 0
I've seen this happen when a controller and/or its table is deallocated during an animation. The OS still triggers delegate methods (e.g., -scrollViewDidEndScrollingAnimation: or -scrollViewDidEndDecelerating:) when it finishes with the animation, but because the objects no longer exist things get weird.
The best fix is to nil the delegate in the controller's dealloc method.

EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0x000000008346beb8

I get the following crash log from Crashlytics for my app. My code do not call msgpack_zone_free or msgpack parse method at all and so I'm confused how that happened. I'm unable to reproduce this crash myself so I'm left to analyze the issue from the crash report itself. Any pointers to what I need to check will be very helpful.
This is not a case of low memory as I see free memory from Crashlytics.
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x0000000192953bd0 objc_msgSend + 16
1 CoreFoundation 0x00000001820d5228 CFRelease + 524
2 CoreFoundation 0x00000001821e62ac -[__NSArrayM removeAllObjects] + 284
3 MyApp 0x00000001004a69e0 msgpack_zone_free
4 MyApp 0x00000001004a4afc msgpack_zone_free
5 CoreFoundation 0x000000018219cae4 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20
6 CoreFoundation 0x00000001820db220 _CFXNotificationPost + 2060
7 Foundation 0x0000000182fdac60 -[NSNotificationCenter postNotificationName:object:userInfo:] + 72
8 UIKit 0x0000000186c32e98 -[UIApplication _handleApplicationDectivationWithScene:shouldForceExit:transitionContext:completion:] + 1132
9 UIKit 0x0000000186c3b370 __88-[UIApplication _handleApplicationLifecycleEventWithScene:transitionContext:completion:]_block_invoke + 92
10 UIKit 0x0000000186c3b2f8 -[UIApplication _handleApplicationLifecycleEventWithScene:transitionContext:completion:] + 380
11 UIKit 0x0000000186c2ec2c -[UIApplication scene:didUpdateWithDiff:transitionContext:completion:] + 512
12 FrontBoardServices 0x000000018a45d62c __31-[FBSSerialQueue performAsync:]_block_invoke + 28
13 CoreFoundation 0x00000001821aea28 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 20
14 CoreFoundation 0x00000001821adb30 __CFRunLoopDoBlocks + 312
15 CoreFoundation 0x00000001821ac154 __CFRunLoopRun + 1756
16 CoreFoundation 0x00000001820d90a4 CFRunLoopRunSpecific + 396
17 GraphicsServices 0x000000018b2735a4 GSEventRunModal + 168
18 UIKit 0x0000000186a0aaa4 UIApplicationMain + 1488
19 MyApp 0x00000001000cce40 main (main.m:16)
20 libdyld.dylib 0x0000000192faea08 start + 4
Thanks.

iOS Crash with name SIGSEGV, reason main

I'm using Crittercism (SDK 4.1.2) crash reporting service to catch reports on my iOS app. i've been getting this crash many times and i've no idea why it's happening.
Name: SIGSEGV - Reason: Main
Crashed Thread
0 libobjc.A.dylib 0x397c4b26 objc_msgSend + 6
1 UIKit 0x31965a2d -[UIScrollView(UIScrollViewInternal) _scrollViewAnimationEnded:finished:] + 177
2 UIKit 0x31a0e4b3 -[UIAnimator stopAnimation:] + 471
3 UIKit 0x31a0de9d -[UIAnimator(Static) _advanceAnimationsOfType:withTimestamp:] + 285
4 UIKit 0x31a0dd7d -[UIAnimator(Static) _LCDHeartbeatCallback:] + 53
5 QuartzCore 0x315419cf _ZN2CA7Display15DisplayLinkItem8dispatchEv + 99
6 QuartzCore 0x31541779 _ZN2CA7Display11DisplayLink14dispatch_itemsEyyy + 345
7 IOMobileFramebuffer 0x3411b76d IOMobileFramebufferVsyncNotifyFunc + 105
8 IOKit 0x2fdd9a75 IODispatchCalloutFromCFMessage + 249
9 CoreFoundation 0x2f0b7e21 __CFMachPortPerform + 137
10 CoreFoundation 0x2f0c29df __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 35
11 CoreFoundation 0x2f0c297b __CFRunLoopDoSource1 + 347
12 CoreFoundation 0x2f0c114f __CFRunLoopRun + 1399
13 CoreFoundation 0x2f02bc27 CFRunLoopRunSpecific + 523
14 CoreFoundation 0x2f02ba0b CFRunLoopRunInMode + 107
15 GraphicsServices 0x33cff283 GSEventRunModal + 139
16 UIKit 0x318cf049 UIApplicationMain + 1137
17 AppName 0x000b1fef main + 67
Not sure if this is the case for you, but I've had a similar crash caused by a button in an UIView trying to invoke a callback method on a already released object. The UI was displayed, and then the object was released.

Resources