139 points · by diggan · 2y ago · 117 comments
Even more interesting is the Wikipedia page https://en.wikipedia.org/wiki/Hexspeak catalogs a delightfully long list of hexspeak words and what they're used for.
http://www.canonical.org/~kragen/sw/urscheme/compiler.scm.ht...
> ("cafe babe") is used by Plan 9's libc as a poison value for memory pools.
Both the NeXT computer and Plan 9 were developed in the mid 80s, so I wonder who used it first? But I don't think that one influenced the other?
There are quite a few memorable words you can spell using 32 or 64 bits—like BA5EBA11. This is the story of me -not- choosing one of those.
These bit-pattern words are handy because they’re easy to recognize, especially in a random memory dump.
On my first “real” assignment, I was writing real-time embedded C code for a 16-bit processor that communicated with a host microprocessor on a server. We needed to run periodic assurance tests across a bus to ensure reliable communication with the host since we weren't constantly using the bus.*
We were given an unused register address on the host processor and told to write whatever we wanted to it. The idea was to periodically write a value, read it back, and if we encountered any write errors, incorrect reads, or failures, we’d declare a comm error and degrade the system in a controlled manner.
Instead of using zeros or something like 0xDEADBEEF, I decided to write 0x4D494B45 - "MIKE" in ASCII. It was unique, unlikely to be tampered with, it worked, and no one argued with me. The code shipped, the product shipped, and all was well. We even detected legitimate hardware errors, which I thought was pretty cool.
Fast forward two generations of systems, and long after I’d moved on from that team, the code had been ported around but that assurance test remained unchanged. Everything was fine until they brought up a new generation of systems, flipped on the firmware for that device, and 10 seconds later, my assurance test clobbered an important register. The entire system promptly checkstopped and crashed. It took the team days to figure out what was wrong, and I had to explain myself when they found "MIKE" staring back at them from the memory dump.
That was a fun project. ;-)
* Note: It would've been bad if our device went out to lunch because we were responsible for energy management of the server. If the power budget was exceeded and we couldn't downclock and downvolt the processor, something might have crashed or been damaged.
edit: yes, 0xCAFEBABE is a warning but 0xFEEDFACE is not:
3405691582
https://github.com/rust-lang/rust/blob/d0ea1d767925d53b2230e...
Maybe someone was having too much fun and got carried away, but what an odd sense of humor.
Maybe they just didn't want the checker to flag itself.
I remember there was a similar check inside Google, where any file containing the words "DO NOT SUBMIT" will cause the presubmit check to fail. Naturally the presubmit checker needs to look for that string, but it couldn't trivially include the string as-is because that would prevent the presubmit checker from being submitted.
(Motivation for something like this is that if you inserted some extra logging statements or similar for debugging, you would add "DO NOT SUBMIT" in nearby comments, so that you will remember to remove them later).
It’s religion for the irreligious.
(practically, used only "F0015601D" ... as IPv6 link-local address. No, wasn't a honeypot service)
irb> [184594741, 2880289470, 2881141438, 2965027518, 2976579765, 3203381950, 3405691582, 3405697037, 3735927486, 4027431614, 4276992702].map! { _1.to_s(16) }
=> ["b00b135", "abadbabe", "abbababe", "b0bababe", "b16b00b5", "beefbabe", "cafebabe", "cafed00d", "deadbabe", "f00dbabe", "feedbabe"]
if they instead say 'leslie over in sales is a dood' they're just being explicit about his gender, perhaps because someone thought he was female
i'm not endorsing any value judgments for or against these statements, just explaining what other people's thinking (factually) is which leads to the kind of value judgments that lead to policies against putting b00b135 in your source code
i suspect cafed00d was included as a (possibly counterproductive) gesture to allay equity concerns like yours rather than because of any serious concern that a cafed00d constant would cause anyone any concern on its own
(As per the Apollo guidance computer)
Anyway I think they forgot a few, like 173406926 (// Intentionally written in decimal rather than hex). Seems like they just checked https://en.wikipedia.org/wiki/Hexspeak. Kind of a weak effort, overall.
probably some people will think it's encouraging information, and others will think it's discouraging information, but either way it's important information
we must secure the existence of C code and a future for node children
> but sometimes considered offensive if used by a man to a woman he does not know
There are billions of other magic numbers to choose from anyway.
At some point within the past 10 years they started inserting these annoying little sjw asides into the dictionaries
I was reading them out in hex. As in CA FE BA BE …
Now I feel stupid.
If everyone starts to use the same magic numbers then they are no longer magic and you can end up with strange corner case bugs and holes where a magic number used in one context is mistaken for a magic number in another context.
I think this would more belong into clippy; it'd be easier extensible then, and less "magic". But I'm just a 0xf001 who's intentions are 0x900d ... please don't let me 0xbe misunderst0x0d.
// This is a shout out to that 80s hit. You know the one.
#define E_JENNY_JENNY_WHO_CAN_I_TURN_TO 0x88675309
The 1 in bit 31 was required to signify that it's a Win32 error code. The other high bits are essentially a namespace, which we used correctly for all our other error codes.
Wherever my Motorola MPx200 went, it says "Hello."
DATED?!
BLASPHEMY!
;-)
(Do a google search on the number, without the 0x0 prefix...)