There's a common error that gets thrown by the Visual C Runtime:
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
What does this error message actually mean?
Let me use a parable to explain exactly what i'm asking.
If I see a message:
Exception: access violation (0xc0000005), Address 0x702be865
This access violation has nothing to do with sexual harassment, or someone trying to break into my computer (any more than General Failure was a brigadier general who was trying to read my C drive, or that you could be hauled off to jail for performing an illegal operation in Windows 95).
In this case, access violation corresponds to the constant EXCEPTION_ACCESS_VIOLATION
(declared in winbase.h
with value 0xC0000005). This constant one possible exception error code that can be returned in an EXCEPTION_RECORD
structure. The code ACCESS_VIOLATION
means that the program tried to read or write to an address in memory that it shouldn't be. If you try to read from a memory address that was never allocated, then you're doing something horribly bad - and the exception tells you so.
It is usually caused when a program has a pointer to memory that is not, or is no longer, valid. The solution is stop trying to access memory that isn't valid.
Note: I'm not asking:
- why is program x getting a C0000005 error?
- why is my code getting an access violation?
- how do I debug an access violation?
So if I asked you, what causes an access violation, you wouldn't tell me to check the stack trace, or watch the output window, or to post sample code. You would say, "It is from trying to access memory that isn't valid."
Back to my question
What does the following error mean:
This application has requested the Runtime to terminate in an unusual way.
I am (fairly) certain that the Microsoft Visual C Runtime library does not have a function:
void TerminateRuntime(bool UnusualWay);
So I have to try to figure out what it actually means:
- What does it mean to terminate the visual C runtime library? (msvcrt is a dll; you don't terminate it, you just don't use it anymore)
- What would be a usual way to terminate MSVCRT?
- Would someone choose to terminate it in an unusual way?
- Is today's unusual way actually a long since deprecated form of what used to be the usual way?
- If I was (mistakenly) terminating it in an unusual way, what would I do to terminate it in the usual way?
In other words: what error is the MSVCRT catching, and hiding behind the uninformative error message?
See Question&Answers more detail:
os