In Microsoft Visual Studio 2008, you create a C++ class that contains thousands of members. When you build the source when the Debug Information Format option is turned on, a window appears that indicates that the Microsoft C/C++ Compiler Driver has stopped working. In addition, in the Error List window, you receive an error message that resembles the following:
Error result -1073741819 returned from '[InstallDrive]\Program Files\Microsoft Visual Studio 9.0\VC\bin\cl.exe'.
If you debug the problem, you see an exception that resembles the following:
Unhandled exception at 0x682a3841 in cl.exe: 0xC0000005: Access violation writing location 0x00210ffc.
The value "0x682a3841" may change at different times.
The problem occurs only when the number of members in the class is extremely large and exceeds the expected value for the compiler.
The Debug Information Format options include /Z7, /Zi, /ZI.
When the Debug Information Format option is turned on when you build the source, debug information is collected for the thousands of members. The data that is collected exceeds the limit of the internal buffer. This causes an internal compiler error.
A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing the problem described in this article. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next software update that contains this hotfix.
If the hotfix is available for download, there is a "Hotfix download available" section at the top of this Knowledge Base article. If this section does not appear, contact Microsoft Customer Service and Support to obtain the hotfix.
Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft Web site:
Note The "Hotfix download available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.
You must have Visual Studio 2008 Service Pack 1 installed to apply this hotfix.
You do not have to restart the computer after you apply this hotfix.
Hotfix replacement information
This hotfix does not replace any other hotfixes.
The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.
To prevent this problem from occurring, delete the Debug Information Format option, add the /typedil- option, and then compile the project. However, the generated binary will not have the debug information.
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
The C++ Standard recommends that compilers allow for at least 4,096 instance members and 1,024 static members for any one class. Additionally, the Visual C++ compiler can usually handle thousands more members than that. There is not a hard-coded limit for the number of instance class members or static class members. However, the amount of virtual memory will impose a practical limit on the compilation. When you use tools that generate C++ source code and then compile debug symbols for classes that exceed this limit, the size of a buffer that is used in the first compilation pass is exceeded. Then, an internal compiler error occurs.