使用 symstore.exe 无法在 Windbg 或 Visual Studio 中加载用于小型转储的符号 [英] Using symstore.exe cannot load symbols for minidump in Windbg or Visual Studio

查看:19
本文介绍了使用 symstore.exe 无法在 Windbg 或 Visual Studio 中加载用于小型转储的符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了跟踪仅在 Windows 8 用户计算机上发生的 Qt 中的崩溃,我设置了一个本地符号服务器以用于调试崩溃转储.

In order to trace a crash in a Qt which only happens on a Windows 8 user machine I set up a local symbol server to use for debugging crash dumps.

首先,我使用以下标志集进行了完整构建:

First I did a full build with the following flags set:

QMAKE_CFLAGS_RELEASE += -Zi
QMAKE_CXXFLAGS_RELEASE += -Zi
QMAKE_LFLAGS_RELEASE += /DEBUG /OPT:REF

并使用 Windows Installer 和 VS 部署项目构建了一个安装程序.然后我运行了以下 symstore.exe 命令:

and built an installer using Windows Installer and a VS deployment project. Then I ran the following symstore.exe command:

C:\Program Files (x86)\Windows Kits\8.1\Debuggers\x64>symstore.exe add/r/f C:\builddir\*.*/s "C:\Users\Sam\符号"/t "应用程序"/v "rev xxxx"/c "test add"

这会在 C:\Users\Sam\symbols 中创建适当的 dll、exe 和 pdb 文件夹.

This created the appropiate dll, exe and pdb folders inside C:\Users\Sam\symbols.

然后我在用户机器上安装并通过Process Explorer生成了一个minidump文件.我尝试将转储加载到 Visual Studio 并将 C:\Users\Sam\symbols 添加到符号文件位置,但找不到与我的二进制文件匹配的符号.

Then I installed on the user machine and generated a minidump file through Process Explorer. I tried loading in the dump to Visual Studio and adding C:\Users\Sam\symbols to the symbol file locations but no matching symbols could be found for my binaries.

然后我尝试将其加载到 WinDbg64(这是一个 64 位应用程序).我设置 !sym noise.symfix C:\Users\Sam\symbols 设置符号路径并用 .reload/f 重新加载.这也没有任何成功,并且只导出加载的符号.例如:

Then I tried loading it into WinDbg64 (this being a 64bit application). I set !sym noisy set the symbol path with .symfix C:\Users\Sam\symbols and reloaded with .reload /f. This did not have any success either and only export symbols where loaded. For example:

QtGui4  No data is available : SRV*C:\Users\Sam\symbols*http://msdl.microsoft.com/download/symbols
    The SYMSRV client failed validating the GUID for the module, or the
    module does not have the debug header information.

所有模块都会发生这种情况,但我完全不希望 Qt 组件会发生这种情况,因为它们不是作为常规构建的一部分构建的,甚至将符号文件夹设置为直接包含 pdb 文件的 lib 文件夹也无济于事.

This happens for all modules but I would not expect it at all for the Qt components since these are not built as part of the regular build and even setting the symbol folder to the lib folder directly containing the pdb files doesn't help.

然后我尝试针对可执行文件和符号存储中的 pdb 文件运行 ChkMatch.exe.可执行文件的签名与 pdb 所在的文件夹相匹配,这表明它们应该是匹配的,但随后出现以下错误:

I then tried running ChkMatch.exe against the executable and the pdb file in my symbol store. The signature for the executable matched the folder the pdb was in which indicated that they should be a match but I then got the following error:

Debug information file:
Format: PDB 7.00
Error: PDB header - too many pages in root stream.

为了以防万一,我再次针对已安装的可执行文件运行了 ChkMatch.exe,但得到了相同的签名和相同的错误.

I ran ChkMatch.exe again against the installed executable just in case but got the same signature and the same error.

我尝试设置 symopt+0x40 这应该使 WinDbg 无论如何都可以使用 pdbs,而不会太仔细地检查签名 GUID.但是它仍然没有加载任何东西.额外输出:

I tried setting symopt+0x40 which should make WinDbg use the pdbs anyway without checking the signature GUID too closely. However it is still not loading anything at all. Extra output:

SYMSRV:  C:\Users\Sam\symbols\QtGui4.dll\5202030497e000\QtGui4.dll not found
...
SYMSRV:  C:\Users\Sam\symbols\QtGui4.dbg\5202030497e000\QtGui4.dbg not found
SYMSRV:  http://msdl.microsoft.com/download/symbols/QtGui4.dbg/5202030497e000/QtGui4.dbg not found
DBGHELP: .\QtGui4.dbg - file not found
DBGHELP: .\dll\QtGui4.dbg - path not found
DBGHELP: .\symbols\dll\QtGui4.dbg - path not found
DBGHELP: QtGui4.dll missing debug info.  Searching for pdb anyway
DBGHELP: Can't use symbol server for QtGui4.pdb - no header information available
DBGHELP: QtGui4.pdb - file not found
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for QtGui4.dll - 
DBGHELP: QtGui4 - export symbols

C:\Users\Sam\symbols\QtGui4.dll 中的文件夹名为 4AA92D1B712000 并且包含正确的 dll.

The folder in C:\Users\Sam\symbols\QtGui4.dll has the name 4AA92D1B712000 and contains what should be the correct dll.

推荐答案

我最终自己设法解决了这个问题.首先,我必须使用上述步骤从头开始删除并重新创建我的符号存储.我想我最初一定是因为在不同的文件夹上使用相同的版本号运行 symstore.exe 两次而弄乱了我的商店.

I managed to resolve this myself eventually. Firstly I had to delete and recreate my symbol store from scratch using the above steps. I think I must have messed up my store initially by running symstore.exe twice with the same version number on different folders.

完成此操作后,我可以加载故障转储并查看 Qt 库的符号,但最多只能加载大约 20 帧,并且没有加载任何其他模块.然后我想复制这个堆栈,但不能从 WinDbg 的堆栈窗口中复制,所以找到了 k 命令来打印堆栈.这是一个啊哈!"因为 k 命令打印的比堆栈窗口多得多,并显示发生了堆栈溢出.我发现可以为要打印的堆栈深度传入一个额外的参数,并且一个 k 0xFFFF 打印出整个堆栈.

Once I had done this I could then load in crash dumps and see the symbols for the Qt libraries, but only up to about twenty frames and none of the other modules were loaded. I then wanted to copy this stack but couldn't from the stack window in WinDbg and so found the k command to print out the stack. This was an 'Aha!' moment because the k command printed out much more than the stack window and revealed that a stack overflow had occurred. I found that an additional parameter could be passed in for the depth of the stack to be printed and a k 0xFFFF printed out the entire stack.

这篇关于使用 symstore.exe 无法在 Windbg 或 Visual Studio 中加载用于小型转储的符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆