WinDbg - 寻找 NullPointerException... - 下一步去哪里?

发布于 2024-08-06 11:55:49 字数 536 浏览 5 评论 0原文

我们的服务器场存在一些问题,每天会崩溃几次。我们中没有人有 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

奶茶白久 2024-08-13 11:55:49

我强烈建议从 此 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.

你げ笑在眉眼 2024-08-13 11:55:49

由于您似乎能够随意创建转储(考虑到服务器经常崩溃),所以我要做的是:

  1. 创建一个完整的故障转储(如果您还没有)。您可以使用 AdPlus(在 WinDbg 库中找到)来实现此目的,只需阅读文档即可了解如何操作。
  2. 在您自己的开发环境(Visual Studio(如果您有最新版本)或 WinDbg 本身)中调试转储,并拥有所有可用的源代码。

这样,您就可以在自己的开发环境中准确地看到代码在尝试访问空指针时所做的事情,包括崩溃时进程内存的完整状态。

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:

  1. Create a full crash dump, if you don't have one yet. You can use AdPlus (found in the WinDbg lib) for that, just read the docs to see how.
  2. Debug the dump at your own development environment, either Visual Studio (if you have a recent version) or WinDbg itself, having all the source code available.

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文