tags:

views:

626

answers:

1

I've encountered this weird behavior with my iPhone app. It runs fine on the device when being debugged with Xcode, but when it's run on the device when the device is not connected to my computer it crashes almost immediately. Needless to say, I find this a bit disconcerting since I'm not sure how to debug it.

Anyone have ideas on what's going on or how to debug this type of problem?

I looked in the crash report when I reconnect the device and get the following:

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

Thread 6 Crashed:
0   libobjc.A.dylib                 0x300102ac 0x3000c000 + 17068
1   myapp                            0x000033ba 0x1000 + 9146
2   myapp                           0x0000adc8 0x1000 + 40392
3   Foundation                      0x30553356 0x30501000 + 336726
4   Foundation                      0x305025fe 0x30501000 + 5630
5   libSystem.B.dylib               0x31d6a6ea 0x31d46000 + 149226

and the console log has the following:

Sun Sep 27 19:59:50 unknown ReportCrash[455] <Notice>: Formulating crash report for process myapp[453]
Sun Sep 27 19:59:50 unknown com.apple.launchd[1] <Warning>: (UIKitApplication:com.yourcompany.myapp[0x2fba]) Job appears to have crashed: Bus error
Sun Sep 27 19:59:50 unknown com.apple.mobile.lockdown[14] <Notice>: Could not receive size of message
Sun Sep 27 19:59:50 unknown lockdownd[14] <Error>: (0x834400) handle_connection: Could not receive internal message #2 from myapp Killing connection
Sun Sep 27 19:59:50 unknown SpringBoard[23] <Warning>: Application 'myapp' exited abnormally with signal 10: Bus error

Many thanks

+2  A: 

You can always get to the line of your app where it crash. Open the terminal on the build folder and run this command:

atos -arch armv6 -o myapp.app/myapp 0x000033ba

and it will return the file and line where it was. It's somehow useful.

seppo0010
Most awesomest terminal command ever.
mac_55