How to match a crash's “Fault offset” to the source code?

杀马特。学长 韩版系。学妹 提交于 2019-12-04 03:43:01

问题


An EXE I compiled keeps crashing. I have the following info in the Event Viewer when it crashes:

Exception code: 0xc0000008
Fault offset: 0x00000000000cb8e8

How do I match the "Fault offset" with my C++ code? There is a .PDB file in the Release folder, just not sure what steps to figure this out.


回答1:


You also need to know what module the offset belongs too, if you are getting 0xC0000008 (STATUS_INVALID_HANDLE), then the exception is likely thrown from ntdll.dll, which isn't going to help you debug your program, since what you care about is deeper in the stack.

What you should be doing is have your customer enable LocalDumps, and then send you a minidump file which you can debug.

Sample registry setup:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps]
"DumpFolder"="d:\\miniDumps"
"DumpType"=dword:00000002
"CustomDumpFlags"=dword:00001124


来源:https://stackoverflow.com/questions/21764885/how-to-match-a-crashs-fault-offset-to-the-source-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!