我的应用程序不会在设备上崩溃。无泄漏,无内存警告。我过着幸福的生活。但是最近我正在使用Instrument(Automation)进行一些UI测试。 oom!使用大约8分钟后,应用崩溃。循环约30次。而且它不断崩溃,但是经过不同的持续时间却全部在同一步骤。再次,没有泄漏,没有内存警告。再次说明,它不会在没有仪器的设备上崩溃,与我的应用使用多长时间无关。
+每当我弹出特定的ViewController之后,它就会崩溃。并且该 View Controller 加载了一些东西(图像 View ,播放和录制音频,从相册和相机拍摄照片)
这是设备日志。任何帮助都将受到高度赞赏。

Incident Identifier:
CrashReporter Key:
Hardware Model:      iPhone5,2
Process:         My App [15196]
Path:
Identifier:      My App
Version:         ??? (???)
Code Type:       ARM (Native)
Parent Process:  launchd [1]

Date/Time:       2013-08-16 12:48:10.814 +0200
OS Version:      iOS 6.1.3 (10B329)
Report Version:  104

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x1208b319
Crashed Thread:  6

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0:
0   libsystem_kernel.dylib          0x39be3e30 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x39be3fd0 mach_msg + 48
2   CoreFoundation                  0x319da2b6 __CFRunLoopServiceMachPort + 126
3   CoreFoundation                  0x319d8fd6 __CFRunLoopRun + 814
4   CoreFoundation                  0x3194c238 CFRunLoopRunSpecific + 352
5   CoreFoundation                  0x3194c0c4 CFRunLoopRunInMode + 100
6   GraphicsServices                0x3552b336 GSEventRunModal + 70
7   UIKit                           0x338682b4 UIApplicationMain + 1116
8   MyApp                       0x0000531e 0x3000 + 8990
9   MyApp                       0x000052d4 0x3000 + 8916

Thread 1 name:  Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0   libsystem_kernel.dylib          0x39be45d0 kevent64 + 24
1   libdispatch.dylib               0x39b1fd22 _dispatch_mgr_invoke + 806
2   libdispatch.dylib               0x39b1b374 _dispatch_mgr_thread + 32

Thread 2 name:  WebThread
Thread 2:
0   libsystem_kernel.dylib          0x39be3e30 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x39be3fd0 mach_msg + 48
2   CoreFoundation                  0x319da2b6 __CFRunLoopServiceMachPort + 126
3   CoreFoundation                  0x319d902c __CFRunLoopRun + 900
4   CoreFoundation                  0x3194c238 CFRunLoopRunSpecific + 352
5   CoreFoundation                  0x3194c0c4 CFRunLoopRunInMode + 100
6   WebCore                         0x37954390 RunWebThread(void*) + 440
7   libsystem_c.dylib               0x39b4d0de _pthread_start + 306
8   libsystem_c.dylib               0x39b4cfa4 thread_start + 4

Thread 3:
0   libsystem_kernel.dylib          0x39be3e30 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x39be3fd0 mach_msg + 48
2   CoreFoundation                  0x319da2b6 __CFRunLoopServiceMachPort + 126
3   CoreFoundation                  0x319d902c __CFRunLoopRun + 900
4   CoreFoundation                  0x3194c238 CFRunLoopRunSpecific + 352
5   CoreFoundation                  0x3194c0c4 CFRunLoopRunInMode + 100
6   Foundation                      0x322705be -[NSRunLoop(NSRunLoop) runMode:beforeDate:]     + 250
7   MyApp                       0x00020b0a 0x3000 + 121610
8   Foundation                      0x3231d22c __NSThread__main__ + 968
9   libsystem_c.dylib               0x39b4d0de _pthread_start + 306
10  libsystem_c.dylib               0x39b4cfa4 thread_start + 4

Thread 4 name:  com.apple.NSURLConnectionLoader
Thread 4:
0   libsystem_kernel.dylib          0x39be3e30 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x39be3fd0 mach_msg + 48
2   CoreFoundation                  0x319da2b6 __CFRunLoopServiceMachPort + 126
3   CoreFoundation                  0x319d902c __CFRunLoopRun + 900
4   CoreFoundation                  0x3194c238 CFRunLoopRunSpecific + 352
5   CoreFoundation                  0x3194c0c4 CFRunLoopRunInMode + 100
6   Foundation                      0x32299888 +[NSURLConnection(Loader)     _resourceLoadLoop:] + 304
7   Foundation                      0x3231d22c __NSThread__main__ + 968
8   libsystem_c.dylib               0x39b4d0de _pthread_start + 306
9   libsystem_c.dylib               0x39b4cfa4 thread_start + 4

Thread 5 name:  com.apple.CFSocket.private
Thread 5:
0   libsystem_kernel.dylib          0x39bf4594 __select + 20
1   CoreFoundation                  0x319de474 __CFSocketManager + 676
2   libsystem_c.dylib               0x39b4d0de _pthread_start + 306
3   libsystem_c.dylib               0x39b4cfa4 thread_start + 4

Thread 6 Crashed:
0   Foundation                      0x3231d692 __NSFinalizeThreadData + 122
1   CoreFoundation                  0x319d6212 __CFTSDFinalize + 62
2   libsystem_c.dylib               0x39b3feb8 _pthread_tsd_cleanup + 172
3   libsystem_c.dylib               0x39b3fb8e _pthread_exit + 114
4   libsystem_c.dylib               0x39b42ade _pthread_workq_return + 22
5   libsystem_c.dylib               0x39b427f2 _pthread_wqthread + 362
6   libsystem_c.dylib               0x39b42680 start_wqthread + 4

Thread 7:
0   libsystem_kernel.dylib          0x39bf4d98 __workq_kernreturn + 8
1   libsystem_c.dylib               0x39b42ad6 _pthread_workq_return + 14
2   libsystem_c.dylib               0x39b427f2 _pthread_wqthread + 362
3   libsystem_c.dylib               0x39b42680 start_wqthread + 4

Thread 8:
0   libsystem_kernel.dylib          0x39bf4d98 __workq_kernreturn + 8
1   libsystem_c.dylib               0x39b42ad6 _pthread_workq_return + 14
2   libsystem_c.dylib               0x39b427f2 _pthread_wqthread + 362
3   libsystem_c.dylib               0x39b42680 start_wqthread + 4

Thread 9 name:  AURemoteIO::IOThread
Thread 9:
0   libsystem_kernel.dylib          0x39be3e30 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x39be3fd0 mach_msg + 48
2   AudioToolbox                    0x314cdc80 AURemoteIO::IOThread::Run() + 104
3   AudioToolbox                    0x314d000c AURemoteIO::IOThread::Entry(void*) + 4
4   AudioToolbox                    0x3140d9f2 CAPThread::Entry(CAPThread*) + 294
5   libsystem_c.dylib               0x39b4d0de _pthread_start + 306
6   libsystem_c.dylib               0x39b4cfa4 thread_start + 4

Thread 6 crashed with ARM Thread State (32-bit):
r0: 0x0010f522    r1: 0x39700941      r2: 0x39e57e88      r3: 0x1f8dc028
r4: 0x1208b2fd    r5: 0x0000001c      r6: 0x00000000      r7: 0x04af9f18
r8: 0x1f8dc028    r9: 0x007f8014     r10: 0x00000004     r11: 0x00000037
ip: 0x39d4db30    sp: 0x04af9d50      lr: 0x31946eb7      pc: 0x3231d692
cpsr: 0x20000030

最佳答案

EXC_BAD_ACCESS通常意味着您正在将 objective-c 消息发送到无效的内存地址。发生这种情况是因为您正在使用的对象已被释放。

使用NSZombieEnabled获取更多信息。
开始注释掉东西。这是一个内存问题,找到令人讨厌的代码行。

关于objective-c - 仅当从仪器运行时,iOS应用程序才会崩溃(自动化),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/18274135/

10-16 19:22