C++ Windows 7 异常代码:0xc0000409
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23409809/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Windows 7 exception code: 0xc0000409
提问by Dennis Kerrisk
I have a C++ windows application that was done by another programmer, that I had to remove one line of code. After rebuilding the application with visual studio 2013 it crashes with this in the event log:
我有一个由另一个程序员完成的 C++ windows 应用程序,我不得不删除一行代码。使用 Visual Studio 2013 重建应用程序后,它在事件日志中崩溃:
Faulting application name: WaveStream.exe, version: 0.0.0.0, time stamp: 0x536122da
Faulting module name: WaveStream.exe, version: 0.0.0.0, time stamp: 0x536122da
Exception code: 0xc0000409
Fault offset: 0x0000bd7f
Faulting process id: 0x8b8
Faulting application start time: 0x01cf6490aee4f557
Faulting application path: C:\Program Files (x86)\PS Audio\WaveStream.exe
Faulting module path: C:\Program Files (x86)\PS Audio\WaveStream.exe
Report Id: efe00d42-d083-11e3-a513-bc305baf9e1e
The application uses QT 4.7.4, and compiles with no errors. I am an embedded systems programmer and have very little windows programing experience. What can I do to figure out why it is crashing?
该应用程序使用 QT 4.7.4,并且编译没有错误。我是一名嵌入式系统程序员,几乎没有 Windows 编程经验。我能做些什么来弄清楚它为什么崩溃?
Dennis
丹尼斯
回答by Stephen Kellett
The clue to the problem is in the exception code: 0xc0000409
问题的线索在异常代码中:0xc0000409
0xc0000409means STATUS_STACK_BUFFER_OVERRUN.
0xc0000409表示STATUS_STACK_BUFFER_OVERRUN。
In other words, something in your program is writing past the current stack frame, corrupting data on the stack. The program has detected this and rather than let it continue, has thrown an exception.
换句话说,您的程序中的某些内容正在写入当前堆栈帧,从而破坏堆栈上的数据。程序已经检测到这一点,并没有让它继续,而是抛出了一个异常。
How do you debug this? There are a few options:
你如何调试这个?有几个选项:
1)Rerun this in the debugger and watch it crash, workout what failed.
1)在调试器中重新运行它并观察它崩溃,检查失败的部分。
2)If you've got a crash dump of this, load that in the debugger, hit F5 and workout what failed.
2)如果您有此故障转储,请将其加载到调试器中,按 F5 并检查失败的部分。
3)If you don't have a crash dump you can still attempt to find out the cause of the crash if you know the absolute address of the crash (and know the module always loads at a fixed address), or if you know the offset of the crash location from the start of the faulting module.
3)如果您没有崩溃转储,如果您知道崩溃的绝对地址(并且知道模块总是在固定地址加载),或者如果您知道崩溃的原因,您仍然可以尝试找出崩溃的原因碰撞位置与故障模块起点的偏移。
The crash information above tells you the offset into the faulting module of the crash. That's reported in the Fault Offset field. In your example, that is an offset of 0x0000bd7f.
上面的崩溃信息告诉您到崩溃故障模块的偏移量。这在故障偏移字段中报告。在您的示例中,这是 0x0000bd7f 的偏移量。
If you've got the original dll/exe and it's matching PDB, just load it into DbgHelpBrowser, go to the Querymenu, choose "Find Symbol with DLL Relative Address..."then enter the offset in the field and click "Find Symbol...". The display will move to show you the nearest matching symbol, highlighting the symbol and display any info about parameters, line numbers and source code.
如果您有原始的 dll/exe 并且它匹配 PDB,只需将其加载到DbgHelpBrowser 中,转到查询菜单,选择“查找具有 DLL 相对地址的符号...”,然后在字段中输入偏移量并单击“查找”符号……”。显示屏将移动以显示最接近的匹配符号,突出显示该符号并显示有关参数、行号和源代码的任何信息。
It's a free tool. You can get it here: https://www.softwareverify.com/cpp-dbghelp-browser.php
这是一个免费的工具。你可以在这里得到它:https: //www.softwareverify.com/cpp-dbghelp-browser.php
Disclaimer. I wrote this tool to do just this job for our in house use. We recently made it available for everyone else. I found this question while trying to understand what the exception code 0xc0000409 meant.
免责声明。我编写了这个工具来为我们的内部使用做这项工作。我们最近将其提供给其他所有人。我在尝试理解异常代码 0xc0000409 的含义时发现了这个问题。
回答by RC Brand
Try to create a crash dump for the application. See this StackOverflow questionand the MSDN documentationon how to do that. Once you have the crash dump file, open it in the Visual Studio debugger and you will be able to see the exception and call stack for the exception, which should help.
尝试为应用程序创建故障转储。请参阅此 StackOverflow 问题和有关如何执行此操作的MSDN 文档。获得故障转储文件后,在 Visual Studio 调试器中打开它,您将能够看到异常和异常的调用堆栈,这应该会有所帮助。