iOS崩溃日志中的异常类型 [英] Exception Types in iOS crash logs

查看:288
本文介绍了iOS崩溃日志中的异常类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从我开始学习iOS开发之后,我看到了几种不同类型的崩溃日志。



我知道:
异常类型:EXC_BAD_ACCESS(SIGSEGV)意味着我们正在访问已发布的对象。



但不知道:

异常类型:EXC_BAD_ACCESS(SIGBUS)

异常类型:EXC_CRASH(SIGABRT)

异常类型:EXC_BREAKPOINT(SIGTRAP)



你知道有多少iOS崩溃日志中的异常类型,它们是什么意思?

解决方案


我知道:异常类型:EXC_BAD_ACCESS(SIGSEGV)表示我们正在访问已发布的对象。


否。



SIGSEGV是一个细分错误,意味着您尝试访问无效的内存地址。



这些异常(实际上是他们是信号)与Objective-C无关,但C.
所以你可以得到这样一个例外,没有Objective-C对象。



N ote,一个信号不是例外,这意味着你不能用 @try @catch 块来捕获它们。



您可以使用信号设置信号处理程序 sigaction 函数。请记住一些信号,如SIGABRT无法阻止。



您可以检查维基百科页面关于信号,如果你想要更多的信息。



说,恢复:



SIGSEGV (分段错误)



访问无效的内存地址。该地址存在,但您的程序无法访问。



SIGBUS (总线错误)



访问无效的内存地址。该地址不存在或对齐无效。



SIGFPE (浮点异常)



无效的算术运算。可以与整数操作相关,尽管名称。



SIGPIPE



破碎的管道。



a href =http://en.wikipedia.org/wiki/SIGILL =noreferrer> SIGILL



非法处理器



SIGTRAP



与Debugger相关的



SIGABRT



程序崩溃,与上述信号之一无关。


I've seen a few different types of crash logs since I begin learning iOS development.

I know that: Exception Type: EXC_BAD_ACCESS (SIGSEGV) mean we are accessing a released object.

but don't know about:
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Type: EXC_CRASH (SIGABRT)
Exception Type: EXC_BREAKPOINT (SIGTRAP)

Do you know how many Exception Types in iOS crash logs and what do they mean?

解决方案

I know that: Exception Type: EXC_BAD_ACCESS (SIGSEGV) mean we are accessing a released object.

No.

A SIGSEGV is a segmentation fault, meaning you are trying to access an invalid memory address.

Those exceptions (in fact, they are signals) are not related to Objective-C, but C. So you can get such an exception without Objective-C objects.

Note that a signal is not an exception, meaning you can't catch them with @try and @catch blocks.

You may set a signal handler with the signal and sigaction functions. Keep in mind some signals, like SIGABRT cannot be blocked.

You can check the Wikipedia page about signals, if you want more informations.

That said, to resume:

SIGSEGV (Segmentation fault)

Access to an invalid memory address. The address exist, but your program does not have access to it.

SIGBUS (Bus error)

Access to an invalid memory address. The address does not exist, or the alignment is invalid.

SIGFPE (Floating point exception)

Invalid arithmetic operation. Can be related to integer operations, despite the name.

SIGPIPE

Broken pipe.

SIGILL

Illegal processor instruction.

SIGTRAP

Debugger related

SIGABRT

Program crash, not related to one of the preceding signal.

这篇关于iOS崩溃日志中的异常类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆