微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

是什么原因导致此iPhone崩溃日志?

如何解决是什么原因导致此iPhone崩溃日志?

| 我有点卡住,需要解决此问题,因为我的一个应用程序显示随机崩溃,无法始终复制。这是崩溃日志之一:
Incident Identifier: 59865612-9F00-44EA-9474-2BF607AD662E
CrashReporter Key:   bea17b7f4237e78a13ce60449d694621d0f16a44
Hardware Model:      iPhone2,1
Process:         APPNAME [82]
Path:            /var/mobile/Applications/ACE9A1A2-F1BE-43E0-9775-1291723D4C4A/APPNAME.app/APPNAME
Identifier:      APPNAME
Version:         ??? (???)
Code Type:       ARM (Native)
Parent Process:  launchd [1]

Date/Time:       2011-05-21 19:10:27.893 +0100
OS Version:      iPhone OS 4.3.3 (8J2)
Report Version:  104

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

Thread 0 name:  dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libobjc.A.dylib                 0x33b24c98 objc_msgSend + 16
1   Foundation                      0x344507b4 __NSFireTimer + 112
2   CoreFoundation                  0x3039ca40 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 8
3   CoreFoundation                  0x3039eec4 __CFRunLoopDoTimer + 844
4   CoreFoundation                  0x3039f83e __CFRunLoopRun + 1082
5   CoreFoundation                  0x3032febc CFRunLoopRunSpecific + 224
6   CoreFoundation                  0x3032fdc4 CFRunLoopRunInMode + 52
7   GraphicsServices                0x3448e418 0x3448a000 + 17432
8   GraphicsServices                0x3448e4c4 0x3448a000 + 17604
9   UIKit                           0x33f3cd62 -[UIApplication _run] + 398
10  UIKit                           0x33f3a800 UIApplicationMain + 664
11  APPNAME                         0x00002d88 0x1000 + 7560
12  APPNAME                         0x00002d3c 0x1000 + 7484

Thread 1 name:  dispatch queue: com.apple.libdispatch-manager
Thread 1:
0   libsystem_kernel.dylib          0x36100fbc kevent + 24
1   libdispatch.dylib               0x33d0b032 _dispatch_mgr_invoke + 706
2   libdispatch.dylib               0x33d0c03a _dispatch_queue_invoke + 86
3   libdispatch.dylib               0x33d0b5ea _dispatch_worker_thread2 + 186
4   libsystem_c.dylib               0x33e0a58a _pthread_wqthread + 258
5   libsystem_c.dylib               0x33e0abbc start_wqthread + 0

Thread 2 name:  WebThread
Thread 2:
0   libsystem_kernel.dylib          0x360fdc00 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x360fd758 mach_msg + 44
2   CoreFoundation                  0x3039d2b8 __CFRunLoopServiceMachPort + 88
3   CoreFoundation                  0x3039f562 __CFRunLoopRun + 350
4   CoreFoundation                  0x3032febc CFRunLoopRunSpecific + 224
5   CoreFoundation                  0x3032fdc4 CFRunLoopRunInMode + 52
6   WebCore                         0x34c2627e RunWebThread(void*) + 382
7   libsystem_c.dylib               0x33e0930a _pthread_start + 242
8   libsystem_c.dylib               0x33e0abb4 thread_start + 0

Thread 3:
0   libsystem_kernel.dylib          0x360fdc00 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x360fd758 mach_msg + 44
2   CoreFoundation                  0x3039d2b8 __CFRunLoopServiceMachPort + 88
3   CoreFoundation                  0x3039f562 __CFRunLoopRun + 350
4   CoreFoundation                  0x3032febc CFRunLoopRunSpecific + 224
5   CoreFoundation                  0x3032fdc4 CFRunLoopRunInMode + 52
6   Foundation                      0x343ea7f6 +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:] + 206
7   Foundation                      0x343dd382 -[NSThread main] + 38
8   Foundation                      0x3444f5c6 __NSThread__main__ + 966
9   libsystem_c.dylib               0x33e0930a _pthread_start + 242
10  libsystem_c.dylib               0x33e0abb4 thread_start + 0

Thread 4 name:  com.apple.CFSocket.private
Thread 4:
0   libsystem_kernel.dylib          0x360ffc60 __select + 20
1   CoreFoundation                  0x303a28f2 __CFSocketManager + 582
2   libsystem_c.dylib               0x33e0930a _pthread_start + 242
3   libsystem_c.dylib               0x33e0abb4 thread_start + 0

Thread 5:
0   libsystem_kernel.dylib          0x361003ec __workq_kernreturn + 8
1   libsystem_c.dylib               0x33e0a6d8 _pthread_wqthread + 592
2   libsystem_c.dylib               0x33e0abbc start_wqthread + 0

Thread 6:
0   libsystem_kernel.dylib          0x361003ec __workq_kernreturn + 8
1   libsystem_c.dylib               0x33e0a6d8 _pthread_wqthread + 592
2   libsystem_c.dylib               0x33e0abbc start_wqthread + 0

Thread 7:
0   libsystem_kernel.dylib          0x361003ec __workq_kernreturn + 8
1   libsystem_c.dylib               0x33e0a6d8 _pthread_wqthread + 592
2   libsystem_c.dylib               0x33e0abbc start_wqthread + 0

Thread 8:
0   libsystem_kernel.dylib          0x361003ec __workq_kernreturn + 8
1   libsystem_c.dylib               0x33e0a6d8 _pthread_wqthread + 592
2   libsystem_c.dylib               0x33e0abbc start_wqthread + 0

Thread 0 crashed with ARM Thread State:
r0: 0x04246810    r1: 0x33738814      r2: 0x042b3704      r3: 0x00000000
r4: 0x00000001    r5: 0x00000001      r6: 0x00259330      r7: 0x2fdfeb30
r8: 0x002593d0    r9: 0x00000000     r10: 0x04241720     r11: 0x00000000
ip: 0x3fa3f4e8    sp: 0x2fdfea60      lr: 0x349077bb      pc: 0x33dfcc98
  cpsr: 0x280f0030
有人可以对可能的原因提出建议吗? 谢谢!     

解决方法

看来您有一个计时器触发,并尝试将消息发送到已取消分配的对象。     ,关键点是:
Exception Type: EXC_BAD_ACCESS (SIGBUS)
当您尝试访问先前发布的对象时,会发生这种情况。由于您正在尝试访问计时器的回调中的对象,因此可能发生的情况是,当计时器响应某个对象时,该对象已被释放。 您可以通过启用NSZombie环境变量来跟踪对象。     ,创建NSTimer时,至关重要的是要保留引用,然后在要调用的对象消失时使其无效。像这样:
[self.bugZapTimer invalidate];
self.bugZapTimer = [NSTimer timerWithTimeInterval: 0.1
                                           target: self
                                         selector: @selector(bugZapTimer:)
                                         userInfo: NULL
                                          repeats: FALSE];
[[NSRunLoop currentRunLoop] addTimer:self.bugZapTimer forMode: NSDefaultRunLoopMode];
然后,必须在dealloc方法中执行以下操作:
[self.bugZapTimer invalidate];
self.bugZapTimer = nil;
    

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。