Win32:Watson 博士的完整/迷你转储和我自己编写的转储之间有区别吗?

发布于 2024-08-29 13:12:23 字数 469 浏览 8 评论 0原文

我有一个应用程序在发布版本中偶尔会崩溃;不幸的是,看起来它在第 3 方 DLL 中崩溃了。在试图掌握它的过程中,我一直在如何操作和 Windows 如何创建故障转储的描述的海洋中游泳。

我正在考虑使用这个建议的小型转储:

获取启动时崩溃的进程的转储

我计划将此功能保留在代码中,以便始终为我的应用程序创建转储,而无需事先设置 PC。顺便说一句,此应用程序不用于分发;它将与我们自己的硬件配对,因此我不担心如果应用程序崩溃,随机用户会在其计算机上构建转储文件。

附加说明:所有代码都是 C/C++。

Dr. Watson (drwtsn32.exe) 和这段代码为我生成的内容之间有区别吗?

I have an application that is occasionally crashing in the release build; unfortunately, it looks like it is crashing in a 3rd party DLL. While trying to get a handle on it I've been swimming in a sea of HOW TOs and descriptions of how Windows creates crash dumps.

I was thinking about using this suggested mini-dump:

Getting a dump of a process that crashes on startup

I was planning on leaving this functionality in the code so the dump is always created for my application without having to have the PC set up beforehand. BTW, this application is not for distribution; it will be paired with our own hardware so I'm not concerned about random users having dump files building on their machines if the application happens to crash.

Additional note: all of the code is C/C++.

Is there a difference between what Dr. Watson (drwtsn32.exe) and this code will produce for me?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(4

莫言歌 2024-09-05 13:12:23

对于华生医生来说,只有当他看到你“崩溃”时,你才会感到沮丧。使用转储器 API,您将能够从应用程序中的任何点调用它。例如。您可以将普通断言转储起来,而不是显示对话框。根据我的经验,一旦您的应用程序支持转储,您会发现更容易调查、排除故障和修复各种问题,因为您可以在您认为合适的任何地方生成完整转储(甚至小型转储)代码。

With Dr. Watson you'll only get the dumps when the Dr. sees you 'crashed'. Using the dumper API you'll be able to invoke it from any point in the app. Eg. you can trampoline the ordinary asserts to dump instead of showing a dialog. In my experience once you have dump support in your app you'll find it easier down the road to investigate, troubleshoot and fix various problems, simply because you can produce a full dump (or even a minidump) at any place you see fit in code.

九公里浅绿 2024-09-05 13:12:23

没有太大区别,只是如果您创建自己的小型转储,您可以更好地控制其中的详细程度。默认情况下,小型转储具有堆栈和一些局部变量,但是创建自己的小型转储可以让您选择创建完整的内存转储,这也可能被证明更有用(尽管如果内存映像是大的)。

如果崩溃发生得相当频繁,那么可能值得收集 drwatson(或 Vista 及以上版本中的 werfault)为您生成的一些小型转储,因为这可能会为您提供足够的信息。如果没有,那么您可以选择添加自己的未处理异常过滤器。另一件可能发生的事情是,您收到的小型转储是崩溃的站点,而不是可能出现的第一次机会异常。创建您自己的小型转储意味着您更有可能获得更接近问题所在的堆栈跟踪。

如果您的计算机更频繁地出现该问题,另一种选择是在后台——它将等待,直到您的应用程序崩溃或抛出异常,然后生成一些有用的日志文件。它与未处理的异常过滤器执行类似的操作,只是它不需要对您的应用程序进行任何更改。

There isn't much difference except that if you create your own minidump you have more control over the level of detail in it. By default Minidumps have the stack and some local variables, but creating your own gives you the option of creating a full memory dump also which may prove to be more useful (though this then may make collection of these dumps more problematic if the memory image is large).

If the crash happens reasonably frequently it may be worth just collecting some minidumps that drwatson (or werfault in Vista onwards) produces for you, as that may give you enough information. If it doesn't then you have the option of adding your own unhandled exception filter. Another thing that can happen is that the minidump you receive is the site of the crash rather than a first chance exception that may have arisen. Creating your own minidumps means that you're more likely to get a stack trace closer to where the problem is.

Another option, if you have a machine which exhibits the problem more often is to run ADPlus in the background -- it will sit and wait until your app crashes or throws exceptions then produce some useful log files. It does a similar same thing as the unhandled exception filter except it requires no changes to your app.

冰雪梦之恋 2024-09-05 13:12:23

最需要注意的是 MiniDumpWriteDump 必须进行内存分配和文件I/O。如果堆结构损坏,从失败进程内部调用它可能会失败。

从辅助进程中调用 MiniDumpWriteDump 的效果相同与使用 Dr. Watson 一样,只不过您可以控制转储选项。

推荐阅读:MiniDumpWriteDump 中的加载程序锁死锁

The biggest thing to watch out for is that MiniDumpWriteDump has to do memory allocation and file I/O. Calling it from inside the failed process may fail if e.g. heap structures are corrupted.

Calling MiniDumpWriteDump from a helper process works the same as using Dr. Watson, except that you have control over the dump options.

Recommended reading: loader lock deadlock in MiniDumpWriteDump

箜明 2024-09-05 13:12:23

我不这么认为。尽管 Dr Watson 将生成完整或小型转储,但您可以使用 ntsd 调试器 来获取对转储中包含哪些数据进行更多控制。

Dr Watson 的小型转储对于大多数事情来说已经足够了,您可以获得调用堆栈和变量。如果您需要更多,ntsd 有很多选项

使用 DrWatson 的唯一好处是它预装在 Windows 上。

I don't think so. Although Dr Watson will generate full or mini dumps, you could use the ntsd debugger instead to get a lot more control of what data is included in the dumps.

Dr Watson's minidumps are good enough for most things, you get a call stack and variables. IF you need more, ntsd has a load of options.

The only benefit to using DrWatson is that is comes pre-installed on Windows.

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