!htrace显示没有callstack

时间:2011-05-17 13:12:07

标签: windbg handle-leak

当我在WinDbg中使用!htrace -diff来调试句柄泄漏时,我得到了许多不显示callstack的句柄(可能是泄漏的句柄):

这可能是什么原因以及我有什么选择来进一步调试?

Handle = 0x000273e4 - OPEN
Thread ID = 0x00001190, Process ID = 0x0000114c

--------------------------------------
Handle = 0x000273e0 - OPEN
Thread ID = 0x00001190, Process ID = 0x0000114c

--------------------------------------
Handle = 0x000273dc - OPEN
Thread ID = 0x00001190, Process ID = 0x0000114c

--------------------------------------
Handle = 0x000273d8 - OPEN
Thread ID = 0x00001190, Process ID = 0x0000114c

--------------------------------------
Handle = 0x000273d4 - OPEN
Thread ID = 0x00001190, Process ID = 0x0000114c

--------------------------------------
Handle = 0x000273d0 - OPEN
Thread ID = 0x00001190, Process ID = 0x0000114c

--------------------------------------
Handle = 0x000273cc - OPEN
Thread ID = 0x00001190, Process ID = 0x0000114c

--------------------------------------
Handle = 0x000273c8 - OPEN
Thread ID = 0x00001190, Process ID = 0x0000114c

--------------------------------------
Handle = 0x000273c4 - OPEN
Thread ID = 0x00001190, Process ID = 0x0000114c

--------------------------------------
Handle = 0x000273c0 - OPEN
Thread ID = 0x00001190, Process ID = 0x0000114c

--------------------------------------
Handle = 0x000273bc - OPEN
Thread ID = 0x00001190, Process ID = 0x0000114c

--------------------------------------
Handle = 0x000273b8 - OPEN
Thread ID = 0x00001190, Process ID = 0x0000114c

--------------------------------------
Handle = 0x000273b4 - OPEN
Thread ID = 0x00001190, Process ID = 0x0000114c

--------------------------------------
Handle = 0x000273b0 - OPEN
Thread ID = 0x00001190, Process ID = 0x0000114c

--------------------------------------
Handle = 0x000273ac - OPEN
Thread ID = 0x00001190, Process ID = 0x0000114c

--------------------------------------
Handle = 0x000273a8 - OPEN
Thread ID = 0x00001190, Process ID = 0x0000114c

--------------------------------------
Handle = 0x000273a4 - OPEN
Thread ID = 0x00001190, Process ID = 0x0000114c

--------------------------------------

更新 :句柄泄漏似乎取决于图形驱动程序或图形卡。当我使用任何形式的WPF时它开始泄漏它只会在某些带有某些图形卡/驱动程序的Windows XP系统上泄漏。

1 个答案:

答案 0 :(得分:1)

通过ZwOpenProcess例程(http://msdn.microsoft.com/en-us/library/windows/hardware/ff567022(v=vs.85).aspx)在内核模式下执行调用,而不是ZwClose呼叫。然后把手泄漏。您没有看到callstack,因为它们仅在从用户模式(OpenProcess / CloseHandle)执行调用时可用。

在XP SP3上,似乎很难找到罪魁祸首。解决方案是使用操作系统中内置的“对象引用跟踪”功能,但此路径存在问题(有关详细参考,请参阅http://www.osronline.com/showthread.cfm?link=198302)。由于您发现此问题仅在存在特定视频卡时出现,您可以尝试联系供应商或检查更新版本的驱动程序。