tags:

views:

1685

answers:

5

Sometimes my iPhone application crashes with a weird crashlog, that reads exception code is 0x8badf00d. The stacktraces show random snapshots of app execution, but nothing suspicious. This happens very rarely and I'm not able to find out how to reproduce it. Does anybody know more about this kind of exception and exception code?

Here is an excerpt from my crashlogs:

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

Application Specific Information:
Failed to deactivate

Thread 0:
...
< nothing suspicious here >
...

Unknown thread crashed with unknown flavor: 5, state_count: 1

+5  A: 

ate bad food ??

Aaron Hoffman
+2  A: 

It's a failure code added by a dev with a good sense of humor. Because hexadecimal uses letters as well as numbers, it's possible to come up with hex numbers that look approximately like english words, such as "0xdeadbeef", etc. I'm sure that the exception has a specific meaning, but if there's no major symptoms associated with it, you can probably ignore it without too much concern.

McWafflestix
+1  A: 

It's some programmer's idea of a joke. You have to pick a number for your code, but the number doesn't necessarily mean anything in itself. 8badf00d is just another way to write the number 2,343,432,205, and was chosen because it looks 'funny' when represented in hex for an exception log.

Joel Coehoorn
I'd contend that it doesn't just "look" funny, but that it IS funny! </subjectivity> :-)
McWafflestix
+7  A: 

It is HexSpeak, see here: http://en.wikipedia.org/wiki/Hexspeak

SQLMenace
and may imply invalid parameters passed
Mark
+24  A: 

0x8badf00d is the error code that the watchdog raises when an application takes too long to launch or terminate. See Apple's Crash Reporting for iPhone OS Applications document

rpetrich
Finally an answer to the question, thank you! I'll need to investigate more to confirm this is the actual reason for my crashlogs, but since you provide a link to an official source, I'll accept it.
Vladimir Grigorov
Usually it means you either have an infinite loop somewhere, or you are waiting for network IO on the main thread. There's also the possibility that the user is force-quitting the application.
rpetrich