Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to catch EXC_BAD_ACCESS (code=1, address=0x00XXXXXX)?

I'm trying to log all the crashes that are occurring in my app. I've written a signalHandler and an exceptionHandler. I'm registering the signalHandler for all the signals that are defined in sys/signal.h file. And I'm getting my signalHandler method invoked on SIGABRT, SIGUSR1, etc..

The problem is that, I'm getting some weird signals at times, that are not invoking my signalHandler. One example is EXC_BAD_ACCESS (code=1 or 2, address='some memory address'). I've registered SIGSEGV with the signalHandler; in fact I've registered all the defined signals in sys/signal.h file.

If you want to create this EXC_BAD_ACCESS (code=1, address=0x00XXXXXX)signal, just write the following line of code in your app,

NSLog(@"Stupid Log %@ %@");

Can someone please help me, to catch such signals?

Thanks in advance,

Suraj

like image 249
Suran Avatar asked Dec 18 '25 04:12

Suran


1 Answers

You can refer the following links :

EXC_BAD_ACCESS automatic handling

Also look into this :

How to prevent EXC_BAD_ACCESS from crashing an app?

like image 70
V-Xtreme Avatar answered Dec 19 '25 20:12

V-Xtreme



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!