19

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?

  • 7
    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. – Stephen Kitt Feb 6 '18 at 13:12
  • 1
    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 '18 at 13:20
  • 1
    BTW: Love the question, even though I have no answer. – Raffzahn Feb 6 '18 at 13:21
  • 5
    Note than an Ox is also of species of bovine cattle. – Stavr00 Feb 6 '18 at 14:45
  • 1
    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 '18 at 16:27
15

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)

7

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.