随机崩溃调试

时间:2009-08-13 19:18:56

标签: visual-studio-2008

我有一个程序在运行2-4小时后随机崩溃(看似)。我在Visual Studio Pro 2008下用c ++开发。由于崩溃发生在注入的DLL中(注入第三方软件内存空间的内存空间),我无法使用Visual Studio调试器,但我可以获得一些输出控制台使用iter-process通信(我正在使用邮箱)。 所以这是一个问题:调试这个的最佳方法是什么?是否有第三方软件/附加/调试器可以告诉我哪个变量是NULL导致崩溃?

感谢您的帮助。

2 个答案:

答案 0 :(得分:1)

尝试在Windbg下运行该程序。崩溃发生时,您可能会获得有关原因的特定信息。您可以启动托管您的dll的第三方进程,然后将windbg调试器附加到该进程。崩溃发生时,windbg可能会停止并报告某种类型的异常。然后,您可以使用各种windbg命令查看线程堆栈等。

答案 1 :(得分:0)

天儿真好,

你的问题为我引发了两个警报。

* a memory leak smell which could be verified by running the same set of input and seeing if the crash happens at about the same elapsed time, and
* a specific test case that is tickling something in your third party library. You could do a binary chop on your input data to track down what's triggering this. I just had to do this to track down which request out of over two hundred thousand was triggering a memory leak in a custom Apache module. Divide and conquer. Divide and conquer. Divide and conquer. Repeat and rinse.

HTH

“Avahappy,