iphone - 应用程序仅在设备上运行时崩溃,警告 "Application ' xxxxxxx' 异常退出,信号 11 : Segmentation fault: 11.“

标签 iphone crash

我的 iphone 应用程序在设备上运行时崩溃并显示警告...
Application 'xxxxxx' exited abnormally with signal 11: Segmentation fault: 11.
但是,当我启用断点和 Debug模式(在模拟器和设备上调试时,我启用了 nszombies 和 mallocstacklogging nocompact 变量)时,它不会在模拟器和设备上崩溃。如何调试这个问题?

附加崩溃日志

Date/Time:       2012-02-27 18:04:36.176 +0530
OS Version:      iPhone OS 5.0.1 (9A405)
Report Version:  104

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0xf6496811
Crashed Thread:  5

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0:
0   libicucore.A.dylib              0x355625a8 icu::Locale::getRoot() + 28
1   libicucore.A.dylib              0x3554846c ures_getStringByKeyWithFallback + 36
2   libicucore.A.dylib              0x355f8442 icu::NumberingSystem::createInstance(icu::Locale const&, UErrorCode&) + 110
3   libicucore.A.dylib              0x35548c52 icu::DecimalFormatSymbols::initialize(icu::Locale const&, UErrorCode&, signed char) + 130
4   libicucore.A.dylib              0x355f7452 icu::NumberFormat::makeInstance(icu::Locale const&, UNumberFormatStyle, UErrorCode&) + 162
5   libicucore.A.dylib              0x35548738 unum_open + 504
6   CoreFoundation                  0x33fa3228 0x33f5e000 + 283176
7   Foundation                      0x32f49db0 0x32f1a000 + 196016
8   Myapp                               0x00159bea +[UtilityFunctions convertStringToCurrency:] (UtilityFunctions.m:71)
9   Myapp                               0x00159f08 +[UtilityFunctions convertStringToCurrencyWithZeroFloat:] (UtilityFunctions.m:123)
10  Myapp                               0x000b8f7a -[MainScreenViewController getValueForTextFieldWithName:] (MainScreenViewController.m:768)
11  Myapp                               0x000b78f4 -[MainScreenViewController tableView:cellForRowAtIndexPath:] (MainScreenViewController.m:497)
12  UIKit                           0x371f59c4 0x37192000 + 408004
13  UIKit                           0x371f4aa2 0x37192000 + 404130
14  UIKit                           0x371f422c 0x37192000 + 401964
15  UIKit                           0x37198d44 0x37192000 + 27972
16  CoreFoundation                  0x33f76224 0x33f5e000 + 98852
17  QuartzCore                      0x32c8037a 0x32c7a000 + 25466
18  QuartzCore                      0x32c7ff92 0x32c7a000 + 24466
19  QuartzCore                      0x32c84114 0x32c7a000 + 41236
20  QuartzCore                      0x32c83e50 0x32c7a000 + 40528
21  QuartzCore                      0x32c7bd7e 0x32c7a000 + 7550
22  CoreFoundation                  0x33febb44 0x33f5e000 + 580420
23  CoreFoundation                  0x33fe9d80 0x33f5e000 + 572800
24  CoreFoundation                  0x33fea0da 0x33f5e000 + 573658
25  CoreFoundation                  0x33f6d4d6 0x33f5e000 + 62678
26  CoreFoundation                  0x33f6d39e 0x33f5e000 + 62366
27  GraphicsServices                0x323c2fc6 0x323bf000 + 16326
28  UIKit                           0x371c373c 0x37192000 + 202556
29  Myapp                               0x000b1412 main (main.m:14)
30  Myapp                               0x000b13d0 start + 32

Thread 1 name:  Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0   libsystem_kernel.dylib          0x376323b4 0x37631000 + 5044
1   libdispatch.dylib               0x36894e78 0x36888000 + 52856
2   libdispatch.dylib               0x36894b96 0x36888000 + 52118

Thread 2:
0   libsystem_kernel.dylib          0x37642cd4 0x37631000 + 72916
1   libsystem_c.dylib               0x3651630a 0x3650c000 + 41738
2   libsystem_c.dylib               0x3651609c 0x3650c000 + 41116

Thread 3:
0   libsystem_kernel.dylib          0x37642cd4 0x37631000 + 72916
1   libsystem_c.dylib               0x3651630a 0x3650c000 + 41738
2   libsystem_c.dylib               0x3651609c 0x3650c000 + 41116

Thread 4 name:  WebThread
Thread 4:
0   libsystem_kernel.dylib          0x376420d8 0x37631000 + 69848
1   libsystem_c.dylib               0x3650ec44 0x3650c000 + 11332
2   WebCore                         0x3499a36c 0x34994000 + 25452
3   WebCore                         0x3499a670 0x34994000 + 26224
4   CoreFoundation                  0x33febb44 0x33f5e000 + 580420
5   CoreFoundation                  0x33fe9d80 0x33f5e000 + 572800
6   CoreFoundation                  0x33fea19a 0x33f5e000 + 573850
7   CoreFoundation                  0x33f6d4d6 0x33f5e000 + 62678
8   CoreFoundation                  0x33f6d39e 0x33f5e000 + 62366
9   WebCore                         0x34a3c128 0x34994000 + 688424
10  libsystem_c.dylib               0x3651bc16 0x3650c000 + 64534
11  libsystem_c.dylib               0x3651bad0 0x3650c000 + 64208

Thread 5 Crashed:
0   libobjc.A.dylib                 0x32033fbc 0x32030000 + 16316
1   Myapp                               0x00158684 -[SellingCostsVC dealloc] (SellingCostsVC.m:1639)
2   libobjc.A.dylib                 0x320350be 0x32030000 + 20670
3   libobjc.A.dylib                 0x32036db0 0x32030000 + 28080
4   libobjc.A.dylib                 0x32035e06 0x32030000 + 24070
5   libobjc.A.dylib                 0x32035d22 0x32030000 + 23842
6   CoreFoundation                  0x33f67e88 0x33f5e000 + 40584
7   Foundation                      0x32f1dc58 0x32f1a000 + 15448
8   Myapp                               0x000bb6f8 -[MainScreenViewController calculateValues] (MainScreenViewController.m:1204)
9   Foundation                      0x32f2aa8a 0x32f1a000 + 68234
10  Foundation                      0x32fbe59a 0x32f1a000 + 673178
11  libsystem_c.dylib               0x3651bc16 0x3650c000 + 64534
12  libsystem_c.dylib               0x3651bad0 0x3650c000 + 64208

Thread 5 crashed with ARM Thread State:
    r0: 0x000f0000    r1: 0x3846b09c      r2: 0x00000001      r3: 0x00000000
    r4: 0xf6496809    r5: 0x02b04048      r6: 0x02b04048      r7: 0x02b0360c
    r8: 0x0d270028    r9: 0x0e11ac27     r10: 0x0d270028     r11: 0xa3a3a3a3
    ip: 0x3f576454    sp: 0x02b0359c      lr: 0x0015868b      pc: 0x32033fbc
  cpsr: 0x20000030

最佳答案

崩溃日志为您提供了有关它出错的行号;您可以使用 NSLog 进行“printf 调试”来缩小范围。这位博主解释了如何使 NSLog 在硬件上运行时有用:
http://objcolumnist.com/2009/12/19/redirecting-nslog-to-a-log-file/

编辑:实际上,使用我链接的提示,您还可以使用实际的 printf 进行 printf 调试。

关于iphone - 应用程序仅在设备上运行时崩溃,警告 "Application ' xxxxxxx' 异常退出,信号 11 : Segmentation fault: 11.“,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9465259/

相关文章:

iphone - 在iPad上创建有关用户事件的日志的最佳方法

ios - WCSession 发送消息在实际设备上不起作用,但在模拟器上起作用

iphone - 应用程序后台时奇怪的 CPU 使用问题

javascript - jQuery on click 不适用于 iPhone(触摸设备)

ruby-on-rails-3 - Ruby 调试器在 Windows 上崩溃

xcode - 如果尚未安装在 iOS 10 上的设备中,应用程序会立即崩溃

iphone - 崩溃日志 : What is "ARM Thread State"

ios - Apple Watch 应用程序无法提交无效的 Info.plist 和图标

javascript - 页面崩溃(可能是由于多维数组?)

为 UIScrollView 获取数据时 iOS 应用程序在 iPad 上崩溃