Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
491 views
in Technique[技术] by (71.8m points)

objective c - I get error 0x8badf00d in iPhone app, and is not the usual suspect

I have a random crash in my app in launching.

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).

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...