Debug Crash in DLL

时间:2016-07-11 19:42:39

标签: c++ windows debugging

Trying to debug a crash in one of our DLL's. It is loaded into Server Manager and crashes when trying to configure Active Directory Certificate Services (the DLL is a registered provider). I know the crash is an access violation and I have the pdb file, just don't know how to go about debugging this. I've read pages such as this and this (didn't help). I tried to glean the info using windbg (using lm to get the loaded address, which appears to be 8000000:

"C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\windbg.exe" -z myKSP.dll

Then

0:000> lm 
start             end                 module name
00000001`80000000 00000001`8005e000 ...

Then, since the Event Viewer tells me:

Exception code: 0xc0000005
Fault offset: 0x000000000002a601

I tried to view that:

0:000> ln 80000000+2a601
Browse module
Set bu breakpoint

Nothing is shown.

I have VS2015, so, I tried to attach to the serververmanager.exe process. Next, I tried loading symbols via Tools->Options->Debugging->Symbols and specifying the path, but, when I set a breakpoint, I always receive "no symbols have been loaded". In the previous symbol windows, I set the cache folder, which downloaded a bunch of stuff, but that did not seem to load anything.

Clearly, I'm not using the tools correctly. How do I debug a DLL, compiled in Release mode, PDB is available, that is loaded by the ServerManager.exe or whatever sub-process it might spawn)?

1 个答案:

答案 0 :(得分:0)

启动windbg,按Ctrl-D打开转储文件,然后键入以下内容。这应该会给你一个kp500之后的重要堆栈,或者至少会告诉你pdb文件是否与二进制文件不匹配。

.symfix
.sympath+ <FOLDER_WITH_YOUR_PDB>
.reload
!sym noisy
.reload /v /f myKSP.dll
!sym quiet
kp500
.ecxr
kp500