29

Inspired by some comments on the question "The history of the NULL pointer":-

There was a practice in the '70s to use the hexadecimal code 0xDEADBEEF to indicate an invalid value. This could be to fill memory that was freed after a previous allocation, as the value of NULL in C, or as an inaccessible address.

The use of DEADBEEF is said to have originated on IBM midrange machines, as an easily identifiable error code when looking at a hex dump. My experience of it is on VMS on DEC Vax machines, it allegedly was used on Apple Macs and the Commodore Amiga. However, I haven't encountered it in use for several years.

Quick searching throws up differing and contradictory stories as to its spread and usage, so...

Did IBM system engineers change jobs and take DEADBEEF with them as a code in other systems?

14
  • 10
    It’s used quite a bit in the Linux kernel: git grep -i deadbeef | wc -l prints 404. According to Wikipedia it’s also used to mark freed memory in Solaris. Feb 6, 2018 at 13:12
  • 3
    I realy can't add hard facts here, just hearsay - and an experiance that all machines I fould it where big endian types. Personally I'd put its usage more into the region of the 80s desprite being developed in the 70s, as it is based on the existence 32 bit pointers.
    – Raffzahn
    Feb 6, 2018 at 13:20
  • 2
    BTW: Love the question, even though I have no answer.
    – Raffzahn
    Feb 6, 2018 at 13:21
  • 9
    Note than an Ox is also of species of bovine cattle.
    – Stavr00
    Feb 6, 2018 at 14:45
  • 2
    FWIW, the Dalvik VM on Android dereferenced 0xdeadd00d and 0xdeadbaad to cause specific crash signatures when internal problems were detected. That was a play on 0xdeadbeef. (This causes a segmentation fault on 32-bit Android because 0xdead**** is an address in Linux kernel space that user-space code can't write to.)
    – fadden
    Feb 6, 2018 at 16:27

2 Answers 2

20

It can be found in implementations of zfs such as OpenZFS, inherited from the Solaris Kernel Memory C header file:

https://github.com/openzfs/openzfs/blob/master/usr/src/uts/common/sys/kmem_impl.h line 80

#define KMEM_FREE_PATTERN       0xdeadbeefdeadbeefULL

Quote from the magic number wiki page:

"Dead beef", Famously used on IBM systems such as the RS/6000, also used in the classic Mac OS operating systems, OPENSTEP Enterprise, and the Commodore Amiga. On Sun Microsystems' Solaris, marks freed kernel memory (KMEM_FREE_PATTERN)

11

In a similar vein, Algol-68R on ICL 1900 (a 24-bit machine) initialized memory to -6815700, which when displayed as text (four 6-bit characters), spelled 'F00L', as well as possessing numerous other virtues.

https://en.wikipedia.org/wiki/ALGOL_68-R#F00L

3
  • I remember that - mainly used to show that the memory was uninitialized. Always got lots of F00Ls when the program crashed.
    – cup
    Feb 9, 2020 at 10:56
  • That is a FourCC code. Although the term was probably not coined back then.
    – PaulHK
    Feb 10, 2020 at 6:26
  • Myrias, a parallel processor company I worked for in the 80's, used 0x4E4F4E4F for uninitialized memory. Looking out for NONO's in data was a common activity :-) May 21 at 18:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .