从故障转储中获取 GDI 句柄计数的命令
我有一个故障转储,并且我怀疑 GDI 泄漏是导致崩溃的原因。
从完整的故障转储中是否可以找出我的进程崩溃时使用的 GDI 句柄的数量?
I have a crash dump and I suspect GDI leaks to be a cause of the crash
From the full crash dump is there anyway to find out the number of GDI handles used by my process when it crashed?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我创建了一个 Windbg 脚本来转储 GDI 句柄表中的所有 GDI 句柄。请参阅 https://aloiskraus.wordpress .com/2016/06/25/show-gdi-handles-by-type-in-windbg/
当你转储它例如两次时,你可以看到那里发生了什么变化:
这是脚本
I have created a Windbg script to dump all GDI Handles from the GDI Handle table. See https://aloiskraus.wordpress.com/2016/06/25/show-gdi-handles-by-type-in-windbg/
When you dump it e.g. two times you can see what has changed there:
Here is the script
这不太可能,因为自 w2k 版本以来,针对 gdi 任务定制的唯一调试器扩展 gdikdx.dll 并未得到积极维护,而且我相信他们已经停止发布它,因为没有多少人会侵入 gdi 内部 - 根据我在 中偶然发现的某人的声明新闻组 - 因此不再对其进行投资。
不幸的是,您只剩下几个选项,所有这些选项都与运行时故障排除有关。
您可以从 nirsoft 的 GDIView 等工具开始,监视您的 GDI 资源的使用情况。应用程序,然后进入任何运行时检测选项:
PS 您能否更具体地说明特定崩溃的实际原因?
It is unlikely since the only debugger extension gdikdx.dll tailored at gdi tasks is not actively maintained since the w2k version and i believe they stopped shipping it since not that many folks are into hacking into gdi internals - according to someone's statement i stumbled upon in a newsgroup - therefore it is no longer invested into.
You're left with only a few options all of which are unfortunately about runtime troubleshooting.
You could start with a tool like nirsoft's GDIView to monitor the use of GDI resources from your app and then progress to any of the runtime instrumentation options:
P.S. could you be more specific on the actual reason of your particular crash?
Tess 谈到了类似的情况,也许这会给您带来线索...
http://blogs.msdn.com/tess/archive/2009/02/03 /net-memory-leak-to-dispose-or-not-to-dispose-that-s-the-1-gb-question.aspx
Tess talks about a similar situation, perhaps this will give you a lead...
http://blogs.msdn.com/tess/archive/2009/02/03/net-memory-leak-to-dispose-or-not-to-dispose-that-s-the-1-gb-question.aspx
这是一个从 GdiSharedHandleTable 转储 gdi 句柄的替代脚本,它可以在实时用户模式/实时内核模式/转储模式下使用
它还可以在 !for_each_process 命令字符串中使用,以在内核模式下从所有正在运行的进程中转储 gdi 句柄调试
它使用 .catch 块来打印摘要
在 kd 中,有时 GdiSharedhandleTable 页面将被调出/截断为小于其分配大小 peb 标头调出等问题会出现
所以这个脚本尝试读取尽可能多的内容,当发生内存访问冲突时,会离开 catch 块并打印以下摘要
顺便说一句,这个脚本可以挽救什么,
适用于 32 位,对于 64 位,伪寄存器需要根据需要的
执行结果进行调整
Here is an alternative script that dumps the gdi handles from GdiSharedHandleTable it can be used in live usermode / live kernelmode / dump mode
it can also be used in !for_each_process command string to dump gdi handles from all running process in a kernel mode debugging
it uses a .catch block to print the summary
in kd some times the GdiSharedhandleTable page will be paged out / truncated to less than its allocation size The peb header paged out etc problems arise
so this script tries to read as much as it is possible and when a memory access violation happens leaves the catch block and prints a summary of
what it was able to salvage
btw this script is for 32 bit for 64 bit the Pseudo registers need to be adjusted as needed
result of execution