0

I'm trying to debug an app which only crashes when executing a specific action when the debugging cable is not connected. The crash log generated only provides a stack trace through Apple classes from int main. How can I debug this better?

I build and run the app from xcode. Then I kill the app and disconnect the cable. When I start the app again and perform the action, the app crashes.

The exception generated is an EXC_BAD_ACCESS

I have read in a possibly related question to enable compiler optimisations, but I'm not recompiling my app between the crashes.

iOS app crash only when not debugging

Incident Identifier: F76048C0-A734-4C6C-A735-0EDD5C29A572
CrashReporter Key:   b2e2d243e5e9aa3a220c93d2d9ef57c03fcf7067
Hardware Model:      iPad2,7
Process:             bott2014 [1086]
Path:                /var/mobile/Applications/F9C9A611-D256-4A98-92F9-B340BFF8504B/bott2014.app/bott2014
Identifier:          --snip--
Version:             14092402 (2.0)
Code Type:           ARM (Native)
Parent Process:      launchd [1]

Date/Time:           2015-01-12 15:54:30.507 +0100
OS Version:          iOS 7.1 (11D167)
Report Version:      104

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x426c0004
Triggered by Thread:  0

Thread 0 Crashed:
0   CoreFoundation                  0x2e266764 CFRelease + 20
1   CoreFoundation                  0x2e271e54 -[__NSArrayM dealloc] + 152
2   libobjc.A.dylib                 0x3901bb66 objc_object::sidetable_release(bool) + 170
3   CoreData                        0x2e0d10ae -[NSSQLEntity dealloc] + 330
4   libobjc.A.dylib                 0x3901bb66 objc_object::sidetable_release(bool) + 170
5   CoreFoundation                  0x2e266978 CFRelease + 552
6   CoreFoundation                  0x2e271e54 -[__NSArrayM dealloc] + 152
7   libobjc.A.dylib                 0x3901bb66 objc_object::sidetable_release(bool) + 170
8   CoreData                        0x2e15c952 -[NSSQLModel dealloc] + 302
9   libobjc.A.dylib                 0x3901bb66 objc_object::sidetable_release(bool) + 170
10  CoreData                        0x2e13ed74 -[NSSQLCore dealloc] + 188
11  libobjc.A.dylib                 0x3901bb66 objc_object::sidetable_release(bool) + 170
12  CoreFoundation                  0x2e266978 CFRelease + 552
13  CoreFoundation                  0x2e26e504 -[__NSArrayI dealloc] + 60
14  libobjc.A.dylib                 0x3901bb66 objc_object::sidetable_release(bool) + 170
15  libobjc.A.dylib                 0x3901c0d2 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 354
16  CoreFoundation                  0x2e269ca4 _CFAutoreleasePoolPop + 12
17  UIKit                           0x30b4a5c4 _wrapRunLoopWithAutoreleasePoolHandler + 32
18  CoreFoundation                  0x2e3012a2 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 18
19  CoreFoundation                  0x2e2fec44 __CFRunLoopDoObservers + 280
20  CoreFoundation                  0x2e2fef86 __CFRunLoopRun + 726
21  CoreFoundation                  0x2e269f4a CFRunLoopRunSpecific + 518
22  CoreFoundation                  0x2e269d2e CFRunLoopRunInMode + 102
23  GraphicsServices                0x3319c65e GSEventRunModal + 134
24  UIKit                           0x30bb5168 UIApplicationMain + 1132
25  bott2014                        0x0009fffc 0x13000 + 577532
26  libdyld.dylib                   0x39519ab4 start + 0

Thread 1:
0   libsystem_kernel.dylib          0x395bc808 kevent64 + 24
1   libdispatch.dylib               0x394fe078 _dispatch_mgr_invoke + 228
2   libdispatch.dylib               0x394fddfe _dispatch_mgr_thread$VARIANT$mp + 34

Thread 2:
0   libsystem_kernel.dylib          0x395cfc70 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x39636bda _pthread_wqthread + 306
2   libsystem_pthread.dylib         0x39636a94 start_wqthread + 4

Thread 3:
0   libsystem_kernel.dylib          0x395cfc70 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x39636bda _pthread_wqthread + 306
2   libsystem_pthread.dylib         0x39636a94 start_wqthread + 4

Thread 4 name:  com.apple.NSURLConnectionLoader
Thread 4:
0   libsystem_kernel.dylib          0x395bca58 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x395bc854 mach_msg + 44
2   CoreFoundation                  0x2e300896 __CFRunLoopServiceMachPort + 150
3   CoreFoundation                  0x2e2fefbc __CFRunLoopRun + 780
4   CoreFoundation                  0x2e269f4a CFRunLoopRunSpecific + 518
5   CoreFoundation                  0x2e269d2e CFRunLoopRunInMode + 102
6   Foundation                      0x2eca9082 +[NSURLConnection(Loader) _resourceLoadLoop:] + 314
7   Foundation                      0x2ed1ea5a __NSThread__main__ + 1058
8   libsystem_pthread.dylib         0x39638916 _pthread_body + 138
9   libsystem_pthread.dylib         0x39638886 _pthread_start + 98
10  libsystem_pthread.dylib         0x39636aa0 thread_start + 4

Thread 5 name:  AFNetworking
Thread 5:
0   libsystem_kernel.dylib          0x395bca58 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x395bc854 mach_msg + 44
2   CoreFoundation                  0x2e300896 __CFRunLoopServiceMachPort + 150
3   CoreFoundation                  0x2e2fefbc __CFRunLoopRun + 780
4   CoreFoundation                  0x2e269f4a CFRunLoopRunSpecific + 518
5   CoreFoundation                  0x2e269d2e CFRunLoopRunInMode + 102
6   Foundation                      0x2ec5c1e6 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 250
7   Foundation                      0x2ecad09c -[NSRunLoop(NSRunLoop) run] + 76
8   bott2014                        0x00036a4c 0x13000 + 145996
9   Foundation                      0x2ed1ea5a __NSThread__main__ + 1058
10  libsystem_pthread.dylib         0x39638916 _pthread_body + 138
11  libsystem_pthread.dylib         0x39638886 _pthread_start + 98
12  libsystem_pthread.dylib         0x39636aa0 thread_start + 4

Thread 6 name:  com.apple.CFSocket.private
Thread 6:
0   libsystem_kernel.dylib          0x395cf434 __select + 20
1   CoreFoundation                  0x2e304758 __CFSocketManager + 480
2   libsystem_pthread.dylib         0x39638916 _pthread_body + 138
3   libsystem_pthread.dylib         0x39638886 _pthread_start + 98
4   libsystem_pthread.dylib         0x39636aa0 thread_start + 4

Thread 7:
0   libsystem_kernel.dylib          0x395bca58 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x395bc854 mach_msg + 44
2   CoreFoundation                  0x2e300896 __CFRunLoopServiceMachPort + 150
3   CoreFoundation                  0x2e2fefbc __CFRunLoopRun + 780
4   CoreFoundation                  0x2e269f4a CFRunLoopRunSpecific + 518
5   CoreFoundation                  0x2e269d2e CFRunLoopRunInMode + 102
6   libAVFAudio.dylib               0x2d2e144c GenericRunLoopThread::Entry(void*) + 124
7   libAVFAudio.dylib               0x2d2d57bc CAPThread::Entry(CAPThread*) + 176
8   libsystem_pthread.dylib         0x39638916 _pthread_body + 138
9   libsystem_pthread.dylib         0x39638886 _pthread_start + 98
10  libsystem_pthread.dylib         0x39636aa0 thread_start + 4

Thread 8 name:  com.apple.coremedia.player.async
Thread 8:
0   libsystem_kernel.dylib          0x395bcaa8 semaphore_wait_trap + 8
1   libdispatch.dylib               0x394fc23c _dispatch_semaphore_wait_slow + 172
2   MediaToolbox                    0x2f785ab4 fpa_AsyncMovieControlThread + 1752
3   CoreMedia                       0x2e8981e0 figThreadMain + 192
4   libsystem_pthread.dylib         0x39638916 _pthread_body + 138
5   libsystem_pthread.dylib         0x39638886 _pthread_start + 98
6   libsystem_pthread.dylib         0x39636aa0 thread_start + 4

Thread 9:
0   libsystem_kernel.dylib          0x395bca58 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x395bc854 mach_msg + 44
2   CoreFoundation                  0x2e300896 __CFRunLoopServiceMachPort + 150
3   CoreFoundation                  0x2e2fefbc __CFRunLoopRun + 780
4   CoreFoundation                  0x2e269f4a CFRunLoopRunSpecific + 518
5   CoreFoundation                  0x2e269d2e CFRunLoopRunInMode + 102
6   AudioToolbox                    0x2dc3f874 GenericRunLoopThread::Entry(void*) + 124
7   AudioToolbox                    0x2dc25fc0 CAPThread::Entry(CAPThread*) + 208
8   libsystem_pthread.dylib         0x39638916 _pthread_body + 138
9   libsystem_pthread.dylib         0x39638886 _pthread_start + 98
10  libsystem_pthread.dylib         0x39636aa0 thread_start + 4

Thread 10 name:  WebThread
Thread 10:
0   libsystem_kernel.dylib          0x395bca58 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x395bc854 mach_msg + 44
2   CoreFoundation                  0x2e300896 __CFRunLoopServiceMachPort + 150
3   CoreFoundation                  0x2e2fefbc __CFRunLoopRun + 780
4   CoreFoundation                  0x2e269f4a CFRunLoopRunSpecific + 518
5   CoreFoundation                  0x2e269d2e CFRunLoopRunInMode + 102
6   WebCore                         0x367f738e RunWebThread(void*) + 414
7   libsystem_pthread.dylib         0x39638916 _pthread_body + 138
8   libsystem_pthread.dylib         0x39638886 _pthread_start + 98
9   libsystem_pthread.dylib         0x39636aa0 thread_start + 4

Thread 0 crashed with ARM Thread State (32-bit):
    r0: 0x426c0000    r1: 0xfffffffe      r2: 0xffffffff      r3: 0xffffffff
    r4: 0x00000001    r5: 0x00000001      r6: 0x426c0000      r7: 0x27def8d0
    r8: 0x426c0000    r9: 0x16bc4830     r10: 0x397ea0fc     r11: 0x165c1e00
    ip: 0x2e271dbd    sp: 0x27def890      lr: 0x2e271e59      pc: 0x2e266764
  cpsr: 0x20000030

Binary Images:
-- snipped binary images list
Community
  • 1
  • 1
Ruben
  • 796
  • 3
  • 9
  • 21
  • 4
    Without a symbolicated crash report and the relevant source code, it is not possible to answer your question. – Kerni Jan 13 '15 at 14:20
  • Please, provide some source code. When does this happen(i.e. does it happen on a specific `UIViewController` or overall). Could you use the built-in Xcode Zombies function for debugging? Does it happen when you enter a `UIViewController`, when you click a `UIButton`, open a `UIActionSheet` or something else? – Gabriel Tomitsuka Jan 13 '15 at 14:25
  • Isn't there a crash report generated on the device that you can use to get a decent stacktrace? – Droppy Jan 13 '15 at 14:27
  • I have provided the crash log generated on the device, the code gets executed, I can place a UIAlertView after pressing the button and it shows right before the crash happens. I can not provided source code, however, as I fail to pinpoint the problem myself, which is why I'm asking for advice on how to debug this problem, without actually being able to debug. – Ruben Jan 13 '15 at 14:30
  • @Ruben you have provided the crash report, but as already pointed out, its useless until it has been symbolicated. Please do this and edit the question to do that – Simon McLoughlin Jan 13 '15 at 14:37
  • @Ruben That's difficult to do. It's also pretty unusual that it behaves differently when being debugged. – Droppy Jan 13 '15 at 14:39
  • @SimonMcLoughlin I am investigating on how to symbolicate the crash log and will provide it as soon as I figure out how to symbolicate. Possibly this will set me on my way, too. Thanks already :) (I'm not very experienced in iOS development and have quite a big app thrown on my plate to handle by myself) – Ruben Jan 13 '15 at 14:45
  • As far as I can tell, the crash log I have provided is symbolicated...? – Ruben Jan 13 '15 at 15:29
  • Did you solve this crash? – Kong Hantrakool Jun 16 '15 at 16:53
  • No, we hacked around the code causing the crash. – Ruben Jun 21 '15 at 12:42

0 Answers0