BUG: You receive a run-time exception error message when you run the debug build of your application with the /RTCs compiler option enabled (822039)
The information in this article applies to:
- Microsoft Visual C++ .NET (2003)
- Microsoft Visual C++ .NET (2002)
SYMPTOMSWhen you run the debug build of your application with the /RTCs compiler option enabled, you may receive the following exception error message: Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention. You receive this error message when the following conditions are true: - You call a function that does not use the __cdecl modifier.
- The function contains parameters that are larger than 64 kilobytes (KB).
- You compile your application in the Debug mode and with the /RTCs compiler option enabled.
CAUSE When you pass a parameter that is 64 KB or larger to a function that does not use the __cdecl modifier, the compiler generates incorrect code. When the function that is called tries to return control to the calling function, the compiler triggers the error that is mentioned in the "Symptoms" section. The compiler generates a 16-bit immediate return (RET) that has an operand that is limited to 64 KB. If the parameters that are passed to the function are larger than 64 KB, the stack becomes corrupted when the function returns.STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.REFERENCESFor more information, visit the following Microsoft Developer Network (MSDN) Web sites:
Modification Type: | Minor | Last Reviewed: | 1/12/2006 |
---|
Keywords: | kbCompiler kbDebug kberrmsg kbtshoot kbbug KB822039 kbAudDeveloper |
---|
|