您如何解决KERN_PROTECTION_FAILURE和KERN_INVALID ADDRESS?
当我运行我的应用程序时,两者似乎都发生在完全相同的位置.
当我运行我的应用程序时,两者似乎都发生在完全相同的位置.
Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x6d783f44 Crashed Thread: 2 Thread 2 Crashed: 0 libobjc.A.dylib 0x34a80464 objc_msgSend + 16 1 Foundation 0x31171dda __+[__NSOperationInternal _observeValueForKeyPath:ofObject:changeKind:oldValue:newValue:indexes:context:]_block_invoke_7 + 10 2 libSystem.B.dylib 0x30dd9678 _dispatch_call_block_and_release + 12 3 libSystem.B.dylib 0x30dd9b98 _dispatch_worker_thread2 + 120 4 libSystem.B.dylib 0x30d7e24a _pthread_wqthread + 258 5 libSystem.B.dylib 0x30d76970 start_wqthread + 0
和:
Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x00000011 Crashed Thread: 7 Thread 7 Crashed: 0 libobjc.A.dylib 0x34a80464 objc_msgSend + 16 1 Foundation 0x31171dfc -[NSOperation completionBlock] + 16 2 Foundation 0x31171dda __+[__NSOperationInternal _observeValueForKeyPath:ofObject:changeKind:oldValue:newValue:indexes:context:]_block_invoke_7 + 10 3 libSystem.B.dylib 0x30dd9678 _dispatch_call_block_and_release + 12 4 libSystem.B.dylib 0x30dd9b98 _dispatch_worker_thread2 + 120 5 libSystem.B.dylib 0x30d7e24a _pthread_wqthread + 258 6 libSystem.B.dylib 0x30d76970 start_wqthread + 0
奇怪的是,它在iPad 1(iOS 4.2.1)上崩溃,但不在iPad 2(iOS 4.3.2)上.
这可能是iPad本身还是与内存有关的问题?还是我的代码真的是一个bug?如果是这样,为什么我不能在iPad 2上重现它?