An access violation error occurs when you run a Visual C++ 2010 application that is built for an x64 platform if an optimization compiler option is enabled

Article translations Article translations
Article ID: 2485545 - View products that this article applies to.
Expand all | Collapse all

On This Page

Symptoms

Consider the following scenario:
  • You create a Microsoft Visual C++ 2010 project. 
  • You use a function that returns a local variable that is larger than 64 bytes. 
  • You enable an optimization compiler option for the project. For example, you enable the Maximize Speed (/O2) optimization compiler option.
  • You build the project for the x64 platform by using Microsoft Visual Studio 2010, and then you try to run the built application.
In this scenario, an access violation error occurs, and the application crashes.

Cause

This issue occurs because the compiler-generated code calls an instruction that requires a data buffer aligned in 16-byte blocks. For example, the code calls a MOVAPD or MOVDQA instruction. However, the data buffer may be unaligned. Therefore, an access violation occurs when the application uses this instruction to try to write an optimized local variable into an unaligned data buffer.

Resolution

Hotfix information

A supported hotfix is now available from Microsoft. However, it is intended to correct only the problem that is described in this article. Apply it only to systems that are experiencing this specific problem. This hotfix may 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.

To resolve this problem immediately, contact Microsoft Customer Support Services to obtain the hotfix. For a complete list of Microsoft Customer Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:
http://support.microsoft.com/contactus/?ws=support
Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

Prerequisites

To apply this hotfix, you must have Microsoft Visual Studio 2010 installed.

Restart requirement

You do not have to restart the computer after you install this hotfix.

Hotfix replacement information

This hotfix does not replace any other hotfix.

File information

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.
For all supported versions of Team Foundation Server 2008
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
C2.dll16.0.30319.4132,508,09601-Jan-201102:33x86
C2.dll16.0.30319.4132,627,39201-Jan-201102:33x86
C2.dll16.0.30319.4132,975,55201-Jan-201102:33x64

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

Properties

Article ID: 2485545 - Last Review: June 21, 2014 - Revision: 3.0
Applies to
  • Microsoft Visual Studio 2010 Professional
  • Microsoft Visual Studio 2010 Ultimate
  • Microsoft Visual Studio 2010 Premium
Keywords: 
kbfix kbqfe kbexpertiseadvanced kbsurveynew KB2485545

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com