NVIDIA Stereo 3D Vision service bug causes handle leak

Affected: GeForce 8800 GT and higher, 9600 GT and higher, or any GeForce 200 series and higher, using driver version 186.xx and up.

Update (8/10): A NVIDIA representative has indicated the fix will be “available in the next driver release” sometime this month.

While poking around Process Explorer, I stumbled upon a process having a curiously high handle count. Having dealt with leaky components before, I identified the 64 handle/minute pattern almost immediately.

Process Explorer, FTW!

Figure - Process Explorer viewing nvSCPAPISvr.exe open file handles

 

As the description indicates, this particular component (a Windows service) is responsible for some sort of NVIDIA Stereoscopic feature. With some Bing’ing around, I discovered this functionality is only useful if you use 3D glasses shown on the NVIDIA 3D Vision product page.

While I could have simply stopped the service – which shouldn’t be configured to start Automatically to begin with – I decided to dive a little deeper to understand the issue.

After some disassembly, I found string references to INFOEM*.INF which led me to a piece of code wrapped in a loop. My ASM to C++ hand transcribed version of the code (not representative of the real product):

[file lang="cpp"]http://static.withinwindows.com/files/uploads/files/nvidia/bug.cpp[/file]

The bug isn’t obvious at first glance. The issue lies within the use of SetupOpenInfFile. The handle returned by this function is never passed into SetupCloseInfFile, leaving various internal file and mutex handles open consuming a large amount of memory (as this user reported in July).

To mitigate this issue, I strongly suggest you stop and disable the NVIDIA Stereoscopic 3D Driver Service. If you use its stereoscopic features, I suggest you only use the service for short amounts of time.

Although the latest drivers I’m using aren’t WHQL signed (190.56), this problem also exists in all drivers versioned 186.xx and up. This range is inclusive of WHQL and non-WHQL signed drivers. I, again, urge Microsoft to include some sort of Application Verifier testing with all components bundled with WHQL submitted drivers.