平常我們寫程式的時候經常會遇到這樣的問題。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的原因。所以仔細看)。