Technology

The 44-Year-Old Operating System Bug

11 Nov 2018 6:00am, by

A screenshot of FreeDOS (the open source DOS clone)

This month computer enthusiast Foone Turing stumbled across what he describes as a bug that’s survived for over 44 years — one that left him with a file that was impossible to copy.

As a fan of old computers, he’d discovered some files on an old Windows NT operating system. But apparently, they’d used names that were “reserved” on his newer system. “They’re perfectly valid NTFS filenames, and I was using an NTFS drive in Linux… So today I was trying to back up this NTFS drive onto my main PC and WHOOPS CAN’T COPY ALL FILES CAUSE OF BUGS OLDER THAN MOST PEOPLE READING THIS.”

His discovery prompted some interesting discussions on social media. One user remembered that the bug had apparently re-surfaced last year in an incident with Rust’s package manager.

One commenter even helpfully pointed to a 2003 explanation by Microsoft programmer Raymond Chen, who eventually authored a book called The Old New Thing: Practical Development Throughout the Evolution of Windows. “Set the Wayback machine to DOS 1.0,” Chen wrote. (Which came out in 1981)

The Old New Thing - by Raymond Chen - book cover (via Amazon) - 518gR6NkPkL._SX376_BO1,204,203,200_Chen remembered that back then when you ran the compiler, it automatically created two more files — one with the suffix .LST and one with the suffix .OBJ. “But what if you didn’t want a listing file? The compiler demanded a filename, and if you didn’t type any filename at all, it created one with the same basename as your source file.” So you had to type something at the prompt, and providing the “magic filename” PRN apparently even hijacked this process, making the compiler write the contents of your file out to your printer. “If you wanted to discard the output entirely, you would type ‘NUL’, of course. And if you wanted it to go to the screen, you would type ‘CON'” (For “console”).

Wikipedia refers to them as “reserved device names in DOS that cannot be used as filenames regardless of extension as they are occupied by built-in character devices.” It wasn’t that big of a deal at the time, partly because DOS 1.0 didn’t have subdirectories — “there was only one directory, which today we would call the root directory.”

But when subdirectories came along, what else could they do? The magic filenames were soon added into every single subdirectory. And even 22 years later, Chen was writing that “everybody still relies on them. Just look at all the batch files that do things like redirect to >NUL or test if a directory exists by asking ‘if exist directoryname\nul’…”

But this ancient error message got a new round of publicity in November of 2018 after its re-discovery by Foone Turing. His Patreon page describes him as “a collector of all sorts of weird old computer/electronic junk.” But Foone also apparently spends a lot of time archiving old media.

And in his epic Twitter thread, Foone explained how this led him into computer history — and his first encounter with the feature described by Chen. He eventually traced how a variation had first made its way into Tim Paterson’s Quick and Dirty Operating System”, which became the forerunner to the first version of MS-DOS, via Gary Kildall’s popular 1974 operating system CP/M — albeit with a colon after the magic filenames, “as if they were a drive name.”

And then he continues tracing the kludge’s survival on down through the years.

And the behavior kept getting passed down, from operating system after operating system. “But Windows NT wanted compatibility with DOS/Windows programs,” Foone writes. “And XP merged the two lines…”

So 44 years later, “these special files still work.”

A link to his Twitter thread drew over 86 upvotes when it turned up on Reddit’s Windows 10 forum — and another 21 upvotes in Reddit’s programming forum.

Of course, there was some debate as to whether or not this was really a bug — or just a crucial way of maintaining backward compatibility.

You can read all Foone’s tweets as a single web page at this URL — and at the end of the thread, Foone even apologized for its length. “This was really just me being way too tired and rambly and being amazed at getting home to an error message caused by a decision from 44 years ago.”

“And if it wasn’t clear, my intent was never to be like ‘WINDOWS SUCKS’ with this. Backwards compatibility is, in general, a good thing. In fact, I’d like MORE backwards compatibility, not less.”

“But I was just flabbergasted at hitting a bug from 44 years ago, while running Windows 10 and copying from a USB 3.0 SSD to another SSD.”


WebReduce


A digest of the week’s most important stories & analyses.

View / Add Comments

Please stay on topic and be respectful of others. Review our Terms of Use.