App crashing when pop two times the navigationController and in iPhone log return this error :(
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x6545f661
Triggered by Thread: 0
Thread 0 Crashed:
0 libobjc.A.dylib 0x3a081636 objc_msgSend + 22
1 UIKit 0x322bef20 -[UIScrollView(UIScrollViewInternal) _notifyDidScroll] + 60
2 UIKit 0x32039188 -[UIScrollView setContentOffset:] + 592
3 UIKit 0x320e61e6 -[UITableView setContentOffset:] + 346
4 UIKit 0x322bfe62 -[UIScrollView(UIScrollViewInternal) _adjustContentOffsetIfNecessary] + 1350
5 UIKit 0x320ebd0e -[UIScrollView(UIScrollViewInternal) _stopScrollingNotify:pin:tramplingDragFlags:] + 410
6 UIKit 0x320ebb66 -[UIScrollView(UIScrollViewInternal) _stopScrollingNotify:pin:] + 26
7 UIKit 0x320ebb22 -[UIScrollView removeFromSuperview] + 26
8 UIKit 0x3201a3b6 -[UIView dealloc] + 374
9 libobjc.A.dylib 0x3a0870d2 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 354
10 CoreFoundation 0x2f730c14 _CFAutoreleasePoolPop + 12
11 CoreFoundation 0x2f7c6176 __CFRunLoopRun + 1302
12 CoreFoundation 0x2f730eba CFRunLoopRunSpecific + 518
13 CoreFoundation 0x2f730c9e CFRunLoopRunInMode + 102
14 GraphicsServices 0x3468a65e GSEventRunModal + 134
15 UIKit 0x3207d148 UIApplicationMain + 1132
16 Big24H 0x000e9728 main (main.m:16)
17 libdyld.dylib 0x3a584ab4 start + 0
Looks like you have a UIScrollViewDelegate being deallocated before its corresponding UIScrollView and then getting called.
You didn't provide any code so the best I can say is you need to find where it is and nil it out when it is getting deallocated.
Probably something like this:
- (void) dealloc
{
myScrollView.delegate = nil;
}
Related
My app relatively often crashes with SIGSEGV. Unfortunately, I can not reproduce the crash and only see crash reports in Hockeyapp. I tried turning zombies on, too.
Looking at the crash report it seems that app crashes when processing touches (when user scrolling or something like this). No my app code mentioned in the stack trace.
The question is: how is it possible to have memory issue in this scenario? What would you recommend to reproduce and fix the issue?
Exception Type: SIGSEGV
Exception Codes: SEGV_ACCERR at 0x71a86113
Crashed Thread: 0
Application Specific Information:
objc_msgSend() selector name: convertPoint:fromLayer:
Thread 0 Crashed:
0 libobjc.A.dylib 0x2106fae6 objc_msgSend_stret + 6
1 UIKit 0x25e7a349 -[UIView(Geometry) convertPoint:fromView:] + 98
2 UIKit 0x25e7e987 __38-[UIView(Geometry) hitTest:withEvent:]_block_invoke + 104
3 CoreFoundation 0x217e8279 __53-[__NSArrayM enumerateObjectsWithOptions:usingBlock:]_block_invoke + 86
4 CoreFoundation 0x217e81a7 -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 248
5 UIKit 0x25e7e447 -[UIView(Geometry) hitTest:withEvent:] + 492
6 UIKit 0x26146f0d -[UIView(Geometry) _hitTest:withEvent:windowServerHitTestWindow:] + 62
7 UIKit 0x25e7e9bd __38-[UIView(Geometry) hitTest:withEvent:]_block_invoke + 158
8 CoreFoundation 0x217e8279 __53-[__NSArrayM enumerateObjectsWithOptions:usingBlock:]_block_invoke + 86
9 CoreFoundation 0x217e81a7 -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 248
10 UIKit 0x25e7e447 -[UIView(Geometry) hitTest:withEvent:] + 492
11 UIKit 0x26146f0d -[UIView(Geometry) _hitTest:withEvent:windowServerHitTestWindow:] + 62
12 UIKit 0x26136491 __70+[UIWindow _hitTestToPoint:forEvent:windowServerHitTestWindow:screen:]_block_invoke + 186
13 UIKit 0x25e4783f +[UIWindow _topVisibleWindowPassingTest:] + 156
14 UIKit 0x26136399 +[UIWindow _hitTestToPoint:forEvent:windowServerHitTestWindow:screen:] + 142
15 UIKit 0x26136629 -[UIWindow _targetWindowForPathIndex:atPoint:forEvent:windowServerHitTestWindow:onScreen:] + 158
16 UIKit 0x260ffb61 _UIApplicationHandleDigitizerEvent + 10982
17 UIKit 0x25e4123f _UIApplicationHandleEventQueue + 3836
18 CoreFoundation 0x21889dff __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 12
19 CoreFoundation 0x218899ed __CFRunLoopDoSources0 + 450
20 CoreFoundation 0x21887d5b __CFRunLoopRun + 792
21 CoreFoundation 0x217d7229 CFRunLoopRunSpecific + 518
22 CoreFoundation 0x217d7015 CFRunLoopRunInMode + 106
23 GraphicsServices 0x22dc7ac9 GSEventRunModal + 158
24 UIKit 0x25eab189 UIApplicationMain + 142
25 My App. 0x0005376b main (main.m:14)
26 ??? 0x2147f873 0x0 + 0
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.
I have no idea about this crash. The crash happens at various screens without any actions sometimes. Any help would be appreciated. Thanks in advance.
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000c
Triggered by Thread: 0
Thread 0 Crashed:
0 libobjc.A.dylib 0x3b3a1626 objc_msgSend + 6
1 UIKit 0x33301b46 +[UIViewController _viewControllerForFullScreenPresentationFromView:] + 174
2 UIKit 0x33301614 -[UIWindow _scrollToTopViewsUnderScreenPointIfNecessary:resultHandler:] + 428
3 UIKit 0x3330143e -[_UIScrollsToTopInitiatorView touchesEnded:withEvent:] + 210
4 UIKit 0x3330134e -[UIStatusBar touchesEnded:withEvent:] + 334
5 UIKit 0x33255790 forwardTouchMethod + 228
6 UIKit 0x3310371c -[UIWindow _sendTouchesForEvent:] + 524
7 UIKit 0x330fe6e6 -[UIWindow sendEvent:] + 754
8 UIKit 0x330d38e8 -[UIApplication sendEvent:] + 192
9 UIKit 0x330d1f92 _UIApplicationHandleEventQueue + 7098
10 CoreFoundation 0x3087e258 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 12
11 CoreFoundation 0x3087d726 __CFRunLoopDoSources0 + 202
12 CoreFoundation 0x3087bf1a __CFRunLoopRun + 618
13 CoreFoundation 0x307e6f0a CFRunLoopRunSpecific + 518
14 CoreFoundation 0x307e6cee CFRunLoopRunInMode + 102
15 GraphicsServices 0x356e065e GSEventRunModal + 134
16 UIKit 0x33132168 UIApplicationMain + 1132
17 MyApp 0x0029c0a0 main (main.m:16)
18 libdyld.dylib 0x3b8a4ab4 start + 0
When I call PopViewController on a landscape ViewController a crash occurs. However when i call PopViewController on a Portrait ViewController a crash doesn't occur.
This only occurs on iOS7 - worked fine previously...
[self.navigationController popViewControllerAnimated:TRUE];
I'm super stuck on this so any help would be appreciated :)
Here is my Symbolocated Crash Log:
Exception Type: EXC_CRASH (SIGABRT) Exception Codes:
0x0000000000000000, 0x0000000000000000 Triggered by Thread: 0
Last Exception Backtrace: 0 CoreFoundation
0x2d9b2f4e __exceptionPreprocess + 126
1 libobjc.A.dylib 0x3801b6aa objc_exception_throw + 34
2 CoreFoundation 0x2d9b2e90 +[NSException
raise:format:] + 100
3 UIKit 0x3020ee70 -[UIViewController
_preferredInterfaceOrientationForPresentationInWindow:fromInterfaceOrientation:]
+ 496
4 UIKit 0x3020d6ae -[UIWindowController
transition:fromViewController:toViewController:target:didEndSelector:animation:]
+ 2054
5 UIKit 0x3023ff86 -[UIViewController
_dismissViewControllerWithTransition:from:completion:] + 1390
6 UIKit 0x301ef1e0 -[UIViewController
dismissViewControllerWithTransition:completion:] + 1024
7 UIKit 0x303ecae2 -[UINavigationController
_popViewControllerAndUpdateInterfaceOrientationAnimated:] + 814 8 UIKit 0x301ef6de -[UINavigationController
_popViewControllerWithTransition:allowPoppingLast:] + 290
9 MyApp 0x00087e5a 0x55000 + 208474
10 MyApp 0x00088c56 0x55000 + 212054
11 MyApp 0x000889aa 0x55000 + 211370
12 MyApp 0x000a13f6 0x55000 + 312310
13 UIKit 0x3023b540 -[UIWindowController
transitionViewDidComplete:fromView:toView:removeFromView:] + 1908
14 UIKit 0x3023acf6 __101-[UIWindowController
transition:fromViewController:toViewController:target:didEndSelector:animation:]_block_invoke293
+ 166
15 UIKit 0x3023ac1e
-[_UIViewControllerTransitionContext completeTransition:] + 70
16 UIKit 0x3023ab08 -[UITransitionView
notifyDidCompleteTransition:] + 284 17 UIKit
0x3023a610 -[UITransitionView _didCompleteTransition:] + 940
18 UIKit 0x3015bc32 -[UIViewAnimationState
sendDelegateAnimationDidStop:finished:] + 174
19 UIKit 0x3015bb4a -[UIViewAnimationState
animationDidStop:finished:] + 66
20 QuartzCore 0x2fdb3d04
CA::Layer::run_animation_callbacks(void*) + 228
21 libdispatch.dylib 0x384fed62 _dispatch_client_callout
+ 18
22 libdispatch.dylib 0x385057bc
_dispatch_main_queue_callback_4CF$VARIANT$mp + 264
23 CoreFoundation 0x2d97d81c
CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 4
24 CoreFoundation 0x2d97c0f0 __CFRunLoopRun + 1296
25 CoreFoundation 0x2d8e6ce2 CFRunLoopRunSpecific +
518
26 CoreFoundation 0x2d8e6ac6 CFRunLoopRunInMode + 102
27 GraphicsServices 0x325b427e GSEventRunModal + 134
28 UIKit 0x30188a3c UIApplicationMain + 1132
29 MyApp 0x0005ca84 0x55000 + 31364
30 MyApp 0x0005ca0c 0x55000 + 31244
Turns out that the reason it crashed on iOS7 was due to a missing piece of code on the previous view controller to tell it to show the next previous page as portrait!
-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return UIInterfaceOrientationPortrait;
}
maybe your view controller had killed when you rotate, so when you call popViewControllerAnimated it will make crash.
I'm having trouble to diagnostic a crash with UIScrollView
UIKit
-[UIScrollView setContentOffset:]
Exception Type: EXC_BAD_ACCESS Code KERN_INVALID_ADDRESS at 0xe0000008
com.apple.main-thread Crashed
0 libobjc.A.dylib objc_msgSend + 15
1 UIKit -[UIScrollView setContentOffset:] + 618
2 UIKit -[UITableView setContentOffset:] + 330
3 UIKit -[UIScrollView(Static) _adjustContentOffsetIfNecessary] + 1474
4 UIKit -[UIScrollView(UIScrollViewInternal) _stopScrollingNotify:pin:tramplingDragFlags:] + 414
5 UIKit -[UIScrollView(UIScrollViewInternal) _stopScrollingNotify:pin:] + 30
6 UIKit -[UIScrollView removeFromSuperview] + 30
7 ... UIKit -[UIView dealloc] + 296
8 UIKit -[UIView dealloc] + 296
9 libobjc.A.dylib (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 168
10 CoreFoundation _CFAutoreleasePoolPop + 16
11 CoreFoundation __CFRunLoopRun + 1296
12 CoreFoundation CFRunLoopRunSpecific + 356
13 CoreFoundation CFRunLoopRunInMode + 104
14 GraphicsServices GSEventRunModal + 74
15 UIKit UIApplicationMain + 1120
16 iTV Shows main.m line 12
I had the same problem. Setting the TableView and ScrollView delegates (or any other delegates that you might have) to nil in the dealloc method solved the problem.
- (void)dealloc {
self.tableView.delegate = nil;
self.tableView.dataSource = nil;
}
Its hard to give a concrete answer without seeing your code, but the iOS Debugging Magic technical note is always a great resource with tips for debugging crashes.
Technical Note TN2239: iOS Debugging Magic