iOS应用仅在某些随机设备上提升0x8badf00d

时间:2012-05-16 10:40:55

标签: objective-c ios memory-leaks crash crash-reports

  

可能重复:
  I get error 0x8badf00d in iPhone app, and is not the usual suspect

这是我在这里的第一篇文章,所以如果你认为我做错了什么,请告诉我; D

首先,我一直在做研究但没有成功,我无法弄清楚发生了什么。

我正在开发一款通用应用程序,它在我用来测试它的每台设备上运行良好(iPhone 3GS,iPhone 4,iPhone 4S,iPad 2和iPod Touch 4G)。但有些客户报告该应用程序在发布时关闭(同样在不同型号和iOS版本中,因此似乎没有一个共同因素。我的意思是,该应用程序不会仅在特定设备型号/ iOS版本中失败)。 / p>

他们中的一个非常善良,他给了我这个崩溃的记者。它似乎是一个常见的0x8badf00d问题(我必须以某种方式优化启动,以便尽可能快地返回didFinishLaunchingWithOptions,我知道)。重新启动设备,关闭后台/暂停的其他应用程序然后它工作。这是崩溃记者(我不知道为什么它没有像下面发布的第二个崩溃记者一样具有相同程度的象征。我在Xcode组织者上导入它并且我有必要的文件来表示):

Date/Time:       2012-05-15 00:42:19.074 +0200
OS Version:      iPhone OS 5.0.1 (9A405)
Report Version:  104

Exception Type:  00000020
Exception Codes: 0x8badf00d
Highlighted Thread:  0

Application Specific Information:
com.myApp.free failed to resume in time

Elapsed total CPU time (seconds): 2.400 (user 2.400, system 0.000), 12% CPU 
Elapsed application CPU time (seconds): 0.073, 0% CPU 

Last Exception Backtrace:
0                                   0x3293a8bf  + 848537791
1                                   0x356021e5  + 895492581
2                                   0x32883b6b  + 847788907
3   myApp                           0x0000a82d -[PhoneViewController requestFinished:] (PhoneViewController.m:1679)
4                                   0x3289922b  + 847876651
5   myApp                           0x0002a0b1 -[ASIHTTPRequest reportFinished] (ASIHTTPRequest.m:2028)
6                                   0x3289922b  + 847876651
7                                   0x31fc2757  + 838608727
8                                   0x3290eb03  + 848358147
9                                   0x3290e365  + 848356197
10                                  0x3290d075  + 848351349
11                                  0x328904dd  + 847840477
12                                  0x328903a5  + 847840165
13                                  0x335a8fcd  + 861573069
14                                  0x36953743  + 915748675
15  myApp                           0x000033af main (main.m:27)
16  myApp                           0x00003368 0x1000 + 9064


Thread 0:
0   ???                               0x3465c32c 0 + 879084332
1   ???                               0x35e77fe6 0 + 904364006
2   ???                               0x336cbf66 0 + 862764902
3   ???                               0x336c9348 0 + 862753608
4   ???                               0x356022de 0 + 895492830
5   ???                               0x336c93c0 0 + 862753728
6   ???                               0x336c944c 0 + 862753868
7   ???                               0x336ca820 0 + 862758944
8   ???                               0x35602230 0 + 895492656
9   ???                               0x32890540 0 + 847840576
10  ???                               0x328903a0 0 + 847840160
11  ???                               0x335a8fc8 0 + 861573064
12  ???                               0x3695373e 0 + 915748670
13  myApp                           0x000033aa main (main.m:27)
14  myApp                           0x00003364 0x1000 + 9060

后来,我的一位同伴带来了一台iPhone 4,其中应用程序无法正常工作,显然是因为同样的问题。崩溃记者也显示了0x8badf00d,但之前重新启动的'解决方案'不起作用。此外,这两次崩溃之间存在差异:第一次崩溃时飞溅图像显示在几秒钟内崩溃,而第二次崩溃需要更多时间(我做了几次尝试,但仍然比第一次慢)。我插入iPhone以查看Xcode控制台中发生了什么(在崩溃报告器后发布了一些行)。这是坠机记者......

Date/Time:       2012-05-15 11:57:30.227 +0200
OS Version:      iPhone OS 5.1 (9B176)
Report Version:  104

Exception Type:  00000020
Exception Codes: 0x8badf00d
Highlighted Thread:  0

Application Specific Information:
com.myApp.free failed to launch in time

Elapsed total CPU time (seconds): 12.410 (user 12.410, system 0.000), 63% CPU 
Elapsed application CPU time (seconds): 7.302, 37% CPU

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0:
0   libsystem_kernel.dylib          0x35069dcc __open + 8
1   DataDetectorsCore               0x30c8ca60 DDmmap + 8
2   DataDetectorsCore               0x30c860ea DDCacheCreateFromFileAtPathWithExtraChecks + 14
3   DataDetectorsCore               0x30c860b8 DDCacheCreateFromSystemCache + 1252
4   DataDetectorsCore               0x30c85a16 DDScannerCreateWithType + 14
5   DataDetectorsCore               0x30c85aaa DDScannerCreate + 6
6   Foundation                      0x3118cac8 -[NSDataDetector initWithTypes:error:] + 960
7   Foundation                      0x3118c6ec +[NSDataDetector dataDetectorWithTypes:error:] + 44
8   myApp                           0x00004c0c -[PhoneViewController getTelfNumbers] (PhoneViewController.m:213)
9   myApp                           0x00007062 -[PhoneViewController viewDidLoad] (PhoneViewController.m:864)
10  UIKit                           0x32479e3e -[UIViewController awakeFromNib] + 106
11  UIKit                           0x3250c2ec -[UINib instantiateWithOwner:options:] + 1236
12  UIKit                           0x3247a4ac -[UIViewController _loadViewFromNibNamed:bundle:] + 240
13  UIKit                           0x32357dfa -[UIViewController loadView] + 82
14  UIKit                           0x322cddb8 -[UIViewController view] + 44
15  UIKit                           0x3232d7de -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 86
16  UIKit                           0x3232d77c -[UITabBarController transitionFromViewController:toViewController:] + 24
17  UIKit                           0x3232d0b6 -[UITabBarController _setSelectedViewController:] + 294
18  UIKit                           0x3232cdea -[UITabBarController setSelectedIndex:] + 234
19  myApp                           0x00003f1e -[AppDelegate application:didFinishLaunchingWithOptions:] (AppDelegate.m:294)
20  UIKit                           0x322cce4c -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1176
21  UIKit                           0x322c697e -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 402
22  UIKit                           0x32294c64 -[UIApplication handleEvent:withNewEvent:] + 1004
23  UIKit                           0x32294708 -[UIApplication sendEvent:] + 48
24  UIKit                           0x322940dc _UIApplicationHandleEvent + 5820
25  GraphicsServices                0x364c9224 PurpleEventCallback + 876
26  CoreFoundation                  0x3524a51c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
27  CoreFoundation                  0x3524a4be __CFRunLoopDoSource1 + 134
28  CoreFoundation                  0x3524930c __CFRunLoopRun + 1364
29  CoreFoundation                  0x351cc49e CFRunLoopRunSpecific + 294
30  CoreFoundation                  0x351cc366 CFRunLoopRunInMode + 98
31  UIKit                           0x322c5a0c -[UIApplication _run] + 544
32  UIKit                           0x322c2e76 UIApplicationMain + 1074
33  myApp                           0x000033a8 main (main.m:27)
34  myApp                           0x00003360 0x1000 + 9056

...这里是控制台上抛出的线条:

2012-05-16 10:52:26.440 myApp[315:707] DDCache: mmap failed with error 12
2012-05-16 10:52:26.444 myApp[315:707] DataDetectorsCore: mmapping the cache file failed
2012-05-16 10:52:26.466 myApp[315:707] DDCache: mmap failed with error 12
2012-05-16 10:52:26.470 myApp[315:707] DataDetectorsCore: mmapping the cache file failed
2012-05-16 10:52:26.485 myApp[315:707] DDCache: mmap failed with error 12
2012-05-16 10:52:26.490 myApp[315:707] DataDetectorsCore: mmapping the cache file failed
2012-05-16 10:52:26.509 myApp[315:707] DDCache: mmap failed with error 12
2012-05-16 10:52:26.514 myApp[315:707] DataDetectorsCore: mmapping the cache file failed
2012-05-16 10:52:26.529 myApp[315:707] DDCache: mmap failed with error 12
2012-05-16 10:52:26.533 myApp[315:707] DataDetectorsCore: mmapping the cache file failed
2012-05-16 10:52:26.548 myApp[315:707] DDCache: mmap failed with error 12
[...]
(always the same two lines)

我不知道现在该做什么。设备的主要部分没有问题推出应用程序,另一部分设备有“吃不好的食物”,重新启动/关闭一些应用程序后消失了,还有一些(现在,客户的一个和我们的设备之一)可以即使重启/关闭应用也不会启动它。

正如我之前所说,似乎没有iOS特定设备/型号和iOS版本的情况。更奇怪的是,Apple验证了我的应用程序并且他们没有报告任何崩溃或错误。好吧,实际上他们做了,他们拒绝了我上传的第一个二进制文件,因为我没有Info.plist,所以它在调试时有效,但在最终应用程序运行时没有。这是固定的,但我告诉你,以防万一是相关的。

有什么想法吗?

提前谢谢!

PS:我不是母语为英语的人,所以如果有些奇怪的东西你不明白,请不要犹豫,我会尝试用其他的话再次解释。

1 个答案:

答案 0 :(得分:2)

差异的可能原因可能是您正在使用的数据量。

正如您已经说过的,您应该优化您的启动。你正在加载电话号码,对吗?如果这可能需要一些时间,请尝试启动并显示带有活动指示符或类似的PhoneViewController,然后启动一个线程以异步加载数据并在完成后更新视图。