Bug of the moment 2006-07-20
This is one of those annoying bugs that keeps cropping up regularly so it gets the nasty treatment. Windows 2000 Explorer leaks BROWSEUI.DLL contexts. I don’t know what they do or what they’re for, but it squirrels them up until bursting point:
Windows uptime is now 88 days:
C:\Documents and Settings\Mr Nemesis>uptime \\SPIRE has been up for: 88 day(s), 17 hour(s), 10 minute(s), 52 second(s)
So as you can imagine, I’ve now had Explorer pig itself out a few times now. The reason why it’s a problem is that each festering BROWSEUI uses up window handles for no reason, so after a while Windows literally runs out of window handles to pass around. Normally when I discover this has happened, I will be browsing images on my hard drive – using Internet Explorer as my image viewer (bite me) – and suddenly I cannot open IE windows any more. Of all the open windows, the last one to be opened will be missing things like toolbars and even its menu bar sometimes.
Unless I start closing IE windows, right-click in Windows Explorer no longer works, and Firefox starts panicking.
At this stage, the only solution is to close Explorer. I keep Process Explorer running at all times, which conveniently means so I can bring it up without needing any more window handles allocating. I’ve set Windows to run two copies of Explorer, one for the taskbar and one for folder windows, and it’s the latter one that fails. This means that I can close the offending process without losing any tray icons or upsetting the taskbar’s one-click-minimise for existing windows.
However, no-one has ever written any tool that will safely close a process. You can kill processes stone dead, sure. Microsoft wrote a kill command to ask processes to politely close but all that seems to do with graphical apps is fail to close some non-existing window, repeatedly. Even background processes often refuse to close when asked by kill, such as NTVDM, which is ridiculous since Windows can get them all to close if you log out or shutdown. I’ve asked SysInternals’ Mark Russinovich to add a feature to Process Explorer to perform a safe close on a process but he just ignored me.
As much as I hate having to do this, the only option I have left is to nuke Explorer, since safe process close is just impossible in Windows. On the Mac, it’s a trivial AppleEvent call of code ‘
quit’ directed at the program! Sheesh. Or, “
tell application "Some faceless app" to quit”.
In a related problem, a certain other program I run quite a bit leaks so much TCP/IP buffer space that nothing can open any more connections. Firefox is suddenly unable to open any Web pages (yet it gives no errors, just fails silently) and gaim starts dropping my server connections. The only program brave enough to report the cause of the problem is Windows console FTP:
This leads me to start killing connections in the offending program or if need be, nuke it altogether (it takes ages to shut down) and restore my stack buffer space so that I can actually use the Internet again.
It’s handy having a clue about these things, else I’d have rebooted long before I made it to 88 days, clearly now exceeding my previous record of about 72 days’s uptime, in Mac OS 9.1. Now, all I need to do is run Windows Millennium and see if I can get that to run for more than a week at a time :)
Posted 20th July 2006 – Comments and questions?