Jump to page content

Bug of the moment 2006-01-07


The following example is a classic case of backwards architecture design in computing. I asked for a print preview of a document in Windows, and WordPad froze. I was aware that the computer downstairs hosting the printer was turned off (as I was not yet ready to print), but why would that affect print preview? (Presumably it wanted to read paper settings or some such.) Eventually it woke up and the following error appeared:

Another meaningless Windows printer error message

“Install a printer”? Why would I want to do that, seeing as you’re already showing me my default printer right in front of my eyes? The useless error message aside (and it is a wonder I did not get the standard “error printing”), I don’t quite follow why the process of looking up a printer is synchronous, given the obvious risk of network timeouts and offline printers. I am looking forwards to seeing how Mac OS X deals with such conditions; I am hoping the process is something more intelligent than Windows. In fact, in this case, if I tried dragging the error dialog, the WordPad window did not draw back and I had dialog box smeared all over it.

The general problem is that the standard programming model for a graphical system is an event loop involving lots of synchronous API calls that are assumed to be instantaneous or near enough to it. But on any occasion where a delay occurs, the program hangs until a time-out occurs, which could be seconds or it could be minutes. In many cases you can’t tell what the program is up to, and if the hung windows do not redraw the screen quickly becomes a mess. (I am assuming Mac OS X will redraw them from its buffer.)

I tried to reproduce the problem I experienced now that the spooler PC is again powered down, but print preview is working correctly this time. The stranger thing is, the document re-opens not as “POS letter.rtf” but (and I don’t believe this) as “POSLET~1.RTF”. The cause of the problem was that the path to WordPad in the file association in the Registry was not enclosed in quotation marks; I imagine Windows ships like this as I have not re-associated rich-text files at any time. Got to love it, eh?

And the printer turned out to be broken anyhow ;)


Posted 7th January 2006 – Comments and questions?