iOS应用程序:常见主题为:SIGSEGV和_sigtramp的几次崩溃

作为obj-c的新手,我不是阅读堆栈跟踪的主人,但我通常可以找出代码中的哪个地方开始寻找。 然而,在testing过程中,其中一个testing人员会一直报告几个随机崩溃。 而且由于他们没有指向我自己的代码,所以我无法制作堆栈跟踪的头或尾。 这里有两个:

0 WIT Free 0x000a5a92 _mh_execute_header + 338578 1 WIT Free 0x000a677c _mh_execute_header + 341884 2 libsystem_c.dylib 0x355cc7ec _sigtramp + 48 3 WIT Free 0x000fcd02 _mh_execute_header + 695554 4 WIT Free 0x000fd502 _mh_execute_header + 697602 5 WIT Free 0x000fd0a0 _mh_execute_header + 696480 6 WIT Free 0x000fea9c _mh_execute_header + 703132 7 WIT Free 0x000ffa3a _mh_execute_header + 707130 8 Foundation 0x31e1bc28 __65-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]_block_invoke_0 + 16 9 Foundation 0x31d736d8 -[NSURLConnectionInternalConnection invokeForDelegate:] + 28 10 Foundation 0x31d736a2 -[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:] + 198 11 Foundation 0x31d735c4 -[NSURLConnectionInternal _withActiveConnectionAndDelegate:] + 60 12 CFNetwork 0x34c6c7f4 _ZN19URLConnectionClient23_clientDidFinishLoadingEPNS_26ClientConnectionEventQueueE + 192 13 CFNetwork 0x34c614a4 _ZN19URLConnectionClient26ClientConnectionEventQueue33processAllEventsAndConsumePayloadEP20XConnectionEventInfoI12XClientEvent18XClientEventParamsEl + 424 14 CFNetwork 0x34c61598 _ZN19URLConnectionClient26ClientConnectionEventQueue33processAllEventsAndConsumePayloadEP20XConnectionEventInfoI12XClientEvent18XClientEventParamsEl + 668 15 CFNetwork 0x34c611a2 _ZN19URLConnectionClient13processEventsEv + 106 16 CFNetwork 0x34c610d8 _ZN17MultiplexerSource7performEv + 156 17 CoreFoundation 0x314b1ad2 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14 18 CoreFoundation 0x314b129e __CFRunLoopDoSources0 + 214 19 CoreFoundation 0x314b0044 __CFRunLoopRun + 652 20 CoreFoundation 0x314334a4 CFRunLoopRunSpecific + 300 21 CoreFoundation 0x3143336c CFRunLoopRunInMode + 104 22 GraphicsServices 0x334ad438 GSEventRunModal + 136 23 UIKit 0x30b96cd4 UIApplicationMain + 1080 24 WIT Free 0x000558b0 _mh_execute_header + 10416 25 WIT Free 0x00055857 _mh_execute_header + 10327 

和:

 0 WIT Free 0x00067a92 _mh_execute_header + 338578 1 WIT Free 0x0006877c _mh_execute_header + 341884 2 libsystem_c.dylib 0x355cc7ec _sigtramp + 48 3 WIT Free 0x000bfc82 _mh_execute_header + 699522 4 WIT Free 0x000cc34e _mh_execute_header + 750414 5 WIT Free 0x000cd5a0 _mh_execute_header + 755104 6 libdispatch.dylib 0x35cf5c58 _dispatch_call_block_and_release + 12 7 libdispatch.dylib 0x35d00e90 _dispatch_main_queue_callback_4CF$VARIANT$up + 196 8 CoreFoundation 0x314b02ac __CFRunLoopRun + 1268 9 CoreFoundation 0x314334a4 CFRunLoopRunSpecific + 300 10 CoreFoundation 0x3143336c CFRunLoopRunInMode + 104 11 GraphicsServices 0x334ad438 GSEventRunModal + 136 12 UIKit 0x30b96cd4 UIApplicationMain + 1080 13 WIT Free 0x000178b0 _mh_execute_header + 10416 14 WIT Free 0x00017857 _mh_execute_header + 10327 

有人可以破译这个,并用简单的英语解释我所看到的吗? 一些指向为什么这些崩溃可能会发生也将是非常有益的!

编辑:更多信息

  • 显然,崩溃几乎总是发生在相当薄弱的networking连接上。
  • 我与委托使用asynchronousNSURLConnections
  • 我将尝试使用PLCrashReporter获取所有线程的堆栈跟踪
  • 我正在使用ARC
  • 跟踪的前三行对于每一次崩溃都是通用的(除了hex数字 – 内存位置?):

 0 WIT Free 0x000a5a92 _mh_execute_header + 338578 1 WIT Free 0x000a677c _mh_execute_header + 341884 2 libsystem_c.dylib 0x355cc7ec _sigtramp + 48 

谢谢

发生什么事是被调用的对象(NSURLConnection)试图调用你为它设置的委托,但委托是在一个已经被丢弃的对象,因此存储器访问冲突。

我的猜测是,你有一个地方有一个NSURLConnections对象与委托设置,但你没有正确closuresNSURLConnection

请参阅https://stackoverflow.com/a/11232292/451482