在我的Mac OSX Snow Leopard和xcode 4.1以及最后一个SDK上,我的应用程序在我的手机上崩溃了,但是在我的手机 friend 上却没有崩溃。

我遇到了这个错误,我启动了我的应用程序,等待RSS feed,并在2/3秒后崩溃了:
谢谢您的帮助....

Date/Time:       2011-10-07 10:15:54.675 +0200
OS Version:      iPhone OS 4.3.3 (8J2)
Report Version:  104

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

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0:
0   libsystem_kernel.dylib          0x332a5c00 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x332a5758 mach_msg + 44
2   CoreFoundation                  0x329382b8 __CFRunLoopServiceMachPort + 88
3   CoreFoundation                  0x3293a562 __CFRunLoopRun + 350
4   CoreFoundation                  0x328caebc CFRunLoopRunSpecific + 224
5   CoreFoundation                  0x328cadc4 CFRunLoopRunInMode + 52
6   GraphicsServices                0x33433418 GSEventRunModal + 108
7   GraphicsServices                0x334334c4 GSEventRun + 56
8   UIKit                           0x32417d62 -[UIApplication _run] + 398
9   UIKit                           0x32415800 UIApplicationMain + 664

Thread 1:
0   libsystem_kernel.dylib          0x332a83ec __workq_kernreturn + 8
1   libsystem_c.dylib               0x32c966d8 _pthread_wqthread + 592
2   libsystem_c.dylib               0x32c96bbc start_wqthread + 0

Thread 2 name:  Dispatch queue: com.apple.libdispatch-manager
Thread 2:
0   libsystem_kernel.dylib          0x332a8fbc kevent + 24
1   libdispatch.dylib               0x30205032 _dispatch_mgr_invoke + 706
2   libdispatch.dylib               0x3020603a _dispatch_queue_invoke + 86
3   libdispatch.dylib               0x302055ea _dispatch_worker_thread2 + 186
4   libsystem_c.dylib               0x32c9658a _pthread_wqthread + 258
5   libsystem_c.dylib               0x32c96bbc start_wqthread + 0

Thread 3:
0   libsystem_kernel.dylib          0x332a7d18 __semwait_signal + 24
1   libsystem_c.dylib               0x32cbc860 _pthread_cond_wait + 756
2   libsystem_c.dylib               0x32c63eb2 pthread_cond_wait + 26
3   Foundation                      0x33846904 -[NSCondition wait] + 164
4   Cyntact.dylib                   0x0019cebe 0x19c000 + 3774
5   Foundation                      0x33839382 -[NSThread main] + 38
6   Foundation                      0x338ab5c6 __NSThread__main__ + 966
7   libsystem_c.dylib               0x32c9530a _pthread_start + 242
8   libsystem_c.dylib               0x32c96bb4 thread_start + 0

Thread 4 name:  WebThread
Thread 4:
0   libsystem_kernel.dylib          0x332a5c00 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x332a5758 mach_msg + 44
2   CoreFoundation                  0x329382b8 __CFRunLoopServiceMachPort + 88
3   CoreFoundation                  0x3293a562 __CFRunLoopRun + 350
4   CoreFoundation                  0x328caebc CFRunLoopRunSpecific + 224
5   CoreFoundation                  0x328cadc4 CFRunLoopRunInMode + 52
6   WebCore                         0x3114b27e RunWebThread(void*) + 382
7   libsystem_c.dylib               0x32c9530a _pthread_start + 242
8   libsystem_c.dylib               0x32c96bb4 thread_start + 0

Thread 5:
0   libsystem_kernel.dylib          0x332a5c00 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x332a5758 mach_msg + 44
2   CoreFoundation                  0x329382b8 __CFRunLoopServiceMachPort + 88
3   CoreFoundation                  0x3293a562 __CFRunLoopRun + 350
4   CoreFoundation                  0x328caebc CFRunLoopRunSpecific + 224
5   CoreFoundation                  0x3290d6d2 CFRunLoopRun + 42
6                               0x0003f96a 0x1000 + 256362
7   Foundation                      0x33839382 -[NSThread main] + 38
8   Foundation                      0x338ab5c6 __NSThread__main__ + 966
9   libsystem_c.dylib               0x32c9530a _pthread_start + 242
10  libsystem_c.dylib               0x32c96bb4 thread_start + 0

**Thread 6 Crashed:
0   libobjc.A.dylib                 0x32da1c98 objc_msgSend + 16
1   CoreFoundation                  0x328c519a CFRelease + 62
2   CFNetwork                       0x3563c378 HTTPMessage::~HTTPMessage() + 56
3   CFNetwork                       0x3563c336 HTTPMessage::~HTTPMessage() + 2
4   CFNetwork                       0x3563c262 CFClass::FinalizeObj(void const*) + 10
5   CoreFoundation                  0x328c5288 _CFRelease + 160
6   CoreFoundation                  0x328c51ae CFRelease + 82
7   CFNetwork                       0x3564ad52 HTTPReadFilter::~HTTPReadFilter() + 82
8   CFNetwork                       0x3564acf6 HTTPReadFilter::~HTTPReadFilter() + 2
9   CFNetwork                       0x3563c262 CFClass::FinalizeObj(void const*) + 10
10  CoreFoundation                  0x328c5288 _CFRelease + 160
11  CoreFoundation                  0x328c51ae CFRelease + 82
12  CFNetwork                       0x356ba7cc HTTPReadFilter::readStreamFinalize(__CFReadStream*) + 4
13  CFNetwork                       0x3564acea CFNetworkReadStream::httpStreamFinalize(__CFReadStream*, void*) + 10
14  CoreFoundation                  0x32940bd8 __CFStreamDeallocate + 120
15  CoreFoundation                  0x328c5288 _CFRelease + 160
16  CoreFoundation                  0x328c51ae CFRelease + 82
17  CFNetwork                       0x3564a7fc NetConnection::shutdownConnectionStreams() + 64
18  CFNetwork                       0x356b7b38 NetConnection::closeStreamsIfPossibleOrSignalThatThatNeedsToBeDonePrettyPlease() + 20
19  CFNetwork                       0x3568e018 NetConnection::doNotAllowMoreReqeusts() + 24
20  CFNetwork                       0x356c9324 UnauthConnectionArray::removeValueAtIndex(long) + 28
21  CFNetwork                       0x356c7ade HTTPConnectionCacheEntry::removeAllConnections() + 46
22  CFNetwork                       0x356c77ac HTTPConnectionCacheEntry::setHasBeenForgotten() + 20
23  CFNetwork                       0x356c78fc HTTPConnectionCacheDictionary::forgetCacheEntries() + 60
24  CFNetwork                       0x356c792c ConnectionCacheTLS::resetCacheForThisThread() + 12
25  CFNetwork                       0x35648aa0 ConnectionTimerTLS::_timerPurgeEntries(__CFRunLoopTimer*, void*) + 12
26  CoreFoundation                  0x32937a40 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 8
27  CoreFoundation                  0x32939ec4 __CFRunLoopDoTimer + 844
28  CoreFoundation                  0x3293a83e __CFRunLoopRun + 1082
29  CoreFoundation                  0x328caebc CFRunLoopRunSpecific + 224
30  CoreFoundation                  0x328cadc4 CFRunLoopRunInMode + 52
31  Foundation                      0x338467f6 +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:] + 206
32  Foundation                      0x33839382 -[NSThread main] + 38
33  Foundation                      0x338ab5c6 __NSThread__main__ + 966
34  libsystem_c.dylib               0x32c9530a _pthread_start + 242
35  libsystem_c.dylib               0x32c96bb4 thread_start + 0**

Thread 7 name:  com.apple.CFSocket.private
Thread 7:
0   libsystem_kernel.dylib          0x332a7c60 __select + 20
1   CoreFoundation                  0x3293d8f2 __CFSocketManager + 582
2   libsystem_c.dylib               0x32c9530a _pthread_start + 242
3   libsystem_c.dylib               0x32c96bb4 thread_start + 0

最佳答案

EXC_BAD_ACCESS通常意味着您正在将obj c消息发送到无效的内存地址。通常发生这种情况是因为您正在使用的对象已被释放,而您并不期望它会存在(在这里,可能是HTTPMessage)。

**Thread 6 Crashed:
0   libobjc.A.dylib                 0x32da1c98 objc_msgSend + 16
1   CoreFoundation                  0x328c519a CFRelease + 62
2   CFNetwork                       0x3563c378 HTTPMessage::~HTTPMessage() + 56

它可以在另一部手机上工作的原因可能是自动释放的对象无法同时释放。您应该检查保留/释放余额,并可以使用NSZombieEnabled获取更多信息。

关于objective-c - 如何在EXC_BAD_ACCESS(SIGSEGV)上解决KERN_INVALID_ADDRESS,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/7684742/

10-09 02:20