欢迎来到Doc100.Net免费学习资源知识分享平台!
您的位置:首页 > 程序异常 >

sigabrt跟exc_bad_access引起的crash

更新时间: 2014-01-05 02:24:46 责任编辑: Author_N1

 

SIGABRT和EXC_BAD_ACCESS引起的crash

1、

平常我们写程序的时候经常会遇到这样的问题。program received signal:SIGABRT 以及EXC_BAD_ACCESS

SIGABRT 一般是过度release 或者 发送 unrecogized selector导致。

EXC_BAD_ACCESS 是访问已被释放的内存导致。

查了下StackOverflow。找到下面的答案,说道linux内核下面了!

SIGABRT is raised by the abort(3) function. It's impossible to tell exactly what's going on in your program without more information, but the most common reasons that abort() gets called are:

  • Your sending a message to an Objective-C object that doesn't support/implement that message. This results in the dreaded "unrecognized selector sent to instance" error.(你发送给对象一个它并不支持或者是没实现的消息,这导致可怕的 "unrecognized selector sent to instance" 错误
  • You have a failed assertion somewhere. In non-debug builds that define the macro NDEBUG, the standard library macro assert(3) calls abort() when the assertion fails.(某个地方你做了个错误的判断)
  • You have some memory stomping/allocation error. When malloc/free detect a corrupted heap, the may call abort() (see, e.g. this question)
  • You're throwing an uncaught exception (either a C++ exception or an Objective-C exception)(内存分配出错,内存泄露,会调用abort())

In almost all cases, the debug console will give you a little more information about what's causingabort() to be called, so always take a look there.

(多数情况下,调试控制台会给你更多的信息关于导致了abort的原因。所以仔细看)。

2、SIGABRT是处于程序控制状态下的crash,SIGABRT引起的crash是因为系统发现了应用程序正在做一些系统不希望它去做的事情(Exception)。

上一篇:上一篇
下一篇:下一篇

 

随机推荐程序问答结果

 

 

如对文章有任何疑问请提交到问题反馈,或者您对内容不满意,请您反馈给我们DOC100.NET论坛发贴求解。
DOC100.NET资源网,机器学习分类整理更新日期::2014-01-05 02:24:46
如需转载,请注明文章出处和来源网址:http://www.doc100.net/bugs/t/9467/
本文WWW.DOC100.NET DOC100.NET版权所有。