我在 iPhone 应用程序中收到错误 0x8badf00d,这不是通常的嫌疑人 [英] I get error 0x8badf00d in iPhone app, and is not the usual suspect

查看:13
本文介绍了我在 iPhone 应用程序中收到错误 0x8badf00d,这不是通常的嫌疑人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用在启动时随机崩溃.

I have a random crash in my app in launching.

我很确定不是启动时间(如 什么是 8badf00d 中所述?) 因为应用启动速度很快.

I'm pretty sure is not the launching time (as explained in What does 8badf00d mean?) because the app launch fast.

最糟糕的是崩溃日志无法模拟(我无法获得源代码行号).这是错误:

The worst is that the crash log can't be simbolicate (I can't get the sourcecode line numbers). This is the error:

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

Application Specific Information:
Failed to launch
Thread 0:
0   JhonSell                        0x000c63d6 0x1000 + 807894
1   JhonSell                        0x000c7ffe 0x1000 + 815102
2   JhonSell                        0x000c9646 0x1000 + 820806
3   JhonSell                        0x000ca50a 0x1000 + 824586
4   JhonSell                        0x000b3b72 0x1000 + 732018
5   JhonSell                        0x000b3e1e 0x1000 + 732702
6   JhonSell                        0x000b3fd4 0x1000 + 733140
7   JhonSell                        0x0000a312 0x1000 + 37650
8   JhonSell                        0x0000aa7c 0x1000 + 39548
9   JhonSell                        0x00006e7c 0x1000 + 24188
10  JhonSell                        0x0000fede 0x1000 + 61150
11  JhonSell                        0x00004080 0x1000 + 12416
12  UIKit                           0x30a4ef24 -[UIApplication performInitializationWithURL:asPanel:] + 160
13  UIKit                           0x30a57dec -[UIApplication _runWithURL:] + 644
14  Foundation                      0x306945a2 __NSFireDelayedPerform + 326
15  CoreFoundation                  0x30269d88 CFRunLoopRunSpecific + 2642
16  CoreFoundation                  0x30269320 CFRunLoopRunInMode + 44
17  GraphicsServices                0x31567e58 GSEventRunModal + 268
18  UIKit                           0x30a4fa6c -[UIApplication _run] + 520
19  UIKit                           0x30a591d0 UIApplicationMain + 1132
20  JhonSell                        0x00002290 0x1000 + 4752
21  JhonSell                        0x0000202c 0x1000 + 4140

我无法调试它(我尝试附加但应用程序被看门狗杀死,我想).

I can't debug it (I try to attach but the app get killed by the watchdog, I think).

推荐答案

在你的 UIApplicationDelegate 实现中有三个方法必须在 5-6 秒内完成,否则 iPhone 会杀死你的应用程序(这不适用于当你附有调试器并在模拟器上).我不确定是否在任何地方记录了确切的时间间隔,但这就是我通过实验确定的.启动时有两个,applicationDidFinishLaunching: 和 application:didFinishLaunchingWithOptions,关闭时有一个 applicationWillTerminate.

There are three methods in your UIApplicationDelegate implementation that have to finish within 5-6 seconds or the iPhone will kill your application (this does not apply to when you are attached with a debugger and on the simulator). I'm not sure if the exact time interval is documented anywhere, but that's what I determined experimentally. There are two on startup, applicationDidFinishLaunching: and application:didFinishLaunchingWithOptions, and one on shutdown, applicationWillTerminate.

您需要检查这些方法中的任何网络访问或耗时操作是否异步执行,以便该方法可以快速返回.

You'll want to check out that any network access or time-consuming operations in those methods are performed asynchronously, so that the method can return quickly.

这是我所知道的唯一会导致启动时看门狗崩溃的事情.

That's the only thing I know of that would cause watchdog crashes on startup.

关于堆栈跟踪的更多提示,如果您使用的是 OS 3.0 和 3.0 SDK,Organizer 应该在此之前执行此操作.只需确保将来自-exact-build 的dSYM 文件保存在硬盘上,以便在某处突出显示.然后当你在 XCode 中查看 Organizer 下的 @trace 时,它​​应该会自动为你添加符号.

As for more hints on the stack trace, if you are using OS 3.0 and the 3.0 SDK, Organizer should do this before. Just make sure you're keeping the dSYM files from the -exact- build available on the hard drive to spotlight somewhere. Then when you look @ the trace under the Organizer in XCode, it should add symbols automatically for you.

这篇关于我在 iPhone 应用程序中收到错误 0x8badf00d,这不是通常的嫌疑人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆