3 ms·
I had my own misadventure with uninitialized memory in the late 1970s when I was working at Tymshare. I was maintaining the assembler and linker for one of our
by Stratoscope 5y ago
I had my own misadventure with uninitialized memory in the late 1970s when I was working at Tymshare. I was maintaining the assembler and linker for one of our machines (I think it was the PDP-10 but could have been the Sigma 7).
The linker had a bad habit of leaving unused memory uninitialized. Every time you linked a program, the binary would be different. Functionally the same, but they wouldn't compare byte for byte. So my manager asked me to make sure the linker zeroed out all unused memory.
After linking a program, the linker printed a message something like this:
8412 bytes used
439 bytes free
The linker was a mess of spaghetti assembly code, and it was a real pain to find and fix all of the places where it failed to clear memory.
My manager knew what a hassle this task was, and he was fairly chill, so just for fun I added a temporary message meant for his eyes only:
8412 bytes used
439 bytes free and it's pretty fucking clean
I figured he would get a laugh out of this and then I'd remove it.
Unfortunately he wasn't the first to see the message. His manager was giving a demo to a customer and they saw the message. Oops.
Later we wanted to add a "weak external" feature to the assembler and linker, something like the "weak reference" that a few modern languages have. If the external was missing, then instead of failing the link step, it would leave a zero that you would check at runtime.
The regular external directive was called EXTERN, and the tradition was for these names to be very short. I thought of calling it WEXTERN but then decided to call the feature a "secondary external", so the directive was SEXTERN!