FIX: Cl.exe throws a buffer overflow error in Visual C++ .NET (321653)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Editions 6.0
- Microsoft Visual C++ .NET (2002)
This article was previously published under Q321653 SYMPTOMS In Microsoft Visual C++ .NET, when you compile an application by
using the C/C++ compiler (Cl.exe), you may receive the following error message:
--------------------------- Microsoft Visual C++
Runtime Library --------------------------- Buffer overrun
detected!
Program: ...es\Microsoft Visual Studio .NET\VC7\BIN\cl.exe
A buffer overrun has been detected which has corrupted the program's
internal state. The program cannot safely continue execution and must now be
terminated.
--------------------------- OK
--------------------------- In Visual C++ 6.0, you may receive a
C1001 error message such as the following: "fatal error
C1001: INTERNAL COMPILER ERROR (compiler file 'msc1.cpp', line 1794)
Please choose the Technical Support command on the Visual C++ Help menu, or
open the Technical Support help file for more information"
CAUSE The compiler overflows a buffer that is intended to hold a
precompiled header file name and, because Cl.exe is compiled with the Buffer
Security Check flag (/GS), the buffer overflow warning dialog box appears and
the process ends.
In Visual C++ .NET, the error occurs when you
compile with the Automatic Use of Precompiled Headers switch (/YX) and you have a TMP environment variable that has a string length
greater than or equal to 52 characters (for example, C:\Documents and
Settings\Username\Local Settings\Temp).
In Visual C++ 6.0, the error
occurs when you compile with /YX and the TMP environment variable's length is greater than or
equal to 55 characters. RESOLUTION Make sure that the string length of the TMP environment
variable is less than 52 characters. STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.
This bug was corrected in Microsoft Visual C++ .NET 2003.
REFERENCES For more information, visit the following Microsoft Developer
Network (MSDN) Web site:
Modification Type: | Minor | Last Reviewed: | 1/6/2006 |
---|
Keywords: | kbfix kbbug kbCompiler kbLangCPP kbpending KB321653 |
---|
|