系统iOS 8.x, ARC。

CrashCase:

在UIViewController中有一个类型为UIScrollView的实例变量scrollView,

点击UIViewController中的某个按钮时调用"[self.navigationController popViewControllerAnimated:NO];",

在这之后该UIViewController的dealloc方法已被调用。在dealloc方法调用之后,scrollView其实还被系统View Tree

所持有,scrollView会访问其delegate,此时发生Crash。(UIScrollView的delegate)

在Debug时,

console会输出:"-[DSViewController respondsToSelector:]: message sent to deallocated instance 0x7ff3f6291160"

stack如图:

看第二frame: [UIScrollView _getDelegateZoomView], 执行停在line 18。

 UIKit`-[UIScrollView _getDelegateZoomView]:
0x110dd48cd: pushq %rbp
0x110dd48ce: movq %rsp, %rbp
0x110dd48d1: pushq %r15
0x110dd48d3: pushq %r14
0x110dd48d5: pushq %rbx
0x110dd48d6: pushq %rax
0x110dd48d7: movq %rdi, %r14
0x110dd48da: movq 0xd344ef(%rip), %rax ; UIScrollView._zoomView
0x110dd48e1: movq (%r14,%rax), %rbx
0x110dd48e5: testq %rbx, %rbx
0x110dd48e8: jne 0x110dd497b ; -[UIScrollView _getDelegateZoomView] + 174
0x110dd48ee: movq 0xd344c3(%rip), %r15 ; UIScrollView._delegate
0x110dd48f5: movq (%r14,%r15), %rdi
0x110dd48f9: movq 0xd08228(%rip), %rdx ; "viewForZoomingInScrollView:"
0x110dd4900: movq 0xd02df9(%rip), %rsi ; "respondsToSelector:"
0x110dd4907: callq *0xac2783(%rip) ; (void *)0x00000001124b8000: objc_msgSend
0x110dd490d: xorl %ebx, %ebx
0x110dd490f: testb %al, %al
0x110dd4911: je 0x110dd497b ; -[UIScrollView _getDelegateZoomView] + 174
0x110dd4913: movq (%r14,%r15), %rdi
0x110dd4917: movq 0xd0820a(%rip), %rsi ; "viewForZoomingInScrollView:"
0x110dd491e: movq %r14, %rdx
0x110dd4921: callq *0xac2769(%rip) ; (void *)0x00000001124b8000: objc_msgSend
0x110dd4927: movq %rax, %rbx
0x110dd492a: leaq 0xd6bcdb(%rip), %rax ; _UIApplicationLinkedOnVersion
0x110dd4931: movl (%rax), %eax
0x110dd4933: testl %eax, %eax
0x110dd4935: je 0x110dd4941 ; -[UIScrollView _getDelegateZoomView] + 116
0x110dd4937: cmpl $0x4ffff, %eax
0x110dd493c: seta %al
0x110dd493f: jmp 0x110dd494b ; -[UIScrollView _getDelegateZoomView] + 126
0x110dd4941: movl $0x50000, %edi
0x110dd4946: callq 0x110d4b41f ; _UIApplicationLinkedOnOrAfter
0x110dd494b: testb %al, %al
0x110dd494d: je 0x110dd497b ; -[UIScrollView _getDelegateZoomView] + 174
0x110dd494f: cmpq %r14, %rbx
0x110dd4952: jne 0x110dd497b ; -[UIScrollView _getDelegateZoomView] + 174
0x110dd4954: movq 0xd2e5ad(%rip), %rdi ; (void *)0x00000001109c2458: NSException
0x110dd495b: movq 0xac1866(%rip), %rax ; (void *)0x000000011098aa10: NSGenericException
0x110dd4962: movq (%rax), %rdx
0x110dd4965: movq 0xd0487c(%rip), %rsi ; "raise:format:"
0x110dd496c: leaq 0xb06a3d(%rip), %rcx ; @"The view returned from viewForZoomingInScrollView: must be a subview of the scroll view. It can not be the scroll view itself."
0x110dd4973: xorl %eax, %eax
0x110dd4975: callq *0xac2715(%rip) ; (void *)0x00000001124b8000: objc_msgSend
0x110dd497b: movq %rbx, %rax
0x110dd497e: addq $0x8, %rsp
0x110dd4982: popq %rbx
0x110dd4983: popq %r14
0x110dd4985: popq %r15
0x110dd4987: popq %rbp
0x110dd4988: retq

解决方法:

DSViewController的dealloc中将添加: "scrollView.delegate = nil;"

Q1: 在iOS 7.x中没有Crash,这是不是iOS 8.x的系统bug?


Reference

1. UIScrollView internal consistency crash

http://stackoverflow.com/questions/26103756/uiscrollview-internal-consistency-crash

2. popToRootViewController crashes when tableView is still scrolling

http://stackoverflow.com/questions/26060727/poptorootviewcontroller-crashes-when-tableview-is-still-scrolling

iOS.Crash.OniOS8.WhenCall[popToRootViewController]的更多相关文章

  1. iOS --------Crash 分析(一)

    iOS Crash 分析(文一)- 开始 1. 名词解释 1. UUID 一个字符串,在iOS上每个可执行文件或库文件都包含至少一个UUID.目的是为了唯一识别这个文件. 2. dwarfdump 苹 ...

  2. iOS: Crash文件解析(一)

    iOS Crash文件的解析(一) 开发程序的过程中不管我们已经如何小心,总是会在不经意间遇到程序闪退.脑补一下当你在一群人面前自信的拿着你的App做功能预演的时候,流畅的操作被无情地Crash打断. ...

  3. 漫谈iOS Crash收集框架

    漫谈iOS Crash收集框架   Crash日志收集 为了能够第一时间发现程序问题,应用程序需要实现自己的崩溃日志收集服务,成熟的开源项目很多,如 KSCrash,plcrashreporter,C ...

  4. IOS Crash捕获

    IOS Crash ,就两种情况:一种是异常,另一种是中断[信号量]. #include <libkern/OSAtomic.h> #include <execinfo.h> ...

  5. iOS Crash文件的解析

    iOS Crash文件的解析 开发程序的过程中不管我们已经如何小心,总是会在不经意间遇到程序闪退.脑补一下当你在一群人面前自信的拿着你的App做功能预演的时候,流畅的操作被无情地Crash打断.联想起 ...

  6. iOS crash日志分析

    iOS crash日志分析 一. 寻找crash文件:手机崩溃后的ips或者crash文件(ips文件可以直接修改成crash文件,直接改后缀名就可以了),这里说下如何拿到crash文件 1. 把运行 ...

  7. 了解和分析iOS Crash

    WeTest 导读 北京时间凌晨一点,苹果一年一度的发布会如期而至.新机型的发布又会让适配相关的同学忙上一阵子啦,并且iOS Crash的问题始终伴随着移动开发者.本文将从三个阶段,由浅入深的介绍如何 ...

  8. iOS Crash 分析 符号化崩溃日志

    参考: http://blog.csdn.net/diyagoanyhacker/article/details/41247367 http://blog.csdn.net/diyagoanyhack ...

  9. iOS crash 崩溃问题的追踪方法

    http://www.cnblogs.com/easonoutlook/archive/2012/12/27/2835884.html iOS crash 崩溃问题的追踪方法 在调试程序的时候,总是碰 ...

随机推荐

  1. 主流浏览器 Cookie 的大小

    目前测试的两种浏览器:Chrome 和 IE . 环境:IIS 7.5 只创建了站点,未做任何配置. Chrome : v36.0.1985.143 m 单个 Cookie 的长度为 4069 个字符 ...

  2. 一个漂亮的 PlaceHolder

    预览: 不知道为什么下面这个窗口中的 JavaScript 代码没有运行-_-||,想看实际效果就把下面的代码保存下来打开看吧. 代码: <!DOCTYPE HTML> <html ...

  3. linux下arm汇编注释符

    注意使用 @ 符 # 是整行注释符 @ 是行内注释符 以为 @ 是行内注释符,害我调试了半天.

  4. ArrayList删除--------ConcurrentModificationException问题

    在做项目中用到List存储数据,在里面做数据操作时候用到了删除.结果抛出ConcurrentModificationException异常.在这里把问题总结一下. 原因: ArrayList进行for ...

  5. Java多线程及线程状态转换

    以下内容整理自:http://blog.csdn.net/wtyvhreal/article/details/44176369 线程:是指进程中的一个执行流程.  线程与进程的区别:每个进程都需要操作 ...

  6. jquery 滚动条位置的

    $('#fixedHead').width()//div的宽度 $('#fixedHead')[0].scrollWidth//滚动条的宽度 两者的差为滚动条的宽度 var b1=$("#d ...

  7. python 自然语言处理库https://www.nltk.org/nltk_data/

    https://www.nltk.org/nltk_data/ https://github.com/hankcs/HanLP

  8. Bootstrap 辅助类

    [Bootstrap 辅助类] 1.背景色 2. <p>插入符实例 <span class="caret"></span> </p> ...

  9. as3.0中如何阻止事件冒泡

    原作者:菩提树下的杨过转载出处:http://yjmyzz.cnblogs.com 本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究 ...

  10. PHP 获取 IE浏览器版本号

    function getIEBrowserVersion(){ $agent = strtolower($_SERVER['HTTP_USER_AGENT']); if(strpos($agent, ...