我有一个程序,在运行2-4小时后随机崩溃(看起来)。我是在Visual Studio Pro 2008下用c++开发的。由于崩溃发生在注入的DLL中(被注入到第三方软件内存空间的内存空间中),我不能使用Visual Studio调试器,但我可以使用iter进程通信(我使用邮箱)获得一些输出到控制台。所以这里有一个问题:调试这个的最好方法是什么?有没有第三方软件/插件/调试器可以告诉我哪个变量是NULL导致崩溃?
谢谢你的帮助。
发布于 2009-08-13 19:30:52
尝试在Windbg下运行该程序。当崩溃发生时,你可能会得到一些关于原因的具体信息。您可以启动托管dll的第三方进程,然后将windbg调试器附加到该进程。当崩溃发生时,windbg可能会停止并报告某种类型的异常。然后您可以使用各种windbg命令来查看线程堆栈等。
发布于 2009-08-13 19:54:47
大家好,
你的问题给我带来了两个警报。
* 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
“祝你快乐,
https://stackoverflow.com/questions/1274033
复制相似问题