Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Program has exited with code -2147483645

Tags:

c++

visual-c++

Ive run into an interesting (rather annoying) error while using Visual Studio to debug a mixed WPF/CLR/Unmanaged native c++ project, this error occurs only in Windows XP. It would seem that I have a memory corruption occuring within the program, the scope of which is much too large to post here. The problem that I am having is that when the crash occurs in the program, it simply exits without the VS debugger attempting to locate an exception, I assume because none is thrown. The program exit code is really the only information I have to go on, and its just the minimum int value.

Has anyone encountered this and might be able to point me in the right direction as far as what it means?

EDIT:

Continuing to investigate the problem, Ive discovered that I can sometimes get a stack trace and an exception as opposed to a straight program exit. The trace brings me to a vector allocation (push). In the scenario where the program just exits, this is still the last line executed. I assume that I have corrupt memory somewhere, though I was hoping that the fact that this usually manifests itself as a program dump and not an exception would be able to help point me in the right direction.

like image 969
jimmyjambles Avatar asked Jul 20 '12 17:07

jimmyjambles


People also ask

Why does the program [4268] project4 Exe exit with code 0 (0x0)?

The program ' [4268] Project4.exe ' has exited with code 0 (0x0). Exited with code 0 means there was no error. What is your question? Please show the code of your program so we can see what it is doing.

Why is my program crashing when I debug it?

It could be a stray __debugbreak () you left in your code, it could be triggered by a wild jump when the program state got corrupted. You'll need to debug it. If you can't easily repro it on your dev machine then you'll need a minidump from the failing machine.

Which thread has exited with code -1073741701?

The thread 0x754 has exited with code -1073741701 (0xc000007b). The thread 0x3a00 has exited with code -1073741701 (0xc000007b). The program '[5456] myprogram.exe' has exited with code -1073741701 (0xc000007b).


1 Answers

//
// MessageId: STATUS_BREAKPOINT
//
// MessageText:
//
// {EXCEPTION}
// Breakpoint
// A breakpoint has been reached.
//
#define STATUS_BREAKPOINT                ((NTSTATUS)0x80000003L)

The program landed on an INT3 instruction and triggered a breakpoint. But no debugger present so that terminates the program. It could be a stray __debugbreak() you left in your code, it could be triggered by a wild jump when the program state got corrupted.

You'll need to debug it. If you can't easily repro it on your dev machine then you'll need a minidump from the failing machine.

like image 100
Hans Passant Avatar answered Sep 19 '22 09:09

Hans Passant