tags:

views:

802

answers:

8

Hi there:

What does the word "dead beef" mean? I read it from a interview question. It has something to do with ipv6. I figured it could be a random hex number used for examples, like "The quick brown fox jumps over the lazy dog".

Is my understanding correct? Or it has more significant meaning?

Thanks!

+1  A: 

People normally use it to indicate dummy values. I think that it primarily was used before the idea of NULL pointers.

DeadMG
DEADBEEF was commonly used to mark freed memory so it would be obvious when you had a dangling pointer IIRC.
Chuck
+25  A: 

http://en.wikipedia.org/wiki/Hexspeak
http://www.urbandictionary.com/define.php?term=dead%3Abeef

"Dead beef" is very popular sentence in programming, because it is built only from letters a-f which are used in hexadecimal notation. Colons in the beginning and in the middle of sentence make this sentence (theoreticaly) valid IPv6 address.

Dustin Laine
-1 for bare links with no explanation.
Rob Kennedy
@Rob Kennedy: -1 for pointless -1
Andrey
@durilai to make sure that the answers are still there even after linked site no longer exists. Wikipedia is always changing and is/has been blocked in some countries for different reasons ([child]porn/the "wrong" truth). So it is best to make your answer stand alone and only use links for detailed answers/citation. Just my two cent.
josefx
Good point, will add some text.
Dustin Laine
+6  A: 

It is also used for debugging purposes.

Here is a handy list of some of these values:

http://en.wikipedia.org/wiki/Magic_number_%28programming%29#Magic_debug_values

Scott
+1  A: 

It's a magic number used in various places because it also happens to be readable in English, making it stand out. There's a partial list on Wikipedia.

dsolimano
+17  A: 

It's a made up expression using only the letters A-F, often used when a recognisable hexadecimal number is required. Some systems use it for various purposes such as showing memory which has been freed and should not be referenced again. In a debugger this value showing up could be a sign that you have made an error. From Wikipedia:

0xDEADBEEF ("dead beef") is used by IBM RS/6000 systems, Mac OS on 32-bit PowerPC processors and the Commodore Amiga as a magic debug value. On Sun Microsystems' Solaris, it marks freed kernel memory. On OpenVMS running on Alpha processors, DEAD_BEEF can be seen by pressing CTRL-T.

The number 0xDEADBEEF is equal to the less recognisable decimal number 3735928559 (unsigned) or -559038737 (signed).

Mark Byers
but what about 55378008 upside down? (unsigned)
mVChr
A: 

It was used as a pattern to store in memory as a series of hex bytes (0xde, 0xad, 0xbe, 0xef). You could see if memory was corrupted because of hardware failure, buffer overruns, etc.

Larry
A: 

0xDEADBEEF is normally filled in the memory arrays so that any exception when wrongly pointed or to know buffer over runs etc.,

msathia
A: 

It's used because if it winds up in a pointer, it will raise a fault. The value has several benefits. First, likely the address is out of the range of a memory address no matter what the system's endian is. Second, it will fault on systems that require boundry alignment for data access. Because either 16 bit value half is odd, It will fault if it's the pointer value when fetching 16 or 32 bit value as they need an even address pointer. Old assembler hacks like me would use it to fill memory before releasing.

BSalita