App crash on viewDidDisappear - ios

There is a very strange crash that occurs only on 5, 5s and SE models with iOS 10.2. Firebase says that 100% of crashes happened in background.
I got able to exactly reproduce the stack of crash (but not the crash itself on the simulator) and only figured out that it happens when the user quit an app. Seems like no other code of viewDidDisappear get called on real crash, because the stack changes in this case.
Actually, the line that mentioned in crash report goes straight after
super.viewDidDisappear(animated) and it is blank…
override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
self.keyboardAvoiding.endAvoiding()
}
KeyboardAvoiding
func endAvoiding()
{
self.avoiding = false
// Update view frame
updateConstraint(nil)
}
private func updateConstraint(_ keyboardFrame: CGRect?, animationDuration: TimeInterval? = 0.0)
{
// Disable animation
let state = UIView.areAnimationsEnabled
UIView.setAnimationsEnabled(false)
// Force to recalculate view frame if needed (without animation)
self.view.superview?.layoutIfNeeded()
// Restore previous animation state
UIView.setAnimationsEnabled(state)
if let keyboardFrame = keyboardFrame
{
// Decrease view frame
self.constraint.constant = keyboardFrame.height
}
else {
// Reset bottom constraint to initial value
self.constraint.constant = self.initialConstraintConstant
}
// Layout superview
UIView.animate(withDuration: animationDuration ?? 0.0, animations: {
self.view.superview?.layoutIfNeeded()
if let keyboardAvoidingScrollView = self.view.firstViewOfClass(TPKeyboardAvoidingScrollView.self)
{
// Scroll to active text field if scroll view frame changed
keyboardAvoidingScrollView.scrollToActiveTextField()
}
})
}
Here is a crash report:
Hardware Model: iPhone6,2
Code Type: ARM-64
Parent Process: ??? [1]
OS Version: iPhone OS 10.2 (14C92)
Exception Type: SIGTRAP
Exception Codes: #0 at 0x100255178
Crashed Thread: 0
Application Specific Information:
Selector name found in current argument registers: release
Thread 0 Crashed:
0 _______ 0x0000000100255178 _______.PhoneNumberController.viewDidDisappear(Swift.Bool) -> () (PhoneNumberController.swift:97)
1 _______ 0x00000001002551a4 #objc _______.PhoneNumberController.viewDidDisappear(Swift.Bool) -> () (PhoneNumberController.swift:0)
2 UIKit 0x000000018e7026f4 -[UIViewController _setViewAppearState:isAnimating:] + 524
3 UIKit 0x000000018e7765b4 -[UIViewController __viewDidDisappear:] + 140
4 UIKit 0x000000018e7c02e0 -[UINavigationController viewDidDisappear:] + 228
5 UIKit 0x000000018e7026f4 -[UIViewController _setViewAppearState:isAnimating:] + 524
6 UIKit 0x000000018e7765b4 -[UIViewController __viewDidDisappear:] + 140
7 CoreFoundation 0x00000001887ceb10 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 16
8 CoreFoundation 0x00000001887ce214 _CFXRegistrationPost + 396
9 CoreFoundation 0x00000001887cdf90 ___CFXNotificationPost_block_invoke + 56
10 CoreFoundation 0x000000018883db8c -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1500
11 CoreFoundation 0x000000018870fe64 _CFXNotificationPost + 372
12 Foundation 0x0000000189244e0c -[NSNotificationCenter postNotificationName:object:userInfo:] + 64
13 UIKit 0x000000018e9785d8 __102-[UIApplication _handleApplicationDeactivationWithScene:shouldForceExit:transitionContext:completion:]_block_invoke.2100 + 288
14 UIKit 0x000000018e97bfdc _runAfterCACommitDeferredBlocks + 288
15 UIKit 0x000000018e96dd50 _cleanUpAfterCAFlushAndRunDeferredBlocks + 556
16 UIKit 0x000000018e6dd0b4 _afterCACommitHandler + 164
17 CoreFoundation 0x00000001887e20c0 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 28
18 CoreFoundation 0x00000001887dfcf0 __CFRunLoopDoObservers + 368
19 CoreFoundation 0x00000001887e0180 __CFRunLoopRun + 1020
20 CoreFoundation 0x000000018870e2b8 CFRunLoopRunSpecific + 440
21 GraphicsServices 0x000000018a1c2198 GSEventRunModal + 176
22 UIKit 0x000000018e7557fc -[UIApplication _run] + 680
23 UIKit 0x000000018e750534 UIApplicationMain + 204
24 _______ 0x00000001000e3188 main (AppDelegate.swift:25)
25 ??? 0x00000001876f15b8 0x0 + 0

Related

Understanding crash report from iOS review process

I'm trying to upload an app to the iOS App Store but I'm getting rejection due to crashes (which I can't reproduce with the several simulations / devices I have.
I'm attaching here the crash reports.
The problem that I have is that I can't re-symbolicate the crash correctly and all I can get when I try to right click and choose re-symbolicate them is the following:
{"app_name":"Livycs","timestamp":"2019-10-21 13:36:46.22 -0700","app_version":"1.3","slice_uuid":"4ceb4db7-568a-3a47-a8e9-0e6d8ff33b2b","adam_id":1054637602,"build_version":"12","bundleID":"me.linktree.Livycs","share_with_app_devs":false,"is_first_party":false,"bug_type":"109","os_version":"iPhone OS 13.1.3 (17A878)","incident_id":"B26974A6-3E7F-40F4-836A-BC4FF36D1219","name":"Livycs"}
Incident Identifier: B26974A6-3E7F-40F4-836A-BC4FF36D1219
CrashReporter Key: f76f6829cc13ca447c49f923305d7b23085e37fd
Hardware Model: xxx
Process: Livycs [394]
Path: /private/var/containers/Bundle/Application/1ADC7177-F01D-4C60-B624-730592A5C45A/Livycs.app/Livycs
Identifier: me.linktree.Livycs
Version: 12 (1.3)
AppStoreTools: 11A1002b
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: me.linktree.Livycs [530]
Date/Time: 2019-10-21 13:36:46.1480 -0700
Launch Time: 2019-10-21 13:34:25.7023 -0700
OS Version: iPhone OS 13.1.3 (17A878)
Release Type: User
Baseband Version: n/a
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Application Specific Information:
abort() called
Last Exception Backtrace:
0 CoreFoundation 0x1a450298c __exceptionPreprocess + 220
1 libobjc.A.dylib 0x1a422b0a4 objc_exception_throw + 55
2 CoreFoundation 0x1a43f8054 +[NSException raise:format:] + 107
3 UIKitCore 0x1a7eb70f8 UISearchDisplayControllerNoLongerSupported + 247
4 UIKitCore 0x1a7eb73fc -[UISearchDisplayController initWithCoder:] + 83
5 UIFoundation 0x1a7aab838 UINibDecoderDecodeObjectForValue + 727
6 UIFoundation 0x1a7aaba6c UINibDecoderDecodeObjectForValue + 1291
7 UIFoundation 0x1a7a47ec8 -[UINibDecoder decodeObjectForKey:] + 315
8 UIKitCore 0x1a7efe6e4 -[UIViewController initWithCoder:] + 1035
9 UIKitCore 0x1a81b9c2c -[UIClassSwapper initWithCoder:] + 2455
10 UIFoundation 0x1a7aab838 UINibDecoderDecodeObjectForValue + 727
11 UIFoundation 0x1a7aaba6c UINibDecoderDecodeObjectForValue + 1291
12 UIFoundation 0x1a7a47ec8 -[UINibDecoder decodeObjectForKey:] + 315
13 UIKitCore 0x1a81b8edc -[NSCoder+ 6917852 (UIIBDependencyInjectionInternal) _decodeObjectsAndTrackChildViewControllerIndexWithParent:forKey:] + 315
14 UIKitCore 0x1a7efe89c -[UIViewController initWithCoder:] + 1475
15 UIKitCore 0x1a7e41a84 -[UITabBarController initWithCoder:] + 79
16 UIKitCore 0x1a81b9c2c -[UIClassSwapper initWithCoder:] + 2455
17 UIFoundation 0x1a7aab838 UINibDecoderDecodeObjectForValue + 727
18 UIFoundation 0x1a7a47ec8 -[UINibDecoder decodeObjectForKey:] + 315
19 UIKitCore 0x1a81bdc50 -[UIRuntimeConnection initWithCoder:] + 127
20 UIFoundation 0x1a7aab838 UINibDecoderDecodeObjectForValue + 727
21 UIFoundation 0x1a7aaba6c UINibDecoderDecodeObjectForValue + 1291
22 UIFoundation 0x1a7a47ec8 -[UINibDecoder decodeObjectForKey:] + 315
23 UIKitCore 0x1a81b8cc8 -[NSCoder+ 6917320 (UIIBDependencyInjectionInternal) _decodeObjectsWithSourceSegueTemplate:creator:sender:forKey:] + 487
24 UIKitCore 0x1a81bb8b8 -[UINib instantiateWithOwner:options:] + 1111
25 UIKitCore 0x1a86617d8 -[UIStoryboard __reallyInstantiateViewControllerWithIdentifier:creator:storyboardSegueTemplate:sender:] + 287
26 Livycs 0x1040d44dc #objc WelcomeViewController.searchShowsAroundMeButtonClicked+ 165084 (_:) + 131
27 UIKitCore 0x1a8511a44 -[UIApplication sendAction:to:from:forEvent:] + 95
28 UIKitCore 0x1a7f556d0 -[UIControl sendAction:to:forEvent:] + 239
29 UIKitCore 0x1a7f55a34 -[UIControl _sendActionsForEvents:withEvent:] + 407
30 UIKitCore 0x1a7f54a50 -[UIControl touchesEnded:withEvent:] + 519
31 UIKitCore 0x1a854ad68 -[UIWindow _sendTouchesForEvent:] + 2323
32 UIKitCore 0x1a854c0a8 -[UIWindow sendEvent:] + 3351
33 UIKitCore 0x1a8528ae8 -[UIApplication sendEvent:] + 335
34 UIKitCore 0x1a85a023c __dispatchPreprocessedEventFromEventQueue + 5879
35 UIKitCore 0x1a85a2798 __handleEventQueueInternal + 4923
36 UIKitCore 0x1a859b60c __handleHIDEventFetcherDrain + 107
37 CoreFoundation 0x1a44807e0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 23
38 CoreFoundation 0x1a4480738 __CFRunLoopDoSource0 + 79
39 CoreFoundation 0x1a447fed0 __CFRunLoopDoSources0 + 179
40 CoreFoundation 0x1a447b01c __CFRunLoopRun + 1079
41 CoreFoundation 0x1a447a8bc CFRunLoopRunSpecific + 463
42 GraphicsServices 0x1ae2e6328 GSEventRunModal + 103
43 UIKitCore 0x1a85106d4 UIApplicationMain + 1935
44 Livycs 0x1040d246c main + 156780 (SearchLocationViewController.swift:14)
45 libdyld.dylib 0x1a4305460 start + 3
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x00000001a42faebc __pthread_kill + 8
1 libsystem_pthread.dylib 0x00000001a4216790 pthread_kill$VARIANT$mp + 112
2 libsystem_c.dylib 0x00000001a416a8a0 __abort + 112
3 libsystem_c.dylib 0x00000001a416a830 __abort + 0
4 libc++abi.dylib 0x00000001a42c37d4 __cxa_bad_cast + 0
5 libc++abi.dylib 0x00000001a42c39c4 demangling_unexpected_handler+ 6596 () + 0
6 libobjc.A.dylib 0x00000001a422b358 _objc_terminate+ 25432 () + 124
7 Livycs 0x0000000104113a94 CLSTerminateHandler() + 424596 (CLSException.mm:0)
8 libc++abi.dylib 0x00000001a42d0304 std::__terminate(void (*)+ 58116 ()) + 16
9 libc++abi.dylib 0x00000001a42cfed8 __cxa_rethrow + 144
10 libobjc.A.dylib 0x00000001a422b258 objc_exception_rethrow + 40
11 CoreFoundation 0x00000001a447a92c CFRunLoopRunSpecific + 576
12 GraphicsServices 0x00000001ae2e6328 GSEventRunModal + 104
13 UIKitCore 0x00000001a85106d4 UIApplicationMain + 1936
14 Livycs 0x00000001040d246c main + 156780 (SearchLocationViewController.swift:14)
15 libdyld.dylib 0x00000001a4305460 start + 4
The code where I think it crashes (WelcomeViewController.swift)
//
// WelcomeViewController.swift
// Livycs
//
// Created by Nir Sagiv on 03/03/2016.
// Copyright © 2016 Nir Sagiv. All rights reserved.
//
import UIKit
class WelcomeViewController: UIViewController {
#IBOutlet weak var showsRoundMeButton: UIButton!
#IBOutlet weak var showsByLocationBotton: UIButton!
#IBOutlet weak var iosVersion: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
showsRoundMeButton.layer.cornerRadius = 10
showsByLocationBotton.layer.cornerRadius = 10
self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: UIBarMetrics.default)
self.navigationController?.navigationBar.shadowImage = UIImage()
self.navigationController?.navigationBar.isTranslucent = true
self.navigationController?.navigationBar.backgroundColor = UIColor.clear
iosVersion.text = version()
BiAnalyticsService.logEvent("MainPage", withParameter: nil)
// Do any additional setup after loading the view.
}
override var preferredStatusBarStyle : UIStatusBarStyle {
return .lightContent
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func version() -> String {
let dictionary = Bundle.main.infoDictionary!
let version = dictionary["CFBundleShortVersionString"] as! String
let build = dictionary["CFBundleVersion"] as! String
return "v\(version) (\(build))"
}
#IBAction func searchShowsAroundMeButtonClicked(_ sender: UIButton) {
BiAnalyticsService.logEvent("MainPage:searchShowsAroundMeButtonClicked", withParameter: nil)
let vc:UITabBarController = (self.storyboard?.instantiateViewController(withIdentifier: "main")) as! UITabBarController
vc.selectedIndex = 0
self.present(vc, animated: true, completion: nil)
}
#IBAction func searchShowsByLocationButtonClicked(_ sender: UIButton) {
BiAnalyticsService.logEvent("MainPage:searchShowsByLocationButtonClicked", withParameter: nil)
let vc:UITabBarController = (self.storyboard?.instantiateViewController(withIdentifier: "main")) as! UITabBarController
vc.selectedIndex = 1
self.present(vc, animated: true, completion: nil)
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/
}
notice that I've cleared the BiAnalyticsService.logEvent... since I was thinking it might cause problems and the code there is now:
class func logEvent( eventName : String, withParameter : Dictionary<String,String>?){
// if withParameter == nil {
// mixpanel.track(eventName, properties: staticProperties)
// } else {
// var prm = withParameter!
//
// for key in staticProperties.keys {
// prm[key] = staticProperties[key]
// }
// mixpanel.track(eventName, properties: prm)
// }
}
Any help will be appreciated
Find in code "searchdisplay", it will appear somewhere in Storyboard at the bottom of one of your old viewcontrollers, remove this SearchDisplay item, and that's all.
In my case SearchDisplay was even linked to outlet (no real outlet actually existed! nore a single compiler error!), and obviously it was not used for a long time. Crash occured only in review team or via TestFlight, but not by cable, on any device. Review team's crashreports said nothing (symbolicate always failed), thus I killed three days nd three builds until got useful report from tester.
Use TestFlight now! Multiply debug on cable is not enough It's time :-(
Starting with iOS 13 and iPad OS 13, UISearchDisplayController is unavailable to apps built with Xcode 11.
UISearchDisplayController was deprecated starting with iOS 8, and you should use UISearchController
In order to reproduce this locally, you need to test the thinned variant of your app
If you receive one of these crashes but can't reproduce it locally,
ensure that you are testing the deployed version of your app on iOS
13, either by using TestFlight, or by applying app thinning to your
Xcode archive and testing the thinned variant of your app targeted at
iOS 13 devices. By testing with the thinned variant, you will be able
to reproduce this crash. To apply app thinning to your local Xcode
archive, export the app from the Xcode Archive using either the Ad-Hoc
or Development options, and select "All compatible device variants"
for the App Thinning option. After the thinned versions are created,
you can identify the specific variant targeted at iOS 13 by reading
the App Thinning Size Report file that is part of the output, and then
install and test that thinned .ipa file.
Please see: Apple Developer Forum

ios webview pop crash

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()
}

Initialising MPVolumeView causes app crash on iOS 11 beta 3

Since 3rd beta of iOS 11 my app has started crashing when initialising a MPVolumeView used for AirPlay. The following piece of code is working perfectly fine on earlier versions of iOS and iOS 11 beta 1 and 2.
func setupAirplayButton() {
let rect = CGRect(x: -1000, y: -1000, width: 10, height: 10)
volumeView = MPVolumeView(frame: rect) //app crashes here
volumeView.showsVolumeSlider = false
volumeView.setRouteButtonImage(nil, for: .normal)
volumeView.translatesAutoresizingMaskIntoConstraints = false
volumeView.isHidden = true
if let airplayButton = volumeView.subviews.filter({$0 is UIButton }).first as? UIButton {
self.airplayButton = airplayButton
self.airplayButton?.addObserver(self, forKeyPath: "alpha", options: [.initial, .new], context: nil)
}
NotificationCenter.default.addObserver(self, selector: #selector(wirelessRouteActiveChanged), name: NSNotification.Name.MPVolumeViewWirelessRouteActiveDidChange, object: nil)
myView.addSubview(volumeView)
}
Is anyone else experiencing the same issue?
Edit:
Crash log
Exception Type: EXC_CRASH (SIGTRAP)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: MyApp [4543]
Triggered by Thread: 0
Application Specific Information:
BUG IN CLIENT OF LIBDISPATCH: trying to lock recursively
Filtered syslog:
None found
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x000000018050b4fc (anonymous namespace)::AutoreleasePoolPage::AutoreleasePoolPage(+ 161020 (anonymous namespace)::AutoreleasePoolPage*) + 28
1 libobjc.A.dylib 0x000000018050b294 (anonymous namespace)::AutoreleasePoolPage::autoreleaseFullPage(objc_object*, + 160404 (anonymous namespace)::AutoreleasePoolPage*) + 60
2 libobjc.A.dylib 0x000000018050b294 (anonymous namespace)::AutoreleasePoolPage::autoreleaseFullPage(objc_object*, + 160404 (anonymous namespace)::AutoreleasePoolPage*) + 60
3 libobjc.A.dylib 0x0000000180508e48 objc_object::rootAutorelease2+ 151112 () + 124
4 CoreUI 0x0000000188a71a48 -[CUICommonAssetStorage renditionInfoForIdentifier:] + 188
5 CoreUI 0x0000000188a7c408 -[CUIStructuredThemeStore _canGetRenditionWithKey:isFPO:lookForSubstitutions:] + 152
6 CoreUI 0x0000000188aa5854 -[CUICatalog _resolvedRenditionKeyFromThemeRef:withBaseKey:scaleFactor:deviceIdiom:deviceSubtype:displayGamut:layoutDirection:sizeClassHorizontal:sizeClassVertical:memoryClass:graphicsClass:graphicsFallBackOrder:iconSizeIndex:] + 2112
7 CoreUI 0x0000000188aa5010 -[CUICatalog _resolvedRenditionKeyForName:scaleFactor:deviceIdiom:deviceSubtype:displayGamut:layoutDirection:sizeClassHorizontal:sizeClassVertical:memoryClass:graphicsClass:graphicsFallBackOrder:withBaseKeySelector:] + 308
8 CoreUI 0x0000000188aa3d7c -[CUICatalog _namedLookupWithName:scaleFactor:deviceIdiom:deviceSubtype:displayGamut:layoutDirection:sizeClassHorizontal:sizeClassVertical:] + 176
9 CoreUI 0x0000000188aa406c -[CUICatalog namedLookupWithName:scaleFactor:deviceIdiom:deviceSubtype:displayGamut:layoutDirection:sizeClassHorizontal:sizeClassVertical:] + 156
10 UIKit 0x000000018b4b4ca0 __139-[_UIAssetManager imageNamed:scale:gamut:layoutDirection:idiom:userInterfaceStyle:subtype:cachingOptions:sizeClassPair:attachCatalogImage:]_block_invoke + 256
11 UIKit 0x000000018b4b4ae4 -[_UIAssetManager imageNamed:scale:gamut:layoutDirection:idiom:userInterfaceStyle:subtype:cachingOptions:sizeClassPair:attachCatalogImage:] + 224
12 UIKit 0x000000018b4b5310 -[_UIAssetManager imageNamed:withTrait:] + 576
13 UIKit 0x000000018acbc6cc +[UIImage imageNamed:inBundle:compatibleWithTraitCollection:] + 220
14 UIKit 0x000000018aa7cb74 +[UIImage+ 465780 (UIImagePrivate) imageNamed:inBundle:] + 152
15 MediaPlayer 0x0000000191c36890 -[MPVolumeView _defaultRouteButtonImageAsSelected:] + 120
16 MediaPlayer 0x0000000191c36704 -[MPVolumeView _createSubviews] + 888
17 MediaPlayer 0x0000000191c35288 -[MPVolumeView _initWithStyle:] + 204
18 MediaPlayer 0x0000000191c35370 -[MPVolumeView initWithFrame:style:] + 80
19 MyFramework 0x0000000101b59a84 #nonobjc MPVolumeView.init() + 645764 (ViewController.swift:0)
20 MyFramework 0x0000000101b3a83c MPVolumeView.__allocating_init() + 518204 (ViewController.swift:0)
21 MyFramework 0x0000000101b39b90 ViewController.setupAirplayButton() + 514960 (ViewController.swift:337)
22 MyFramework 0x0000000101b341a4 ViewController.viewDidAppear(_:) + 491940 (ViewController.swift:132)
23 MyFramework 0x0000000101b341f4 #objc ViewController.viewDidAppear(_:) + 492020 (ViewController.swift:0)
24 UIKit 0x000000018aa32e44 -[UIViewController _setViewAppearState:isAnimating:] + 852
25 UIKit 0x000000018aa9c64c __64-[UIViewController viewDidMoveToWindow:shouldAppearOrDisappear:]_block_invoke + 44
26 UIKit 0x000000018aa9c5e8 -[UIViewController _executeAfterAppearanceBlock] + 92
27 UIKit 0x000000018ac8a368 _runAfterCACommitDeferredBlocks + 556
28 UIKit 0x000000018ac7d8b4 _cleanUpAfterCAFlushAndRunDeferredBlocks + 288
29 UIKit 0x000000018ac95614 __34-[UIApplication _firstCommitBlock]_block_invoke_2 + 152
30 CoreFoundation 0x0000000180f85f24 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 20
31 CoreFoundation 0x0000000180f85718 __CFRunLoopDoBlocks + 288
32 CoreFoundation 0x0000000180f83440 __CFRunLoopRun + 852
33 CoreFoundation 0x0000000180ea5bf0 CFRunLoopRunSpecific + 436
34 GraphicsServices 0x0000000182cfffac GSEventRunModal + 100
35 UIKit 0x000000018aa7dec4 UIApplicationMain + 208
36 MyApp 0x000000010164a558 main + 189784 (AppDelegate.swift:14)
37 libdyld.dylib 0x00000001809ca1e0 start + 4
This appears to be a problem in the simulator. Running on the device causes no issues.
Same here. The funny part: it‘s working on the iPad Pro (12“) but crashing on the iPhone (7 plus).
Tried instantiating with/without frame, by class name, via ObjC at different moments.
When I keep tapping (starting) the app multiple times it actually won’t crash at some point, but the volume view instance is missing in the view hierarchy.
I guess we have to wait for the next beta to fix this issue. :-/
iOS 11 beta 4 fixed the crash issues for my app.
I don‘t see the UISlider itself though.

iOS CAMImagePickerCameraViewController crashes in iOS 10.3.1

My app started to crash after an update to ios 10.3.1 .The crash happens when I attempt to pick a video using the camera. The app works well on older ios versions (9.3.5 and 10.2.1).
The crash log shows that it is the CAMImagePickerCameraViewController that is crashing:
OS Version: iPhone OS 10.3.1 (14E304)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x00000019
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [0]
Triggered by Thread: 0
Filtered syslog:
None found
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x1b946f4e realizeClass(objc_class*) + 18
1 libobjc.A.dylib 0x1b94704c realizeClass(objc_class*) + 272
2 libobjc.A.dylib 0x1b94abc6 lookUpImpOrForward + 94
3 libobjc.A.dylib 0x1b94ab64 _class_lookupMethodAndLoadCache3 + 26
4 libobjc.A.dylib 0x1b9511ae _objc_msgSend_uncached + 14
5 CameraUI 0x2f8d6896 -[CAMImagePickerCameraViewController _handleCapturedImagePickerVideoAtPath:withEditingMetadata:] + 166
6 CameraUI 0x2f8d609a -[CAMImagePickerCameraViewController cropOverlayWasOKed:] + 478
7 UIKit 0x2191e804 -[UIApplication sendAction:to:from:forEvent:] + 76
8 UIKit 0x2191e798 -[UIControl sendAction:to:forEvent:] + 62
9 UIKit 0x21908dc8 -[UIControl _sendActionsForEvents:withEvent:] + 478
10 UIKit 0x2191e0d4 -[UIControl touchesEnded:withEvent:] + 604
11 UIKit 0x2191dc1e -[UIWindow _sendTouchesForEvent:] + 2094
12 UIKit 0x21918b5e -[UIWindow sendEvent:] + 2798
13 UIKit 0x218ea702 -[UIApplication sendEvent:] + 308
14 UIKit 0x2207dd36 __dispatchPreprocessedEventFromEventQueue + 2254
15 UIKit 0x220786da __handleEventQueue + 4186
16 UIKit 0x22078abc __handleHIDEventFetcherDrain + 144
17 CoreFoundation 0x1c677fdc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 12
18 CoreFoundation 0x1c677b04 __CFRunLoopDoSources0 + 424
19 CoreFoundation 0x1c675f50 __CFRunLoopRun + 1160
20 CoreFoundation 0x1c5c90ee CFRunLoopRunSpecific + 470
21 CoreFoundation 0x1c5c8f10 CFRunLoopRunInMode + 104
22 GraphicsServices 0x1dd73b40 GSEventRunModal + 80
23 UIKit 0x2194de82 UIApplicationMain + 150
24 Stringr Dev 0x00181604 0x82000 + 1046020
25 libdyld.dylib 0x1bdb64ea start + 2
A similar crash that I see in crashlytics is:
Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x00000000c839e660
libobjc.A.dylib realizeClass(objc_class*) + 25
libobjc.A.dylib _objc_msgSend_uncached + 14
CameraUI -[CAMImagePickerCameraViewController _handleCapturedImagePickerVideoAtPath:withEditingMetadata:]
CameraUI -[CAMImagePickerCameraViewController cropOverlayWasOKed:]
UIKit UIApplicationMain + 150
Here is an excerpt from my code:
/// Presents the video selection/capture dialog
fileprivate func presentPickerController() {
// Request authorization to access photo library if not yet granted
PHPhotoLibrary.requestAuthorization { status in
guard status == .authorized else {
self.alert(.notPermittedToSelectVideos)
return
}
// Create the custom asset picker (to get multiple at once)
let assetsPickerController = DKImagePickerController()
assetsPickerController.defaultAssetGroup = .smartAlbumVideos
assetsPickerController.showsCancelButton = true
assetsPickerController.assetType = .allVideos
assetsPickerController.didSelectAssets = self.didSelectAssets
assetsPickerController.didCancel = self.didCancel
assetsPickerController.disableCaptureWhenSelected = true
assetsPickerController.createCaptureController = self.createCaptureController
self.assetsPickerController = assetsPickerController
DispatchQueue.main.async {
self.present(assetsPickerController, animated: true) {}
}
}
}
fileprivate func createCaptureController() -> UIViewController? {
let imagePickerController = UIImagePickerController()
imagePickerController.sourceType = .camera
imagePickerController.mediaTypes = [kUTTypeMovie as String]
imagePickerController.videoQuality = .typeHigh
imagePickerController.delegate = self
guard canCaptureVideo() else {
Logger.info?.message("Attempted to capture video when cannot capture video")
alert(.cantCaptureVideo)
return nil
}
guard permittedToCaptureVideo() else {
Logger.info?.message("Attempted to capture video when cannot capture video")
alert(.notPermittedToCaptureVideo)
return nil
}
guard permittedToCaptureAudio() else {
Logger.info?.message("Attempted to capture video when cannot capture audio")
alert(.notPermittedToCaptureAudio)
return nil
}
return imagePickerController
}
The controller that crashes is not part of my application and I cannot touch it. Does anyone have an idea how this problem can be fixed?
What is the purpose of CAMImagePickerCameraViewController? Why does it crash only on ios 10.3.1 and doesn't crash on previous versions?
I have some similar issue here, and i found it's the delegate's problem.
My issue is viewController retain an object, and i set the object's weak delegate to viewController, when viewController dismissed and the object still try to use delegate to do something, crash occurred...
So i think the weak reference goes wrong...no idea why it happens, but you can fix this by add code blow to the viewController dealloc method
- (void)dealloc{
self.assetsPickerController = nil
}

ios crash issue - EXC_BAD_ACCESS

I got this error message from Crashlytics.
Exception Type: EXC_BAD_ACCESS Code: KERN_INVALID_ADDRESS at 0xd000000c
Thread 0: Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x3b283b26 objc_msgSend + 5
1 TestApp 0x0012b239 -[EasyTableView scrollViewDidScroll:] (EasyTableView.m:291)
2 UIKit 0x339f006d -[UIScrollView(UIScrollViewInternal) _notifyDidScroll] + 64
3 UIKit 0x3376d375 -[UIScrollView setContentOffset:] + 596
4 UIKit 0x3381b005 -[UITableView setContentOffset:] + 320
5 UIKit 0x3376d0e7 -[UIScrollView _adjustContentOffsetIfNecessary] + 1354
6 UIKit 0x33820773 -[UIScrollView(UIScrollViewInternal) _stopScrollingNotify:pin:tramplingDragFlags:] + 414
7 UIKit 0x338205cb -[UIScrollView(UIScrollViewInternal) _stopScrollingNotify:pin:] + 30
8 UIKit 0x33820587 -[UIScrollView removeFromSuperview] + 30
9 UIKit 0x3374e687 -[UIView dealloc] + 366
10 liboainject.dylib 0x002d86cd ___swapMethods_block_invoke_4
11 UIKit 0x3374e687 -[UIView dealloc] + 366
12 liboainject.dylib 0x002d86cd ___swapMethods_block_invoke_4
13 UIKit 0x3374e687 -[UIView dealloc] + 366
14 liboainject.dylib 0x002d86cd ___swapMethods_block_invoke_4
15 libobjc.A.dylib 0x3b285007 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 358
16 liboainject.dylib 0x002d7d33 __oa__objc_autoreleasePoolPop
17 CoreFoundation 0x30f10a41 _CFAutoreleasePoolPop + 16
18 UIKit 0x337464cd _wrapRunLoopWithAutoreleasePoolHandler + 36
19 CoreFoundation 0x30fa81d5 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 20
20 CoreFoundation 0x30fa5b79 __CFRunLoopDoObservers + 284
21 CoreFoundation 0x30fa5ebb __CFRunLoopRun + 730
22 CoreFoundation 0x30f10ce7 CFRunLoopRunSpecific + 522
23 CoreFoundation 0x30f10acb CFRunLoopRunInMode + 106
24 GraphicsServices 0x35bfa283 GSEventRunModal + 138
25 UIKit 0x337b2a41 UIApplicationMain + 1136
26 TestApp 0x000ea19d main (main.m:16)
My code (EasyTableView.m: 291) is as below
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
if ([delegate respondsToSelector:#selector(easyTableView:scrolledToOffset:)])
[delegate easyTableView:self scrolledToOffset:self.contentOffset];
}
- (CGPoint)contentOffset {
CGPoint offset = self.tableView.contentOffset;
if (_orientation == EasyTableViewOrientationHorizontal)
offset = CGPointMake(offset.y, offset.x);
return offset;
}
- (void)setContentOffset:(CGPoint)offset {
if (_orientation == EasyTableViewOrientationHorizontal)
self.tableView.contentOffset = CGPointMake(offset.y, offset.x);
else
self.tableView.contentOffset = offset;
}
I tried to debug with Zombie and looked into Leaks of instrument. But I could not found any thing. How can I fix this problem? Thanks in advance
You should clear the scrollView and tableView delegates in dealloc
In Swift :
deinit {
self.scrollView.delegate = nil
self.tableView.delegate = nil
}

Resources