2009-08-13 151 views
0

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

感谢您的帮助。

+0

除非你有符号的DLL的调试版本,你可能是出于运气,什么比第三方代码暴跌更令人沮丧! – 2009-08-13 19:23:19

+0

它实际上是我自己注入的DLL。因此,我有权访问源 – 2009-08-13 19:29:36

+0

自从我的回答被接受后,出于随机的好奇心,windbg停止了内存损坏还是内存不足或某些其他资源异常? – 2009-10-15 03:01:16

回答

1

尝试运行Windbg下的程序。发生崩溃时,您可能会得到一些关于原因的具体信息。您可以启动承载您的dll的第三方进程,然后将windbg调试器附加到进程。发生崩溃时,windbg可能会停止并报告某种类型的异常。然后,您可以使用各种命令的WinDbg看线程堆栈等

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,