A Bug Is Not Always Where It Seems To Be
Subscribe To Our Feed | Follow Us On Twitter | Get Updates on Email
Many people would agree with me when I say that the hardest part of fixing a bug is to find where it is originating from. It has happened to me quite a number of times that a certain module exhibits a particularly wild behaviour making me go mad on its developer but as I dug deeper, the cuplrit turned out to be someone who had not even heard of that module.
Today I bring to you such an example of a nice bug, which I’ll term as (like many others):
OpenOffice.org Cannot Print On Tuesdays Bug
OpenOffice.org (also known as OOo or just Open Office) is a free and widely used MS Office alternative and a lot of its users reported in recently that it would just stop printing on every tuesday. Come Wednesday, everything would be just fine and dandy, but for just less than a week till Tuesday showed its face again. Now, before I continue to unravel the mystery behind this unique bug, let me outrightly clear it out to my Indian friends that OOo is not devotee of Lord Hanuman, deciding to go on a fast on Tuedays to offer its obesceinces.
Well, after days of discussions, and people blaming everything from OOo to cups (the printer daemon), printer drivers, or the printer itself, one enterprising soul decided to investigate and found out that if he changed the “CreationDate” tag in the generated postscript file to replace the “Tue” of Tuesday with something else, the file happily printed.
His doubt about this being a cups issue strengthened when he noticed that this only occurs with OOo because other tools like evince omit this particular tag and hence escape cups’ wrath. On looking further he found out that somehow the Tuesday file is not being identified as a valid postscript file by cups but as something else. But the culprit is not cups, the cups script was actually using another utility “file” to do this identification and whenever T occurs at the file’s fourth byte, it is being identified as an “Erlang Jam” file isntead of a postscript file. This bug is listed here. Now, he couldn’t solve the issue with the file utility, but the correct identification of the bug’s origin allowed him to make a quick workaround to solve his issue. He just made a small modification to the cups script and changed:
cat > $INPUT_TEMP
to
cat | sed -e 's/^%%CreationDate: (Tue/%%CreationDate: (tue/' > $INPUT_TEMP
This change changed the “Tue” to “tue” whenever it was found int he creation date hence circumventing the issue.
Let this be an example for you to remember always “A bug is not always where it seems to be” and that even the weirdest bugs are possible. If you are still in doubt, read this: The Case of the 500 Mile E-Mail
© Safer Code | A Bug Is Not Always Where It Seems To Be
|
Liked this post? Get FREE Updates Subscribe to RSS feed |
Related posts
Tags: 500 mile email, bugs, debugging, OOo, Open Office Bug, Open Office tuesday print bug, OpenOffice.org





