WinDbg - 寻找 NullPointerException... - 下一步去哪里?
我们的服务器场存在一些问题,每天会崩溃几次。我们中没有人有 WinDbg 的经验,但我的同事设法使用 adsutil.vbs 创建转储,现在我正在分析该转储。
加载符号等我已经设法做到了 - 然后我读了一点并尝试了 !analyze -v 和其他几个命令。其中我使用了 .exr -1 ,它给了我以下内容:
0:013> .exr -1
ExceptionAddress: 089644b9
ExceptionCode: c0000005 (Access violation)
ExceptionFlags: 00000000
NumberParameters: 2
Parameter[0]: 00000000
Parameter[1]: 00000000
Attempt to read from address 00000000
在 !analyze 转储的某个地方,我读到了有关发生空指针异常的一些详细信息,所以这是我到目前为止的领先优势。现在我有点卡住了 - 引用了一个内存位置而不知道下一步该看哪里......你建议我现在应该做什么?
We have some issues on a farm server which crashes several times a day. None of us have experience in WinDbg but my coworker managed to create dumps using adsutil.vbs and now I'm analyzing the dump.
Loading the symbols etc I've managed to do - I've then read a bit and tried both !analyze -v and several other commands. Among them I used .exr -1 which gives me the following:
0:013> .exr -1
ExceptionAddress: 089644b9
ExceptionCode: c0000005 (Access violation)
ExceptionFlags: 00000000
NumberParameters: 2
Parameter[0]: 00000000
Parameter[1]: 00000000
Attempt to read from address 00000000
Somewhere in the !analyze dump I read some details about a Nullpointer-Exception occurring so that's my lead so far. Now I'm a bit stuck - having a reference to a memorylocation without knowing where to look next... What would you suggest I should do now?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我强烈建议从 此 MSDN 博客上的 WinDbg 教程。在“调试学校”下的侧边栏中大约有五个。这些链接涵盖了调试 .net 应用程序的许多基本方面。
或者您可以直接跳转到 狩猎Windbg 的异常教程。
I would highly suggest starting with the WinDbg tutorials on this MSDN blog. There's about five of them in the sidebar under "debugging school". The links cover a lot of basic aspects of debugging .net apps.
Or you can jump right to the Hunting Exceptions with Windbg tutorial.
由于您似乎能够随意创建转储(考虑到服务器经常崩溃),所以我要做的是:
这样,您就可以在自己的开发环境中准确地看到代码在尝试访问空指针时所做的事情,包括崩溃时进程内存的完整状态。
WinDbg 是一个出色的生产调试工具,但如果可能的话,我总是更喜欢将转储带回家,这样更容易进行分析。
Since you seem to be able to create a dump at will (given the server crashes quite often), what I would do is this:
This way, you'll be able to see exactly what your code has been doing while it was trying to access the null pointer, including the full state of the process memory at the time of the crash, at the comfort of your own development environment.
WinDbg is a fantastic tool for production debugging, but when possible, I always prefer taking the dumps back home, where its much easier to do the analysis.