4 ms·
Many years back, I was working on a web application that, among other things, could generate PDF user reports. These reports were generated from HTML web pages
by romanhn 10y ago
Many years back, I was working on a web application that, among other things, could generate PDF user reports. These reports were generated from HTML web pages using a third-party library. Normally this worked well (as well as such a tool could be expected to work anyways), however once a month or so the fonts on the reports would come out super tiny. This would then happen in random reports until we rebooted all of the app servers. The bug occurred in production only, never in our dev, staging or QA environments.
Many hours of investigations were committed, many emails to the vendor were written, much hair was torn out. No luck whatsoever. Months passed, and the bug reoccurred at random intervals and did not consistently affect all reports. One day I logged in remotely to one of the Windows app boxes as an admin/console user and was annoyed to once again discover that it forced my screen resolution to change. That's when I had an epiphany and 10 minutes later was able to reproduce the bug in my local environment.
Turns out the third-party library had some funky rasterization logic that took into account both the resolution of the machine when the library/service was started as well as the current resolution, pretty much expecting both to be the same. Logging in remotely as a console user has the behavior of taking on the resolution of my local machine, which was always higher than what the remote box ran at. Another thing to note is that the console user logged into the same running instance of Windows that was generating the PDFs. BAM! The cached value used by the library no longer matched the runtime resolution and the reports now generated screwy tiny fonts. This happened rarely because logging in as admin/console was not the recommended approach, and it was inconsistent because we had multiple app boxes and the other ones continued to work OK.
Solution - disallow admin/console remote logins. This was one of the most obscure bugs I have had the pleasure of solving.