Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows 7 exception code: 0xc0000409

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:

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?

Dennis

like image 897
Dennis Kerrisk Avatar asked May 01 '14 14:05

Dennis Kerrisk


People also ask

How do I fix exception code 0xc0000409?

Reinstall the application. To fix the Unknown Software Exception 0xc0000409 error, you can choose to reinstall the application. Therefore, you can go to the control panel to uninstall the software first, and then go to the official website to download it again.

What is 0xc0000409?

Error code 0xc0000409 can also be the result of a known issue with the Windows 10 Insider Preview Build 19624. If you experience this error, you should pause updating until a future fix. If you didn't install the latest Insider Preview Build 19624, try to perform a Windows 10 repair install.

What is exception code 0xc0000005?

Application Error 0xc0000005 (Access Violation) is usually caused by the computer not being able to correctly process the files and settings required to run a particular program or installation.

What is exception code 0xc0000374?

The exception code 0xc0000374 indicates a heap corruption - to determine the solution, you would need to debug the crash in a debugger to figure out who is corrupting the heap.


2 Answers

The clue to the problem is in the exception code: 0xc0000409

0xc0000409 means 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.

2) If you've got a crash dump of this, load that in the debugger, hit F5 and workout what failed.

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.

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.

If you've got the original dll/exe and it's matching PDB, just load it into DbgHelpBrowser, go to the Query menu, 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.

It's a free tool. You can get it here: 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.

like image 128
Stephen Kellett Avatar answered Oct 19 '22 06:10

Stephen Kellett


Try to create a crash dump for the application. See this StackOverflow question and the MSDN documentation on 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.

like image 41
RC Brand Avatar answered Oct 19 '22 07:10

RC Brand