FIX: Error message when you run an application that is configured to be built for the x64 platform by using the MSVCR90.dll file that calls the strncpy function: "An unhandled win32 exception occurred in 'application_name'"

Symptoms

You have an application that is configured to be built for an x64 platform by using the Msvcr90.dll file. The application calls the strncpy function. When you run the application, you may receive the following error message in the Visual Studio Just-In-Time Debugger window:

Note

An unhandled win32 exception occured in 'application_name'

When you check the call stack, you may find an access violation was triggered in the Msvcr90.dll file and that the application stopped responding in the strncpy function. This problem occurs when the following conditions are true:

  • The source buffer extends to the end of an allocated page.
  • The next byte after this page does not belong to the running process.
  • The length to be copied is an even multiple of 8.
  • The length to be copied includes the final byte of the source buffer.

Cause

This problem occurs because the strncpy function tries to access the next byte after the source buffer. This issue is introduced by new optimizations to some CRT library functions.

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 Visual Studio 2008 service pack 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

You must have Visual Studio 2008 Service Pack 1 installed to apply this hotfix.

Restart requirement

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

Hotfix replacement information

This hotfix does not replace any other hotfixes.

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.

File name File version File size Date Time Platform
Atl90.dll 9.0.30729.162 159,552 14-Oct-2008 02:32 x86
Mfc90.dll 9.0.30729.162 5,084,480 14-Oct-2008 01:12 x64
Mfc90.dll 9.0.30729.162 3,766,080 14-Oct-2008 02:32 x86
Mfc90chs.dll 9.0.30729.162 36,680 14-Oct-2008 01:12 x64
Mfc90chs.dll 9.0.30729.162 36,680 14-Oct-2008 02:32 x86
Mfc90cht.dll 9.0.30729.162 37,704 14-Oct-2008 01:12 x64
Mfc90cht.dll 9.0.30729.162 37,704 14-Oct-2008 02:32 x86
Mfc90d.dll 9.0.30729.162 7,419,200 14-Oct-2008 01:12 x64
Mfc90d.dll 9.0.30729.162 5,934,912 14-Oct-2008 02:32 x86
Mfc90deu.dll 9.0.30729.162 64,328 14-Oct-2008 01:12 x64
Mfc90deu.dll 9.0.30729.162 64,328 14-Oct-2008 02:32 x86
Mfc90enu.dll 9.0.30729.162 54,600 14-Oct-2008 01:12 x64
Mfc90enu.dll 9.0.30729.162 54,600 14-Oct-2008 02:32 x86
Mfc90esn.dll 9.0.30729.162 62,792 14-Oct-2008 01:12 x64
Mfc90esn.dll 9.0.30729.162 62,792 14-Oct-2008 02:32 x86
Mfc90esp.dll 9.0.30729.162 62,792 14-Oct-2008 01:12 x64
Mfc90esp.dll 9.0.30729.162 62,792 14-Oct-2008 02:32 x86
Mfc90fra.dll 9.0.30729.162 63,816 14-Oct-2008 01:12 x64
Mfc90fra.dll 9.0.30729.162 63,816 14-Oct-2008 02:32 x86
Mfc90ita.dll 9.0.30729.162 62,280 14-Oct-2008 01:12 x64
Mfc90ita.dll 9.0.30729.162 62,280 14-Oct-2008 02:32 x86
Mfc90jpn.dll 9.0.30729.162 44,360 14-Oct-2008 01:12 x64
Mfc90jpn.dll 9.0.30729.162 44,360 14-Oct-2008 02:32 x86
Mfc90kor.dll 9.0.30729.162 43,848 14-Oct-2008 01:12 x64
Mfc90kor.dll 9.0.30729.162 43,848 14-Oct-2008 02:32 x86
Mfc90u.dll 9.0.30729.162 5,103,424 14-Oct-2008 01:12 x64
Mfc90u.dll 9.0.30729.162 3,781,440 14-Oct-2008 02:32 x86
Mfc90ud.dll 9.0.30729.162 7,464,264 14-Oct-2008 01:12 x64
Mfc90ud.dll 9.0.30729.162 5,980,488 14-Oct-2008 02:32 x86
Mfcm90.dll 9.0.30729.162 67,072 14-Oct-2008 00:50 x64
Mfcm90.dll 9.0.30729.162 59,904 14-Oct-2008 00:20 x86
Mfcm90d.dll 9.0.30729.162 93,184 14-Oct-2008 00:50 x64
Mfcm90d.dll 9.0.30729.162 80,896 14-Oct-2008 00:20 x86
Mfcm90u.dll 9.0.30729.162 67,072 14-Oct-2008 00:50 x64
Mfcm90u.dll 9.0.30729.162 59,904 14-Oct-2008 00:20 x86
Mfcm90ud.dll 9.0.30729.162 93,696 14-Oct-2008 00:50 x64
Mfcm90ud.dll 9.0.30729.162 80,896 14-Oct-2008 00:20 x86
Mfcmifc80u.dll 9.0.30729.162 14,152 20-Oct-2008 17:19 x86
Microsoft.visualc.stlclr.dll 9.0.30729.162 49,000 20-Oct-2008 17:19 x86
Msvcm90.dll 9.0.30729.162 225,280 13-Oct-2008 21:59 x86
Msvcm90.dll 9.0.30729.162 324,096 13-Oct-2008 22:36 IA-64
Msvcm90.dll 9.0.30729.162 245,760 13-Oct-2008 23:40 x64
Msvcm90d.dll 9.0.30729.162 312,832 13-Oct-2008 21:59 x86
Msvcm90d.dll 9.0.30729.162 429,568 13-Oct-2008 22:37 IA-64
Msvcm90d.dll 9.0.30729.162 333,312 13-Oct-2008 23:40 x64
Msvcp90.dll 9.0.30729.162 1,467,208 14-Oct-2008 00:56 IA-64
Msvcp90.dll 9.0.30729.162 854,344 14-Oct-2008 01:12 x64
Msvcp90.dll 9.0.30729.162 570,696 14-Oct-2008 02:32 x86
Msvcp90d.dll 9.0.30729.162 2,514,760 14-Oct-2008 00:56 IA-64
Msvcp90d.dll 9.0.30729.162 1,121,608 14-Oct-2008 01:12 x64
Msvcp90d.dll 9.0.30729.162 873,288 14-Oct-2008 02:32 x86
Msvcr90.dll 9.0.30729.162 1,504,584 14-Oct-2008 00:56 IA-64
Msvcr90.dll 9.0.30729.162 624,456 14-Oct-2008 01:12 x64
Msvcr90.dll 9.0.30729.162 653,640 14-Oct-2008 02:32 x86
Msvcr90d.dll 9.0.30729.162 3,599,688 14-Oct-2008 00:56 IA-64
Msvcr90d.dll 9.0.30729.162 1,349,960 14-Oct-2008 01:12 x64
Msvcr90d.dll 9.0.30729.162 1,178,440 14-Oct-2008 02:32 x86
Vcomp90.dll 9.0.30729.162 142,664 14-Oct-2008 00:56 IA-64
Vcomp90.dll 9.0.30729.162 57,672 14-Oct-2008 01:12 x64
Vcomp90.dll 9.0.30729.162 52,040 14-Oct-2008 02:32 x86
Vcomp90d.dll 9.0.30729.162 317,256 14-Oct-2008 00:56 IA-64
Vcomp90d.dll 9.0.30729.162 105,800 14-Oct-2008 01:12 x64
Vcomp90d.dll 9.0.30729.162 89,416 14-Oct-2008 02:32 x86
Vcomp90ui.dll 9.0.30729.162 11,592 20-Oct-2008 17:19 x86
Vcredist_ia64.exe 9.0.30729.162 4,712,272 14-Oct-2008 19:32 x86
Vcredist_x64.exe 9.0.30729.162 5,236,560 14-Oct-2008 19:36 x86
Vcredist_x86.exe 9.0.30729.162 4,496,208 14-Oct-2008 19:28 x86

Workaround

To work around this problem, use one of the following methods:

  • Change any of the four conditions that are described in the "Symptoms" section.

  • Replace the strncpy function with other functions that have the similar functionality, such as the memcpyfunction or the lstrcpyn function.

    Note These copy functions are slightly different. For example, the memcpy function does not end the string copy when a null byte is encountered before the indicated length.

Status

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

More Information

For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:

824684 Description of the standard terminology that is used to describe Microsoft software updates