“My wife complains that open office will never print on Tuesdays”
A bizarre sentence; which kicked off one of the most interesting bug hunts in Ubuntu’s history.
It all starts with some goofy pattern matching.
It’s not a bug with the printer, or OpenOffice, or the printer driver.
It’s a mistake in the way the “file” utility parses file signatures.
When printing from OpenOffice, a PostScript file is created with the creation date.
CUPS, the Common Unix Printing System, then uses the file utility as part of its pipeline to determine the type.
But if "Tue" appears at byte 4 (Tuesday's creation date), it's mistakenly identified as an Erlang JAM file, causing the print job to fail.
Essentially, the logic in the file utility for recognizing Erlang JAM files were too broad.
Looking for a single static string position is an extremely fragile detection method.
Simply changing the creation date to “XTue” completely solves the problem!
After some back and forth, the logic in the file utility was improved, and the bug was fixed.
It’s a good lesson for us programmers to not blindly dismiss “implausible” sounding issues.
Next time someone makes an outlandish claim; take a closer look. You might just be onto a bizarre edge case!
Here’s the original bug report:
bugs.launchpad.net/ubuntu/+source…
Share this Scrolly Tale with your friends.
A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.
