Strange crashes in iOS signal and exc_bad_access error analysis

Source: Internet
Author: User

What is signal

In Computer science, signaling (English: signals) is a restrictive way of interprocess communication in Unix, Unix-like, and other POSIX-compliant operating systems. It is an asynchronous notification mechanism used to alert a process that an event has occurred. When a signal is sent to a process, the operating system interrupts the normal process of control, at which point any non-atomic operations are interrupted. If a process defines a handler for a signal, it is executed, otherwise the default handler function is executed.

The objective-c exception (NSException) that is not captured in iOS causes the program to crash itself by sending a SIGABRT signal to itself.

Types of signal signals

sigabrt– Program abort Command abort signal
sigalrm– Program Timeout signal
sigfpe– program floating point anomaly signal
sigill– Program Illegal Command signal
sighup– Program Terminal Stop signal
sigint– Program Keyboard Interrupt Signal
sigkill– program end receive abort signal
sigterm– Program Kill stop Signal
sigstop– Program Keyboard Abort signal
sigsegv– Program Invalid memory abort signal
sigbus– Program Memory byte misaligned abort signal
sigpipe– program socket send failed abort signal
iOS exception capture There is an explanation of the various signals in this article.

Sigabrt

As far as crash is concerned, SIGABRT is a better solution because he is a manageable crash. The app terminates at one destination because the system realizes that the app has done something he can't support.

Typically, a SIGABRT exception is caused by an object that receives an implementation message. Or, in simple terms, a non-existent method is called on an object.

SIGSEGV

SIGSEGV program Invalid memory stop signal, generally indicates that the memory is not legal,

Sigbus

Sigbus Program Memory byte misaligned abort signal,

Interception of signal and exception's calm collapse

A nice crash far away, integration into the project can capture crash information Dssignalhandlerdemo
This is a prevention of the source of the crash, you can make some of the original operation will pop Uialertview. There are two kinds of signals in the crash: SIGSEGV, SIGABRT, there are some signals you can write up to mention a PR to me.

For the source of the operation diagram, where signal signal (EGV) The first click of the time can pop alert, if the second click will not crash and alert, feel like a card dead.

and the signal (BRT) in the wrong number of clicks is no problem or can continue. Personal speculation may be that SIGSEGV this signal error will cause the entire process to hang.

Note: When testing the signal type of crash, do not test in debug mode under Xcode. Because the system debug will take precedence to intercept. You should build a good app and click Run app to test it.

Strange crashes in iOS signal and exc_bad_access error analysis

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.