iOS Crash 类型

1. Exception Type: 00000020 Exception Codes: 0x000000008badf00d Exception Note: SIMULATED (this is NOT a crash) Application Specific Information:com.wwc.test1 failed to scene-create after 19.94s (launch took 0.06s of total time limit 20.00s)

原因:app如果在20s内没有启动,系统的时间狗就会将程序杀死。也就会说应用启动超时。(注意:程序在真机调试的时候超时,时间狗是不起作用的)

Exception Type:  00000020
Exception Codes: 0x000000008badf00d
Exception Note:  SIMULATED (this is NOT a crash)
Highlighted by Thread:  6
Application Specific Information:
com.wwc.test1 failed to scene-update after 10.00s

其他回答:
According to Apple (see the Tech Notes under Other Exception Types), the exception code 8badf00d means

the application took too long to launch, terminate, or respond to system events.
Also it is suggested that whatever is on Thread
 0 should be moved to a background thread.

Now in regards to Exception
 Note: SIMULATED (this is NOT a crash), iOS won't crash your app if you're running with a debugger and/or in a simulator, therefore it gives you the hint that the app is running SIMULATED and this
 is NOT a crash. But you should review the part that causes the warning as your app will most likely be terminated if it blocks the main thread for too long.


2. Exception Type:  00000020 Exception Codes: 0x000000008badf00d Exception Note:  SIMULATED (this is NOT a crash) Highlighted by Thread:  11 Application Specific Information:
<BKNewProcess: 0x12f623190; com.sina.weibo; pid: 10924; hostpid: -1> has active assertions beyond permitted time: 
{(
    <BKProcessAssertion: 0x12f653f20> id: 10924-F212D20C-B907-46DA-88BB-23E9BF606091 name: Called by UIKit, from <redacted> process: <BKNewProcess: 0x12f623190; com.sina.weibo; pid: 10924; hostpid: -1> permittedBackgroundDuration: 180.000000 reason: finishTask owner pid:10924 preventSuspend  preventIdleSleep  preventSuspendOnSleep 
)}

原因:The result is that when we Go into the background, the watchdog process sees that the app is behaving badly and kills it summarily.(程序退出到后台后,在某一时刻被时间狗杀死)


3. Exception Type:  EXC_RESOURCE Exception Subtype: WAKEUPS Exception Message: (Limit 150/sec) Observed 435/sec over 300 secs Exception Note:  NON-FATAL CONDITION (this is NOT a crash)

原因:Background threads in iOS 8 have a hard limit on how many times you can run a sleep/wake cycle on each thread per second, and having a high count here is usually an indication that something is wrong / inefficient in your thread management.(后台线程的睡眠唤起次数是有限制的 150次)


4. EXC_BAD_ACCESS:最常见的crash,通常用于访问了不该访问的内存导致的。一般其后()还会带有补充信息:SIGSEGV通常由于重复释放对象导致,这种类型在切换ARC之后就会很少见到了;SIGABRT收到abort信号退出,通常foundation库中的容器为了保护状态正常会做一些检测,例如插入nil到数组中等就会触发此类错误;SEGV(segmentation violation)代表无效内存地址,比如空指针、未初始化指针、栈溢出等等;SIGBUS总线错误,与SIGSEGV不同的是,SIGSEGV访问的是无效地址,而SIGBUS访问的是有效地址,但总线访问异常,比如地址对齐问题;SIGILL尝试执行非法的指令,可能不被识别或者没有权限。 


5. SIGABRT 当异常终止一个进程。中止当前进程,返回一个错误代码。该函数产生SIGABRT信号并发送给自己。实际就是系统发现操作异常,调用发送SIGABRT(abort()函数)信号,杀死进程。
解答:这种异常,系统会知道程序在什么地方有不合法的操作,会在控制台输出异常信息。例如:向一个对象发送它无法识别的消息。


6. EXC_BAD_INSTRUCTION:此类异常通常由于线程执行非法指令导致。 


7. EXC_ARITHMETIC:除零错误。


 
常见的异常编码: 
1)0x8badf00d:读作“ate bad food”,就是把数字替换成字母,该编码表示应用是因为发生watchdog超时而被iOS系统终止的。通常是应用话费太多时间而无法启动、终止或者响应系统事件。其后一般会紧接着如下描述: 
Application Specific Information: 
com.xxx.yyy   failed to resume in time 

此类的crash,应该去审视自己APP初始化时做的事情是否正确,是否在主线程请求了网络,或者其他耗时的事情卡住了正常初始化流程。系统通常允许一个APP从启动到可以响应用户事件的事件最多为5s,如果超过了5s,APP就会被系统终止掉。在launch、resume、suspend、quit时都会有响应的时间要求。在highlight thread里面我们可以看到被终止时调用到的位置,xxxxAppDelegate加上行号。一般在连接xcode做调试时,为了方便,系统会暂时禁用掉watchdog,所以此类问题的发现需要使用正常的启动模式。 

2)0xbad22222:该编码表示VoIP(Voice over Internet Protocol)应用因为过于频繁重启而被终止。 

3)0xdead10cc:读作“dead lock”,该代码表示应用因为在后台运行时占用系统资源,如通讯录数据不被释放而被终止。 

4)0xdeadfa11:读作“dead fall”,该代码表示应用是被用户强制退出的。根据苹果文档,强制退出发生在用户长按开关按钮直到出现“滑动来关机”,然后长按home按钮。强制退出将产生包含0xdeadfa11异常编码崩溃日志,因为大多数强制退出是因为应用阻塞了界面。通常在bug造成系统无法响应时可以采长按电源键,当屏幕出现关机确认画面时按下home键即可关闭当前程序。 

5)0xbaaaaaad:用户按住home键和音量键,获取当前内存状态,不代表崩溃,它仅仅是包含了整个系统某一时刻的运行状态。 

6)Low Memory termination。跟一般的crash结构不太一样,通常有Free pages、Wired pages、Purgeable pages、largest process组成,同时会列出当前时刻系统运行所有进程的信息。APP在运行过程中,系统内存紧张时会先发出警告,同时把后台挂起的程序终止掉,最中如果还是内存不够的话就会终止掉当前前台的进程。当接受到内存警告的时候,我们应该释放尽可能多的内存,crash其实也可以看做是对APP的一种保护。 

7)0xc00010ff:程序执行大量耗费CPU和GPU的运算,导致设备过热,出发系统过热保护被系统终止。





  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值