Friday, July 13, 2007

History of a bug

(or how a problem with our HP printer earned me so money)

The story starts some years ago, where the department bought a rather nice duplex HP4000 printer. For quite some time, I had it happily setup using the on board Postscript interpreter. Then Matlab started producing Postscript 3 graphs, and the on board interpreter didn't handle this, and there was some issue with the newer Matlab's Postscript 2 graphs exceeding the memory capacity of the printer.

Ah-ha, says I, ghostscrpt has good support for the HP printers, so I'll push everything through ghostscript and get PCL output to feed the printer. The only issue was the that the ljet4d driver did not handle Postscript's /Tumble command at all, which was inconvenient, Still, I went with the setup, and, all in all, it worked pretty well, except that, every now and then, we would run into the issue of not being able to bring with /Tumble.

Then, while digging for something, I discovered HP's list of PCL commands, and saw that, supporting /Tumble was quite simple on the PCL side. Thus informed, I spent some time digging into ghostscript's code, and created a patch (which was not very clean at that stage), which did the job. I sent the patch off to the ghosctscript ailing list, and forgot about it for a while.

Sometime later (early 2005), I upgraded the print server, and had to adapt my patch to the new version of ghostscript. In the process, I cleaned up several things, refactoring it to move the Postscipt parsing of /Tumble down into the core, and generally getting something I was much happier with. Since the post to the mailing list yielded no response, I shoved the patches in ghostscript's bugzilla (one bug for the parsing refactoring and one for the changes to the PCL drivers). Since I now had a working setup, I didn't push the issue at all.

Forward to 2007 - I again upgraded the print server, and need to port my patches. At the same time, somebody on the ghostscript side is assigned to the bugs I submitted with the previous patches, and promptly closes them as being old. After complaining that this was not a valid reason to close the bugs, I was told that the parser changes were unacceptable (a decision I disagree with, personally, but it's not my call), but that they would consider an updated fix to the laserjet drivers. There was also a not that the bug had a bounty, which I assumed would be some nomial sum, and didn't note particularly.

After some delays on my side, I eventually found an afternoon and put together yet another version of the patch, and submitted it last week. Thus, I was somewhat surprised when they contacted this week and told me that the bounty was $500. Additionally, they were quite quick about processing the payment, an, at 14:00 this afternoon, my bank contacted me to let me know that the money had arrived.

Overall, I feel quite pleased with the final result - despite the long time frame, it was never more than a couple of afternoon's work and I've had a solution in place for my problem most of the time, but, finally, next time I upgrade, I won't need to worry about this. Of course, I may also no longer have a printer to which the patch applies, but so be it.

No comments: