3 ms·
Back in the days of Windows 98, the HP LaserJet caused no end of headaches for me. The problem that was introduced by the compiler they used to build the print
by mikewarot 6y ago
Back in the days of Windows 98, the HP LaserJet caused no end of headaches for me. The problem that was introduced by the compiler they used to build the print driver. To compute the paper size, margins, etc., floating point operations were used... but by then the driver had allowed the libraries that emulated the floating point processor to be unloaded, to save memory. (Due to the optimizing compiler)
Any operation that involved computing the page size would crash, only if the floating point library had idled out of memory.
I ended up forcing the library to be loaded at boot on all machines, and then things were stable.
- sharken 6y agoNo wonder that one of the DevOps success stories revolves around HP printer drivers and firmware: https://itrevolution.com/the-amazing-devops-transformation-of-the-hp-laserjet-firmware-team-gary-gruver/ https://itrevolution.com/the-amazing-devops-transformation-o...
- cesarb 6y agoOne thing which I always considered a misdesign in Windows, is its tendency to run third-party code in-process. This includes COM objects, printer drivers, and many more. We had a problem similar to yours at a previous company. The software was written in a proprietary language which had its own runtime, and that runtime expected a particular value for the floating point control word. There are some third-party DLLs, including some printer drivers and Explorer extensions, which when loaded overwrite the floating point control word with their own notion of what should be the correct value (this behavior, as far as I could determine, is introduced by the compiler used to build these third-party DLLs). The unexpected value for the floating point control word would then lead to crashes, but these crashes would not happen immediately, and they would only happen if the user had done something which led to one of these third-party DLLs being loaded, like opening/saving a file (the open/save dialog in Windows loads Explorer extensions) or printing (which loads the printer driver). The solution was to, after every point in the code which opens a file chooser or prints anything, call into a small stub DLL we wrote, which had code to reset the floating point control word to what the runtime expected.
- tonyedgecombe 6y agoIt's worse than that, at one point printer drivers were run in the kernel. I remember a customer site where just opening a queue blue screened the server.
- andi999 6y agoWhat is the floating point control word?
- adrian_b 6y agoThe floating point control word is a register in the Intel 8087 FP coprocessor and in all later Intel/AMD/etc. processors that implement the 8087 instruction set. That register contains bits that control various aspects of how the floating-point instructions must behave, e.g. rounding mode, precision and exception masks (also infinity type in coprocessors older than 80387). For the later SSE/AVX instruction sets there is another register with similar control bits for the SSE/AVX instructions.
- moonbug 6y agoYeah, I've had a variant of that, wherein the printer driver turned on fpes.
- garaetjjte 6y agoRelated issue: >There have been various instances in the past (printer drivers from a manufacturer who shall not be named) that would enable floating-point exceptions and leave them enabled, meaning that some perfectly legitimate software would start crashing after calling into third-party code (such as after printing). https://randomascii.wordpress.com/2012/04/21/exceptional-floating-point/ https://randomascii.wordpress.com/2012/04/21/exceptional-flo...