34

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?

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

4 Answers 4

25

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)

16

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
  • 1
    I remember that - mainly used to show that the memory was uninitialized. Always got lots of F00Ls when the program crashed.
    – cup
    Commented Feb 9, 2020 at 10:56
  • That is a FourCC code. Although the term was probably not coined back then.
    – PaulHK
    Commented Feb 10, 2020 at 6:26
  • 3
    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 :-) Commented May 21, 2023 at 18:57
5

I've been working on IBM CICS transaction system and VSE operating system in the middle '80s and in the system dumps (I can't really remember if VSE's or CICS's) programmers put what they called "eyecatchers". The most famous one was really 0xDEADBEEF. I'm pretty sure I've seen and used it a couple of times... it helped you spot the control block in the dump page and from there you could easily position to the offset you needed to check. Remember that dumps, at those times, were pack of printed paper weighing some Kg. I tried to search for this specific eyecatcher on the net but could not find anything related... maybe some old (wiser) IBMer could remember if it was CICS or VSE!

2

HETE 2 used DEADBEEF as padding in the downlink, together with BABECAFE as packet sync.

You must log in to answer this question.

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