views:

194

answers:

1

I am getting an interesting crash that I can never seem to replicate on the simulator:

Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00000008
Crashed Thread:  0

Thread 0 Crashed:
0   libobjc.A.dylib                 0x3212e86c 0x3212c000 + 10348
1   StockTwits                      0x00016b06 0x1000 + 88838
2   Foundation                      0x30718422 0x306db000 + 250914
3   Foundation                      0x307183a4 0x306db000 + 250788
4   CFNetwork                       0x30933e74 0x30923000 + 69236
5   CFNetwork                       0x30927b70 0x30923000 + 19312
6   CFNetwork                       0x30927e62 0x30923000 + 20066
7   CFNetwork                       0x30927a60 0x30923000 + 19040
8   CFNetwork                       0x30927a12 0x30923000 + 18962
9   CFNetwork                       0x30927990 0x30923000 + 18832
10  CFNetwork                       0x3092790e 0x30923000 + 18702
11  CoreFoundation                  0x30352a86 0x302e1000 + 465542
12  CoreFoundation                  0x30354768 0x302e1000 + 472936
13  CoreFoundation                  0x30355504 0x302e1000 + 476420
14  CoreFoundation                  0x302fe8e4 0x302e1000 + 121060
15  CoreFoundation                  0x302fe7ec 0x302e1000 + 120812
16  GraphicsServices                0x31a776e8 0x31a74000 + 14056
17  GraphicsServices                0x31a77794 0x31a74000 + 14228
18  UIKit                           0x323272a0 0x32321000 + 25248
19  UIKit                           0x32325e10 0x32321000 + 19984
20  StockTwits                      0x00002fd4 0x1000 + 8148
21  StockTwits                      0x00002fa4 0x1000 + 8100

I have NSZombies enabled as well as stack logging. Ran through the static analyzer to make sure all objects are retained and released properly, though I have a feeling it is still related to retain/releasing.

Thoughts?

A: 

You must be dereferencing a NULL pointer, other this crash does not happen. The Static Analyzer is a nice tool for getting hints on things you're doing wrong. However, it not finding an error does not mean that your program is bug-free. Also turning on zomies doe not always help. Sometimes it's just a simple little oversight.

The fact the simulator does not show this problem doesn't say too much. In the end it's a different machine with a different processor and a different architecture. There are occasions where false code runs well on one platform but crashes on the other.

You should re-symbolicate you stack trace and have a close look at that function it's crashing in. If you want more help it's probably best to post some of the code here.

One more hint: these issues are often spread over multiple methods. The analyzer only sees one method at a time. You should have a look at what happened to the objects in your crashing method BEFORE it was entered.

Max Seelemann
How can I re-symbolicate?
Sheehan Alam
The easiest way is to not compile with optimizations at all. Make a Debug configuration build that contains debug symbols. For Symbolicating you might find the answer here: http://stackoverflow.com/questions/1460892/symbolicating-iphone-app-crash-reports
Max Seelemann