objective-c - iOS应用程序: Several crashes with common themes of: SIGSEGV and _sigtramp

标签 objective-c ios cocoa-touch

作为 obj-c 的新手,我不擅长阅读堆栈跟踪,但我通常可以找出从代码中开始查找的位置。然而,在测试过程中,其中一位测试人员不断报告多次随机崩溃。我无法确定堆栈跟踪的头或尾,因为它们不指向我自己的任何代码。这里有两个:

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

有人可以破译这个并用简单的英语解释我所看到的吗?一些关于为什么可能发生这些崩溃的提示也会非常有帮助!

编辑:更多信息

  • 显然,崩溃几乎总是发生在网络连接相当薄弱的情况下。
  • 我正在使用带有委托(delegate)的异步 NSURLConnections
  • 我将尝试使用 PLCrashReporter 获取所有线程的堆栈跟踪
  • 我正在使用 ARC
  • 跟踪的前​​三行对于每次崩溃都是通用的(除了十六进制数字 - 内存位置?):

:

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

谢谢

最佳答案

发生的情况是,被调用的对象(NSURLConnection)正在尝试调用您为其设置的委托(delegate),但该委托(delegate)位于已被丢弃的对象中,因此内存访问冲突。

我的猜测是,您已经在某处移出了具有带有委托(delegate)集的 NSURLConnections 对象的 View ,但您没有正确关闭 NSURLConnection

参见https://stackoverflow.com/a/11232292/451482

关于objective-c - iOS应用程序: Several crashes with common themes of: SIGSEGV and _sigtramp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13462505/

相关文章:

objective-c - 在 NSMutableDictionary 中是否有一种干净的方法来使用指针 (id) 作为键?

ios - 如何从 App Delegate (XCode 9) 访问 View Controller

objective-c - ASIHTTPRequest 下载大型 PDF 导致 iPad 崩溃

ios - 以编程方式调用方法名称为 -(void)animatePageX 的方法的最佳实践,其中 x =1 到 25

iphone - 当 UITableView 滚动时如何取消选择 UITableViewCell?

iphone - 访问应用程序visibleViewController?

ios - 使 UINavigationBar 在触摸时消失和出现,模仿 iOS 上的 safari

objective-c - 如何使用loadnibnamed推送viewController

ios - iOS 是否支持 SVG Tiny?

ios - AFNetworing - setImageWithURLRequest 不工作