Windows News and info 15th Anniversary 2009-2024

Other Operating Systems => Windows 7 | Windows 9 => Topic started by: javajolt on August 05, 2009, 09:26:30 PM

Title: Critical Windows 7 bug risks derailing product launch
Post by: javajolt on August 05, 2009, 09:26:30 PM

An apparent fatal flaw in the NTFS driver stack may bring Microsoft's Windows 7 impending victory parade to a grinding halt

Oh boy! It appears that Microsoft’s glowing track record with Windows 7 is about to come to an abrupt and unceremonious end. According to various Web sources, the RTM build 7600.16385 includes a potentially fatal bug that, once triggered, could bring down the entire OS in a matter of seconds.

The bug in question – a massive memory leak involving the chkdsk.exe utility – appears when you attempt to run the program against a secondary (i.e. not the boot partition) hard disk using the “/r” (read and verify all file data) parameter. The problem affects both 32-bit and 64-bit versions of Windows 7 and is classified as a “showstopper” in that it can cause the OS to crash (Blue Screen of Death) as it runs out of physical memory.

The bug has been tested against three different Windows 7 OS configurations on two different hardware platforms: an Intel Atom-based netbook running the 32-bit version, an Intel Core 2 Duo notebook running the 64-bit version, and a VMware Workstation 6.5.2 virtual machine running the 32-bit version.

In each case, the utility executed the first three stages of the test correctly using modest amounts of memory (several hundred megabytes). Then, when it entered the fourth stage (a read test), the chkdsk.exe utility’s memory consumption started to climb rapidly until several gigabytes had been allocated to its process and the test systems in question began to run out of memory.

Note: I did not succeed in causing the systems to “blue screen” as others have reported. However, I did observe chkdsk.exe consume up to 90 percent of the available physical memory on a 2GB VMware virtual machine. After that, the utility appeared to hang while all other operations in the OS slowed to a crawl for lack of RAM.

I also verified that the problem exists with the integrated disk check utility in Windows Explorer. When you use this function, explorer.exe starts consuming RAM like it's going out of style, pushing my test system to 98 percent memory utilization in just a few seconds. Worse still, explorer.exe failed to release the RAM when I canceled the disk check, and grew even more despite the fact that the check was now deliberately aborted. My only recourse was to either reboot the system or try to manually kill and restart explorer.exe.

According to some sources, Microsoft is passing the buck on this one by claiming it’s a chipset driver issue and that users should update their PCs. However, in my own tests I’m using the very latest versions (9.1.1.1015) of the Intel INF Update Utility driver set. And this also doesn’t explain why the bug exists in VMware, which uses its own, virtualized chipset drivers.

This is clearly a Microsoft bug –- and the fact that it manifests itself via the chkdsk.exe utility makes me wonder if it isn’t something intrinsic to the Windows 7 version of the New Technology File System (NTFS) driver stack. It’s worth noting that this same command, executed under Windows Vista with Service Pack 2, consumes less than 10 megabytes of RAM, as opposed to the several gigabytes I’m observing under Windows 7.

Also worth considering: This command can be executed in a non-elevated context under the looser Windows 7 UAC implementation (Vista requires elevation of this command via the normal user consent dialog before continuing). So not only is this a potentially catastrophic bug from a functional standpoint, it also opens up a new attack vector for malicious code. Hackers may be able to use this unprotected command to destabilize a system (by consuming almost all available RAM), and in extreme cases, cause it to fail altogether.

The bottom line: A file system-level bug, at this late stage in the development cycle, should be considered a showstopper by most IT organizations. Worse still, user comments suggest that Windows Server 2008 R2 suffers from the same flaw. So while the act of running chkdsk.exe under Windows 7 might not be a common occurrence for most users, it is in fact something that server administrators do quite regularly to ensure volume integrity.

Microsoft has so far gotten a pass with Windows 7. The strength of the beta and release candidates, as well as the generally accepted belief that Windows 7 is essentially Vista R2 (and thus less prone to catastrophic bugs of this nature), has caused many in the IT community to lower their guards a bit. I myself am guilty of a bit too much Windows 7 boosterism in the weeks leading up to RTM. What this latest episode has taught me is that no major release of Windows –- not even one that is more or less a supersized patch of the previous version –- deserves a pass, and that the old wisdom of “wait for the first service pack” still applies with Windows 7.

This is, after all, a Microsoft product.

Title: A Rebuttal on a Critical Windows 7 bug
Post by: javajolt on August 06, 2009, 12:46:34 AM

A killer Windows 7 bug? Sorry, no

The blogosphere is abuzz over a newly publicized bug in Windows 7. I read about it yesterday on Chris123NT’s blog, where it was described as a “critical bug in Windows 7 RTM.” The story picked up momentum today when InfoWorld’s Randall Kennedy (the man behind the “Save XP” Astroturf campaign) published a sensational polemic: “Critical Windows 7 bug risks derailing product launch.” Tom Warren at Neowin called it “rather nasty” but sensibly concluded that it’s far from a “show stopper.”

My conclusion? It’s alarming behavior if you’re unaware of what’s happening. But when you look more carefully, it’s arguably a feature, not a bug, and the likelihood that you’ll ever crash a system this way is very, very small and completely avoidable.

You can go read Chris’s initial report to see the repro steps. Basically, you need to run the Windows Chkdsk command using the /r switch, which is designed to locate and repair bad sectors on a disk. According to the initial report, if you use this tool as described, “you should see your memory quickly gobbled away in the chkdsk.exe process until it either stops at or around 90% or it maxes completely out and crashes the computer.”

Let’s all take a deep breath, shall we? I’ve done a couple hours worth of testing this morning on the subject. There’s much less here than meets the eye. The idea that this bug is reproducible 100% of the time is incorrect, and in fact some of the seemingly alarming behavior is actually by design.

First, you won’t see this bug on your system drive. Why? Because if you try to run Chkdsk with this switch (either from the command line or from the graphical interface) you’ll be told that the drive is in use. Windows will politely offer to schedule the disk check to run the next time you reboot and before Windows loads. The disk check in this mode is quick and harmless.

(http://i.zdnet.com/blogs/chkdsk_issue_1.png)

Second, if you try to run disk check on a non-system drive that is in use (one where you have recently worked with data files for example), you’ll be offered the opportunity to dismount the drive and continue the check. If you refuse, Windows politely offers to reschedule the check to run at startup, just as in the previous case.

Third, I’ve heard at least one observer speculate that this might affect you if you insert a removable drive and Windows prompts you to “scan and fix it.”

(http://i.zdnet.com/blogs/chkdsk_issue_2.png)

I tried doing exactly that, inserting several USB flash drives until I found one 4GB model that triggered this prompt. It produced the following dialog box:

(http://i.zdnet.com/blogs/chkdsk_issue_3.png)

Note that the second option, to “Scan for and attempt recovery of bad sectors” is the equivalent of the /R switch for Chkdisk. It’s not selected by default, and even when I clicked it, the disk check ran perfectly, without incident. I tried running Chkdsk /r on the same disk, with no excessive memory usage.

As a final stress test, I ran Chkdsk with this option on a 160GB portable USB hard drive, as prompted by the Scan and Fix dialog box. It did indeed exhibit what seemed like alarming behavior, rapidly consuming all but 50MB 500MB or so of the 6GB of RAM on my test system. (That green bar on the bottom means I’m using roughly 93% of available RAM.)

(http://i.zdnet.com/blogs/chkdsk_issue_4.png)

I allowed the process to run, and although it took roughly 15 minutes to complete the check, memory usage never hit the system’s maximum, other programs remained completely responsive, and I was even able to run a second instance of Chkdsk /R on another USB drive.

Oh, and the original report was slightly off base. The extreme memory usage appears to be in the Explorer.exe process, not in Chkdsk. Update: The original report noted, correctly, that high memory usage is observed in the Chkdsk.exe process if you kick off the disk check from a command prompt. If you perform the exact same operation from the more familiar graphical interface, the measurement in Task Manager is different, with Explorer.exe being credited with the memory usage. However, the end result is exactly the same. I repeated these tests using both the graphical and command-line methods on multiple drives to confirm.

(http://i.zdnet.com/blogs/chkdsk_issue_5.png)

Windows boss Steven Sinofsky took the rare step of visiting the original blog and posted a comment explaining the issue:

Quote
In this case, we haven’t reproduced the crash…. [T]he design was to use more memory on purpose to speed things up, but never unbounded — we requset [sic] the available memory and operate within that leaving at least 50M of physical memory. Our assumption was that using /r means your disk is such that you would prefer to get the repair done and over with rather than keep working.

While we appreciate the drama of “critical bug” and then the pickup of “showstopper” that I’ve seen, we might take a step back and realize that this might not have that defcon level. Bugs that are so severe as to require immediate patches and attention would have to have no workarounds and would generally be such that a large set of people would run across them in the normal course of using their PC.

My experience bears out that explanation perfectly. According to Sinofsky, Microsoft is now doing “overnight stress testing of 40 machines” to see whether the bug is reproducible. If so, I would expect a patch in short order. But based on my testing I have to agree this is interesting, but far from a “show stopper.”