我刚刚将应用程序上传到appstore,它是为ios7开发的。
他们拒绝了应用程序因为崩溃我无法重现... 他们给我发了这份崩溃报告:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000008
Triggered by Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x000000018e0501c8 objc_msgSend + 8
1 UIKit 0x000000018493e940 __97-[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:]_block_invoke718 + 52
2 UIKit 0x00000001846b6504 -[UIViewController _executeAfterAppearanceBlock] + 60
3 UIKit 0x00000001846b646c _applyBlockToCFArrayCopiedToStack + 352
4 UIKit 0x00000001846224c8 _afterCACommitHandler + 540
5 CoreFoundation 0x00000001816270a4 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 28
6 CoreFoundation 0x000000018162432c __CFRunLoopDoObservers + 368
7 CoreFoundation 0x00000001816246b8 __CFRunLoopRun + 760
8 CoreFoundation 0x00000001815656cc CFRunLoopRunSpecific + 448
9 GraphicsServices 0x0000000187201c08 GSEventRunModal + 164
10 UIKit 0x0000000184696fd8 UIApplicationMain + 1152
11 brandnooz 0x00000001000aaa0c 0x100038000 + 469516
12 libdyld.dylib 0x000000018e633a9c start + 0
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x000000018e715aa8 kevent64 + 8
1 libdispatch.dylib 0x000000018e619998 _dispatch_mgr_thread + 48
Thread 2 name: AFNetworking
Thread 2:
0 libsystem_kernel.dylib 0x000000018e715ca0 mach_msg_trap + 8
1 CoreFoundation 0x0000000181626570 __CFRunLoopServiceMachPort + 180
2 CoreFoundation 0x0000000181624700 __CFRunLoopRun + 832
3 CoreFoundation 0x00000001815656cc CFRunLoopRunSpecific + 448
4 Foundation 0x00000001821012c0 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 292
5 Foundation 0x000000018215ed74 -[NSRunLoop(NSRunLoop) run] + 92
6 brandnooz 0x0000000100045280 0x100038000 + 53888
7 Foundation 0x00000001821e8408 __NSThread__main__ + 996
8 libsystem_pthread.dylib 0x000000018e7afe18 _pthread_body + 164
9 libsystem_pthread.dylib 0x000000018e7afd70 _pthread_start + 136
10 libsystem_pthread.dylib 0x000000018e7ad550 thread_start + 0
Thread 3 name: com.apple.NSURLConnectionLoader
Thread 3:
0 libsystem_kernel.dylib 0x000000018e715ca0 mach_msg_trap + 8
1 CoreFoundation 0x0000000181626570 __CFRunLoopServiceMachPort + 180
2 CoreFoundation 0x0000000181624700 __CFRunLoopRun + 832
3 CoreFoundation 0x00000001815656cc CFRunLoopRunSpecific + 448
4 Foundation 0x000000018215a424 +[NSURLConnection(Loader) _resourceLoadLoop:] + 344
5 Foundation 0x00000001821e8408 __NSThread__main__ + 996
6 libsystem_pthread.dylib 0x000000018e7afe18 _pthread_body + 164
7 libsystem_pthread.dylib 0x000000018e7afd70 _pthread_start + 136
8 libsystem_pthread.dylib 0x000000018e7ad550 thread_start + 0
Thread 4 name: com.apple.CFSocket.private
Thread 4:
0 libsystem_kernel.dylib 0x000000018e72e76c __select + 8
1 libsystem_pthread.dylib 0x000000018e7afe18 _pthread_body + 164
2 libsystem_pthread.dylib 0x000000018e7afd70 _pthread_start + 136
3 libsystem_pthread.dylib 0x000000018e7ad550 thread_start + 0
Thread 5 name: Dispatch queue: com.apple.root.high-priority
Thread 5:
0 libsystem_kernel.dylib 0x000000018e72e394 __psynch_cvwait + 8
1 Foundation 0x00000001821cf8e0 -[__NSOperationInternal _waitUntilFinished:] + 100
2 brandnooz 0x0000000100083928 0x100038000 + 309544
3 brandnooz 0x00000001000cf3c0 0x100038000 + 619456
4 libdispatch.dylib 0x000000018e618010 _dispatch_call_block_and_release + 20
5 libdispatch.dylib 0x000000018e617fd0 _dispatch_client_callout + 12
6 libdispatch.dylib 0x000000018e61f2b4 _dispatch_root_queue_drain + 552
7 libdispatch.dylib 0x000000018e61f4f8 _dispatch_worker_thread2 + 72
8 libsystem_pthread.dylib 0x000000018e7ad6b8 _pthread_wqthread + 352
9 libsystem_pthread.dylib 0x000000018e7ad548 start_wqthread + 0
Thread 6 name: Dispatch queue: com.apple.root.default-priority
Thread 6:
0 libsystem_kernel.dylib 0x000000018e715cdc semaphore_wait_trap + 8
1 brandnooz 0x00000001000d8044 0x100038000 + 655428
2 libdispatch.dylib 0x000000018e618010 _dispatch_call_block_and_release + 20
3 libdispatch.dylib 0x000000018e617fd0 _dispatch_client_callout + 12
4 libdispatch.dylib 0x000000018e61f2b4 _dispatch_root_queue_drain + 552
5 libdispatch.dylib 0x000000018e61f4f8 _dispatch_worker_thread2 + 72
6 libsystem_pthread.dylib 0x000000018e7ad6b8 _pthread_wqthread + 352
7 libsystem_pthread.dylib 0x000000018e7ad548 start_wqthread + 0
Thread 7 name: Dispatch queue: com.apple.root.high-priority
Thread 7:
0 libsystem_kernel.dylib 0x000000018e72e394 __psynch_cvwait + 8
1 Foundation 0x00000001821cf8e0 -[__NSOperationInternal _waitUntilFinished:] + 100
2 brandnooz 0x0000000100083928 0x100038000 + 309544
3 brandnooz 0x00000001000cf3c0 0x100038000 + 619456
4 libdispatch.dylib 0x000000018e618010 _dispatch_call_block_and_release + 20
5 libdispatch.dylib 0x000000018e617fd0 _dispatch_client_callout + 12
6 libdispatch.dylib 0x000000018e61f2b4 _dispatch_root_queue_drain + 552
7 libdispatch.dylib 0x000000018e61f4f8 _dispatch_worker_thread2 + 72
8 libsystem_pthread.dylib 0x000000018e7ad6b8 _pthread_wqthread + 352
9 libsystem_pthread.dylib 0x000000018e7ad548 start_wqthread + 0
Thread 8 name: Dispatch queue: com.apple.root.default-priority
Thread 8:
0 libsystem_kernel.dylib 0x000000018e715cdc semaphore_wait_trap + 8
1 brandnooz 0x00000001000d8044 0x100038000 + 655428
2 libdispatch.dylib 0x000000018e618010 _dispatch_call_block_and_release + 20
3 libdispatch.dylib 0x000000018e617fd0 _dispatch_client_callout + 12
4 libdispatch.dylib 0x000000018e61f2b4 _dispatch_root_queue_drain + 552
5 libdispatch.dylib 0x000000018e61f4f8 _dispatch_worker_thread2 + 72
6 libsystem_pthread.dylib 0x000000018e7ad6b8 _pthread_wqthread + 352
7 libsystem_pthread.dylib 0x000000018e7ad548 start_wqthread + 0
Thread 9 name: Dispatch queue: com.apple.network.helper_queue
Thread 9:
0 libsystem_kernel.dylib 0x000000018e715ca0 mach_msg_trap + 8
1 libdispatch.dylib 0x000000018e621648 _dispatch_mach_msg_send + 364
2 libdispatch.dylib 0x000000018e61a6d4 dispatch_mach_send + 216
3 libxpc.dylib 0x000000018e7c9814 xpc_connection_send_message_with_reply + 124
4 libsystem_network.dylib 0x000000018e77cfe0 __net_helper_send_block_invoke + 48
5 libdispatch.dylib 0x000000018e617fd0 _dispatch_client_callout + 12
6 libdispatch.dylib 0x000000018e61dc80 _dispatch_barrier_sync_f_invoke + 44
7 libsystem_network.dylib 0x000000018e77ab84 net_helper_send + 212
8 libsystem_network.dylib 0x000000018e77bd4c net_helper_connection_start + 264
9 libsystem_network.dylib 0x000000018e778b78 tcp_connection_register_reachability + 164
10 libsystem_network.dylib 0x000000018e77775c __tcp_connection_start_block_invoke + 312
11 libdispatch.dylib 0x000000018e618010 _dispatch_call_block_and_release + 20
12 libdispatch.dylib 0x000000018e617fd0 _dispatch_client_callout + 12
13 libdispatch.dylib 0x000000018e61e4a4 _dispatch_queue_drain + 636
14 libdispatch.dylib 0x000000018e61a4bc _dispatch_queue_invoke + 64
15 libdispatch.dylib 0x000000018e61f0f0 _dispatch_root_queue_drain + 100
16 libdispatch.dylib 0x000000018e61f4f8 _dispatch_worker_thread2 + 72
17 libsystem_pthread.dylib 0x000000018e7ad6b8 _pthread_wqthread + 352
18 libsystem_pthread.dylib 0x000000018e7ad548 start_wqthread + 0
Thread 10:
0 libsystem_kernel.dylib 0x000000018e72ee74 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x000000018e7ad548 start_wqthread + 0
Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x0000000000000008 x1: 0x0000000184d29a89 x2: 0x0000000000000000 x3: 0x0000000000000000
x4: 0x0000000000000000 x5: 0x0000000000000000 x6: 0x0000000000000000 x7: 0x0000000000000000
x8: 0x000000018f24b4b8 x9: 0x0000000100183460 x10: 0x0000000150882c00 x11: 0x000000520000007f
x12: 0x0000000150883390 x13: 0x000001a500183465 x14: 0x0000000000000006 x15: 0x0000000000000000
x16: 0x000000018e0501c0 x17: 0x00000001846484ec x18: 0x0000000000000000 x19: 0x0000000170053500
x20: 0x000000018f287000 x21: 0x000000016fdc6b28 x22: 0x000000016fdc6b20 x23: 0x000000017012d3e0
x24: 0x000000017012d3f0 x25: 0x000000019157a098 x26: 0x000000016fdc6b20 x27: 0x000000016fdc6d00
x28: 0x0000000000000003 fp: 0x000000016fdc6af0 lr: 0x000000018493e944
sp: 0x000000016fdc6ae0 pc: 0x000000018e0501c8 cpsr: 0x20000000
请帮我解决这个问题。在此先感谢
答案 0 :(得分:3)
您在objc_msgSend
内崩溃,但EXC_BAD_ACCESS
例外。根据我的经验,这可能意味着一个对象已经超出了范围并且您正在尝试访问它,或者该对象应该在另一个线程上执行某些操作并且同时(当它正在执行此操作时) ),它超出了原始线程的范围。
如果你正在使用Apple的多线程对象之一(几乎任何带有委托回调的东西),请确保它被包含在其中的对象保留(strong
- ly) 。例如,如果您正在使用具有异步回调的对象,则无法在方法中对其进行实例化,然后让它消失,您必须将其设为strong @property
以使其保持在范围内当方法返回并且您正在等待回调时。
编辑(基于CFSocket线程):
从表面上看,您使用的是通常与NSStream
类一起使用的套接字API。请记住为那些@properties
对象(或您正在使用的其他连接对象)创建强大的NSStream
,如果您要将它们包装到另一个对象中,请确保 it 是使用它的任何对象的strong @property
。您无法从创建它的线程中的对象获得异步回调。
(请注意,这不仅仅是一个已设置为nil
的对象的消息传递。到nil
的消息不会崩溃,他们只返回nil
。问题是消息被发送到你不再拥有的内存中。)
编辑2(基于主线程):
您确定拥有View Controller转换中使用的每个对象吗?在块或异步操作中创建临时对象也可能导致EXC_BAD_ACCESS
。
答案 1 :(得分:0)
从它看起来,可能是两个线程正在访问相同的变量,其中一个线程正在破坏另一个中使用的变量。这是一个同步问题。访问不当主要意味着您正在访问一个nil
的变量您可以在应用程序中集成www.crashlytics.com
等崩溃报告工具。它非常易于实现,下载sdk后即可获得文档。
实施后,彻底测试您的应用程序,它会告诉您代码崩溃的确切行,您可以解决它。