Exception Information
https://developer.apple.com/library/content/technotes/tn2004/tn2123.html
Exception Information
The third part of the crash log shows information about the processor exception that was the immediate cause of the crash. Listing 5 shows a typical example.
Listing 5: Exception information
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000000
Crashed Thread: 0
The "Crashed Thread" field denotes the thread that crashed; it is redundant because the backtrace section highlights the crashing thread.
Note: The "Crashed Thread" field was introduced in version 2 crash logs. Prior to version 6 crash logs it was called "Thread" and it appeared in the process information section.
The most common forms of exception are:
EXC_BAD_ACCESS/KERN_INVALID_ADDRESS— This is caused by the thread accessing unmapped memory. It may be triggered by either a data access or an instruction fetch; the Thread State section describes how to tell the difference.EXC_BAD_ACCESS/KERN_PROTECTION_FAILURE— This is caused by the thread trying to write to read-only memory. This is always caused by a data access.EXC_BAD_INSTRUCTION— This is caused by the thread executing an illegal instruction.EXC_ARITHMETIC/EXC_I386_DIV— This is caused by the thread doing an integer divide by zero on an Intel-based computer.
For memory access exceptions (EXC_BAD_ACCESS) the exception part of the crash log contains the address that triggered the exception (the exception address). In Listing 5 that address is 0x0000000000000000.
Backtrace Information
The fourth part of the crash log, which displays a backtrace for all of the threads in the crashed process, is typically the most interesting. Listing 6 shows an example.
Listing 6: Backtrace information
Thread 0 Crashed:
0 ??? 0000000000 0 + 0
1 com.apple.CoreFoundation 0x942cf0fe CFRunLoopRunSpecific + 18…
2 com.apple.CoreFoundation 0x942cfd38 CFRunLoopRunInMode + 88
3 com.apple.HIToolbox 0x919e58a4 RunCurrentEventLoopInMode…
4 com.apple.HIToolbox 0x919e56bd ReceiveNextEventCommon + …
5 com.apple.HIToolbox 0x919e5531 BlockUntilNextEventMatchi…
6 com.apple.AppKit 0x9390bd5b _DPSNextEvent + 657
7 com.apple.AppKit 0x9390b6a0 -[NSApplication nextEvent…
8 com.apple.AppKit 0x939046d1 -[NSApplication run] + 79…
9 com.apple.AppKit 0x938d19ba NSApplicationMain + 574
10 com.apple.TextEdit 0x00001df6 0x1000 + 3574
In this example there is only one thread, so there's only one backtrace. In a multi-threaded process, there is one backtrace per thread. Thus, it's critical that you identify the thread that crashed. CrashReporter makes this easy by tagging that backtrace with the text "Thread <ThreadNumber> Crashed:". However, it's easy to overlook this text and erroneously assume that the Thread 0 is the one that crashed.
Note: Your process may be multi-threaded even if you don't explicitly create any threads. Various frameworks can create threads on your behalf. For example, CFSocket creates a thread to integrate sockets with the runloop.
Each line of the backtrace describes a nested function invocation (a frame), with the most recently executed function at the top and the least recently executed at the bottom. For each frame, the columns in the backtrace are as follows.
The first column is the frame number, starting at 0 (indicating the function that crashed) and incrementing for each nested function call.
The second column is the name of the binary image containing the code executing in this frame; this is derived by cross referencing the program counter address (from the next column) with the list of loaded binary images.
The third column is the program counter address within the frame. For frame 0 this is typically the address of the instruction that caused the exception. For higher frames this is the return address for that frame. That is, for frame N it points to the next instruction that will execute when the function referenced by frame N - 1 returns.
The fourth column is the symbolic name for the program counter address given in the third column. If you strip debugging symbols before shipping your application to end users, this column will just contain a hex number. You can work out the corresponding symbolic name using the technique described later in this document.
Finally, if your program is multi-threaded, you can often identify which thread is which by looking at the symbolic names deep within the backtrace. For example, in Listing 6, frame 9 lists NSApplicationMain as its symbolic address, indicating that this thread is the main thread. In contrast, the deepest frame for a pthread is always the routine _pthread_start.
Exception Information的更多相关文章
- (学)解决诡异的 Exception type: SocketException 127.0.0.1:80
许久不发博了,老杨听完故事让我持续写一下“十万个为什么” 一.背景: 昨天我们亲密的战友HH刘老板亲临现场,指出我们协用的一个项目,客户方面反馈手持终端系统不定期“卡死”,要我们安排人飞到广州驻场解 ...
- Error Handling and Exception
The default error handling in PHP is very simple.An error message with filename, line number and a m ...
- The formatter threw an exception while trying to deserialize the message in WCF
有一个WCF应用, 主要功能是存储doc, txt等类型文件到database,当文件的大小在16kb之内,调用WCF service能正常工作:但如果文件大小超出16KB之外, 它将抛出这样一个错误 ...
- Delphi:Exception输出堆栈信息
起源: 用习惯了c#之Exception的StackTrace,在程序出异常crash时候能够以其定位出问题的模块及行号,用回Delphi 2009,发现没有这东西. 显然,在编译环境日新月异的今天, ...
- [Training Video - 5] [Groovy Script Test Step - Collections, Exceptions] Exception Handling in groovy
def x = new String[3] x[0] = "A" x[1] = "B" x[2] = "C" log.info"X ...
- WCF : 如何将NetTcpBinding寄宿在IIS7上
摘要 : 从IIS 7 开始, IIS增加了对非HTTP协议的支持. 因此, 自IIS 7之后, 可以将NetTcpBinding等非HTTP协议的Bindings直接寄宿在IIS上面. 本文将介绍如 ...
- SharePoint 2016 配置向导报错 - The 'ListInternal' attribute is not allowed
前言 配置SharePoint 2016的配置向导中,第三步创建配置数据库报错,然后百度.谷歌了一下,都没有解决,自己看日志搞定,也许会有人遇到类似问题,分享一下. 1.配置向导的错误截图,如下图: ...
- Zend Framework 1 - Quick Start
创建 Zend 项目 要创建 Zend 项目,首先要下载并解压 Zend Framework. 安装 Zend Framework 下载最新的 Zend Framework 1.12.20 源码包,( ...
- 通过配置web.config使WCF向外提供HTTPS的Restful Service
如何通过WCF向外提供Restful的Service请看如下链接 http://www.cnblogs.com/mingmingruyuedlut/p/4223116.html 那么如何通过对web. ...
随机推荐
- android studio 0.8.1使用和遇到问题解决
谷歌6月底公布了五大系统,而且android studio同步升级到了android studio 0.8.1.升级了的android studio确实有一些新的变化.执行速度变快,而且还能够选择开发 ...
- QML与C++交互:登陆界面设计
QML与C++交互:登陆界面设计 本文博客链接:http://blog.csdn.net/jdh99,作者:jdh,转载请注明. 环境: 主机:WIN7 开发环境:Qt5.2.1 说明: QML设计前 ...
- Redis开源项目的终极杀手? ——CRUG解读Redis开源协议变更
引言: 数据库制造商 Redis Labs 本周将公司开发的Redis 模块从 AGPL 迁移到将 Apache v2.0 与 Commons Clause 相结合的许可证,对许可证涵盖的软件作了限制 ...
- 图像处理之基础---滤波器之高斯低通滤波器的高斯模板生成c实现
()代码实现 对原图进行高斯平滑,去除图像中的计算噪声void Bmp::MakeGauss(double sigma,double **pdKernel,int *pnWindowSize){ // ...
- b-is-in- (1267, "Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='") SELECT id FROM qqzoneshuoshuo WHERE words=
db-is-in- (1267, "Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8_general_ci, ...
- 01排序的Java实现
比赛描写叙述: 的个数同样时再按ASCII码值排序. 输入: 个字符. 输出: 串的顺序.使得串按基本描写叙述的方式排序. 例子输入: 例子输出: 被AC的代码例如以下: import java.ut ...
- ubuntu 截图工具 Shutter,设置快捷键 Ctrl+Alt+A
系统设置 键盘 快捷键 自定义快捷键
- BZOJ_1115_[POI2009]石子游戏Kam_博弈论
BZOJ_1115_[POI2009]石子游戏Kam_博弈论 Description 有N堆石子,除了第一堆外,每堆石子个数都不少于前一堆的石子个数.两人轮流操作每次操作可以从一堆石子中移走任意多石子 ...
- flask g对象
g对象 一次请求中使用 下面用redirect重定向,不是同一次请求了 g:global 1. g对象是专门用来保存用户的数据的. 2. g对象在一次请求中的所有的代码的地方,都是可以使用的. 使用 ...
- bzoj 2662: [BeiJing wc2012]冻结【分层图+spfa】
死活想不到分层图emmm 基本想法是建立分层图,就是建k+1层原图,然后相邻两层之间把原图的边在上一层的起点与下一层的终点连起来,边权为val/2,表示免了这条边的边权,然后答案就是第0层的s到k层的 ...
