Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FIX: The fmod function returns an indeterminate (IND) value instead of the expected floating-point value in a 64-bit Visual C++ 2008 SP1 application


Symptoms

Consider the following scenario:
  • You run a 64-bit Microsoft Visual C++ 2008 Service Pack 1 (SP1) application.
  • The application is linked with floating-point modules that are written in assembly code, or that are built with a non-Microsoft C++ compiler.
  • The application calls a floating-point function in an external module that raises an x87 exception, and then calls the Visual Studio C-Runtime fmod function.
In this scenario, the returned value of the fmod function is an indeterminate (IND) value instead of the expected floating-point value.

For example, you may encounter the problem when the following conditions are true:
  • The external module that executes floating-point code was generated by the Intel C++ compiler.
  • The external module is executed on non-Intel x64 processors, such as AMD processors or VIA processors.
Note This problem also occurs when you use the fmodf function in the same scenario.

↑ Back to the top


Cause

This problem occurs because of an issue in the assembly code in the 64-bit version of the fmod function. The function incorrectly treats some irrelevant flags as errors.

↑ Back to the top


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 website: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 the hotfix, you must have Visual Studio 2008 SP1 installed.

Restart requirement

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

Hotfix replacement information

This hotfix replaces the following hotfixes:
972497 FIX: The fmod function returns an indeterminate (IND) value instead of the correct floating-point value in an x64-bit Visual C++ 2008 application

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 x86-based versions of the Visual Studio 2008:
File nameFile versionFile sizeDateTimePlatform
Atl90.dll9.0.30729.5054176,45620-Aug-201001:06x64
Atl90.dll9.0.30729.5054416,07220-Aug-201001:15IA-64
Atl90.dll9.0.30729.5054159,04820-Aug-201002:59x86
Array16,41729-Oct-200811:55
Random83,27329-Oct-200811:55
Tuple12,37129-Oct-200811:55
Xxfunction9,84529-Oct-200811:55
Afxframeimpl.cpp56,20424-Oct-200815:03
Afxglobals.cpp34,15624-Oct-200815:03
Afxglobals.h10,14424-Oct-200815:03
Afxtoolbarimages.cpp76,66519-Aug-201016:41
Almap.dll18,73619-Aug-201022:27x86
Almap.lib17,80819-Aug-201022:27x86
Atl.lib20,01219-Aug-201022:31x86
Atl.lib21,88219-Aug-201022:49x86
Atl.lib19,25619-Aug-201023:24x86
Atlassem.h2,03719-Aug-201022:23
Atlbuild.h57219-Aug-201022:01
Atlcom.h173,18610-Aug-201022:27
Atlcomcli.h68,58911-Aug-201012:28
Atldb.h384,02919-Aug-201015:47
Atldload.lib396,14819-Aug-201022:31x86
Atldload.lib493,48019-Aug-201022:49x86
Atldload.lib429,02219-Aug-201023:24x86
Atlhost.h77,91310-Aug-201019:50
Atls.lib1,413,00619-Aug-201022:31x86
Atls.lib1,354,52619-Aug-201022:49x86
Atls.lib1,114,53619-Aug-201023:24x86
Atlsd.lib1,784,14419-Aug-201022:31x86
Atlsd.lib2,031,79819-Aug-201022:49x86
Atlsd.lib1,605,96019-Aug-201023:24x86
Bardock.cpp25,37230-Aug-201009:15
Comdef.h8,73112-Aug-201015:14
Complex.1.7417.cn.ln33,62812-Aug-201015:14
Complex.7294.cn.ln32,10512-Aug-201017:54
Crtassem.h95119-Aug-201022:22x86
Crtassem.h1,29819-Aug-201022:23
Crtdefs.h107,91919-Aug-201022:23
Crtdefs.h97,32712-Aug-201017:54x86
Dbgheap.c.4074.cn.ln105,74819-Aug-201022:23
Deque.1.7431.cn.ln39,24712-Aug-201015:14
Deque.7308.cn.ln39,24712-Aug-201017:54
Fctional.1.7437.cn.ln35,12012-Aug-201015:14
Fctional.7314.cn.ln35,12012-Aug-201017:54
Hash.map.1.13876.cn.ln9,46212-Aug-201015:14
Hash.map.9791.cn.ln9,46212-Aug-201017:54
Hash.set.1.13877.cn.ln8,18312-Aug-201015:14
Hash.set.9792.cn.ln8,18312-Aug-201017:54
Intrin.h89,12912-Aug-201017:54x86
Intrin.h91,68319-Aug-201022:23
Iosfwd.1.7447.cn.ln30,41312-Aug-201015:14
Iosfwd.7324.cn.ln24,92612-Aug-201017:54
Istream.1.7451.cn.ln35,06412-Aug-201019:36
Istream.7328.cn.ln32,66012-Aug-201019:37
Libcmt.lib9,217,40819-Aug-201022:31x86
Libcmt.lib12,760,90819-Aug-201022:43x86
Libcmt.lib10,007,01219-Aug-201023:24x86
Libcmtd.lib11,361,33019-Aug-201022:31x86
Libcmtd.lib16,469,32419-Aug-201022:44x86
Libcmtd.lib12,749,53619-Aug-201023:24x86
Libcpmt.lib5,349,92819-Aug-201022:31x86
Libcpmt.lib8,755,30419-Aug-201022:45x86
Libcpmt.lib6,963,46219-Aug-201023:24x86
Libcpmtd.lib6,781,27019-Aug-201022:31x86
Libcpmtd.lib11,714,09019-Aug-201022:45x86
Libcpmtd.lib9,299,51819-Aug-201023:24x86
Mfc90.lib5,196,14819-Aug-201023:52x64
Mfc90.lib5,197,22419-Aug-201023:16x86
Mfc90d.lib6,026,79219-Aug-201023:53x64
Mfc90d.lib6,017,75619-Aug-201023:16x86
Mfc90u.lib6,501,18619-Aug-201023:53x64
Mfc90u.lib6,595,79219-Aug-201023:17x86
Mfc90ud.lib7,541,86219-Aug-201023:53x64
Mfc90ud.lib7,622,20619-Aug-201023:17x86
Mfc.bsc18,705,40820-Aug-201000:53
Mfc_loc.manifest5,88220-Aug-201003:03x86
Mfcassem.h3,14319-Aug-201022:54
Mfcdload.lib780,35419-Aug-201023:50x86
Mfcm90.lib43,10419-Aug-201023:54x64
Mfcm90.lib41,05219-Aug-201023:18x86
Mfcm90d.lib46,18219-Aug-201023:54x64
Mfcm90d.lib44,59619-Aug-201023:18x86
Mfcm90u.lib44,54819-Aug-201023:54x64
Mfcm90u.lib42,46019-Aug-201023:18x86
Mfcm90ud.lib47,64019-Aug-201023:54x64
Mfcm90ud.lib46,01419-Aug-201023:18x86
Mfcs90.lib1,054,70619-Aug-201023:50x86
Mfcs90.lib1,048,94419-Aug-201023:14x86
Mfcs90d.lib1,049,10819-Aug-201023:50x64
Mfcs90d.lib1,020,31219-Aug-201023:14x86
Mfcs90u.lib1,068,31019-Aug-201023:51x64
Mfcs90u.lib1,063,03019-Aug-201023:15x86
Mfcs90ud.lib1,065,49619-Aug-201023:51x86
Mfcs90ud.lib1,035,73019-Aug-201023:14x86
Microsoft.vc90.atl.manifest85820-Aug-201001:10x64
Microsoft.vc90.atl.manifest85720-Aug-201001:20IA-64
Microsoft.vc90.atl.manifest85620-Aug-201003:03x86
Microsoft_vc90_atl_x86_ia64.msm229,88820-Aug-201011:29IA-64
Microsoft_vc90_atl_x86.msm150,52820-Aug-201009:54x86
Microsoft_vc90_atl_x86_x64.msm151,55220-Aug-201010:45x64
Microsoft.vc90.crt.manifest1,86220-Aug-201001:10x64
Microsoft.vc90.crt.manifest1,86120-Aug-201001:20IA-64
Microsoft.vc90.crt.manifest1,86020-Aug-201003:03x86
Microsoft_vc90_crt_x86_ia64.msm1,041,40820-Aug-201011:24IA-64
Microsoft_vc90_crt_x86.msm614,91220-Aug-201009:18x86
Microsoft_vc90_crt_x86_x64.msm648,19220-Aug-201010:39x64
Microsoft.vc90.debugcrt.manifest1,87020-Aug-201001:10x64
Microsoft.vc90.debugcrt.manifest1,86920-Aug-201001:20IA-64
Microsoft.vc90.debugcrt.manifest1,86820-Aug-201003:03x86
Microsoft_vc90_debugcrt_x86_ia64.msm1,811,45620-Aug-201011:19IA-64
Microsoft_vc90_debugcrt_x86.msm839,16820-Aug-201009:12x86
Microsoft_vc90_debugcrt_x86_x64.msm844,28820-Aug-201010:34x64
Microsoft.vc90.debugmfc.manifest2,36820-Aug-201001:10x64
Microsoft.vc90.debugmfc.manifest2,36620-Aug-201003:03x86
Microsoft_vc90_debugmfc_x86_ia64.msm4,759,04007-Nov-200705:58IA-64
Microsoft_vc90_debugmfc_x86.msm5,569,02420-Aug-201009:39x86
Microsoft_vc90_debugmfc_x86_x64.msm5,985,79220-Aug-201010:24x64
Microsoft.vc90.debugopenmp.manifest86720-Aug-201003:03x86
Microsoft.vc90.debugopenmp.manifest86820-Aug-201001:20x86
Microsoft.vc90.debugopenmp.manifest86920-Aug-201001:10x86
Microsoft_vc90_debugopenmp_x86_ia64.msm157,69620-Aug-201010:50IA-64
Microsoft_vc90_debugopenmp_x86.msm108,54420-Aug-201009:23x86
Microsoft_vc90_debugopenmp_x86_x64.msm107,52020-Aug-201009:59x64
Microsoft.vc90.mfc.manifest2,35920-Aug-201001:10x64
Microsoft.vc90.mfc.manifest2,35720-Aug-201003:03x86
Microsoft_vc90_mfc_x86_ia64.msm2,600,96007-Nov-200706:10IA-64
Microsoft_vc90_mfc_x86.msm4,188,16020-Aug-201009:46x86
Microsoft_vc90_mfc_x86_x64.msm4,883,45620-Aug-201010:29x64
Microsoft.vc90.mfcloc.manifest5,88420-Aug-201001:10x64
Microsoft.vc90.mfcloc.manifest5,88220-Aug-201003:03x86
Microsoft_vc90_mfcloc_x86_ia64.msm242,17607-Nov-200706:18IA-64
Microsoft_vc90_mfcloc_x86.msm259,07220-Aug-201009:33x86
Microsoft_vc90_mfcloc_x86_x64.msm257,02420-Aug-201010:18x64
Microsoft.vc90.openmp.manifest86120-Aug-201003:03x86
Microsoft.vc90.openmp.manifest86220-Aug-201001:20x86
Microsoft.vc90.openmp.manifest86320-Aug-201001:10x86
Microsoft_vc90_openmp_x86_ia64.msm124,41620-Aug-201010:55IA-64
Microsoft_vc90_openmp_x86.msm98,30420-Aug-201009:28x86
Microsoft_vc90_openmp_x86_x64.msm98,81620-Aug-201010:13x64
Msvcmrt.lib1,529,80819-Aug-201022:31x86
Msvcmrt.lib1,697,61219-Aug-201023:24x86
Msvcmrt.lib1,846,52619-Aug-201022:46x86
Msvcmrtd.lib1,625,96019-Aug-201022:31x86
Msvcmrtd.lib1,804,92619-Aug-201023:24x86
Msvcmrtd.lib1,956,88219-Aug-201022:47x86
Msvcprt.lib1,654,51619-Aug-201022:31x86
Msvcprt.lib2,140,98619-Aug-201022:45x86
Msvcprt.lib1,686,81819-Aug-201023:24x86
Msvcprtd.lib1,827,18619-Aug-201022:31x86
Msvcprtd.lib2,369,33219-Aug-201022:45x86
Msvcprtd.lib1,860,04019-Aug-201023:24x86
Msvcrt.lib1,360,06819-Aug-201022:31x86
Msvcrt.lib1,585,29619-Aug-201022:44x86
Msvcrt.lib1,357,32219-Aug-201023:24x86
Msvcrtd.lib1,392,99019-Aug-201022:31x86
Msvcrtd.lib1,642,42819-Aug-201022:44x86
Msvcrtd.lib1,400,23419-Aug-201023:24x86
Msvcurt.lib15,375,46619-Aug-201022:31x86
Msvcurt.lib15,737,14819-Aug-201023:24x86
Msvcurt.lib15,882,48219-Aug-201022:46x86
Msvcurtd.lib16,952,22619-Aug-201022:31x86
Msvcurtd.lib17,303,53819-Aug-201023:24x86
Msvcurtd.lib17,454,85219-Aug-201022:47x86
Nafxcw.lib49,963,83619-Aug-201023:17x86
Nafxcw.lib59,306,38819-Aug-201023:53x86
Nafxcwd.lib52,949,40019-Aug-201023:16x86
Nafxcwd.lib66,787,59219-Aug-201023:53x86
Nmmintrin.h4,09119-Aug-201022:23x86
Nmmintrin.h3,96712-Aug-201017:54
Ompassem.h95119-Aug-201022:56
Ptrustm.lib426,51819-Aug-201022:31x86
Ptrustmd.lib433,69019-Aug-201022:31x86
Ptrustu.lib426,51819-Aug-201022:31x86
Ptrustud.lib433,69019-Aug-201022:31x86
Sdknames.lib7,46219-Aug-201022:27x86
Sstream.1.7482.cn.ln17,72012-Aug-201015:14
Sstream.7358.cn.ln16,68512-Aug-201017:54
Stat64.c.4424.cn.ln11,10619-Aug-201022:23
Stat.c.4423.cn.ln12,72619-Aug-201022:23
Tcmap.lib29,67619-Aug-201022:27x86
Tcmapdll.lib32,05819-Aug-201022:27x86
Uafxcw.lib50,880,30019-Aug-201023:17x86
Uafxcw.lib60,097,30619-Aug-201023:54x86
Uafxcwd.lib54,310,59419-Aug-201023:17x86
Uafxcwd.lib68,073,04019-Aug-201023:53x86
Mfc90.dll9.0.30729.50545,083,46420-Aug-201001:06x64
Mfc90.dll9.0.30729.50543,765,06420-Aug-201002:59x86
Mfc90chs.dll9.0.30729.505435,66420-Aug-201001:06x64
Mfc90chs.dll9.0.30729.505435,66420-Aug-201002:59x86
Mfc90cht.dll9.0.30729.505436,68820-Aug-201001:06x64
Mfc90cht.dll9.0.30729.505436,68820-Aug-201002:59x86
Mfc90d.dll9.0.30729.50547,418,18420-Aug-201001:06x64
Mfc90d.dll9.0.30729.50545,933,89620-Aug-201002:59x86
Mfc90deu.dll9.0.30729.505463,31220-Aug-201001:06x64
Mfc90deu.dll9.0.30729.505463,31220-Aug-201002:59x86
Mfc90enu.dll9.0.30729.505453,58420-Aug-201001:06x64
Mfc90enu.dll9.0.30729.505453,58420-Aug-201002:59x86
Mfc90esn.dll9.0.30729.505461,77620-Aug-201001:06x64
Mfc90esn.dll9.0.30729.505461,77620-Aug-201002:59x86
Mfc90esp.dll9.0.30729.505461,77620-Aug-201001:06x64
Mfc90esp.dll9.0.30729.505461,77620-Aug-201002:59x86
Mfc90fra.dll9.0.30729.505462,80020-Aug-201001:06x64
Mfc90fra.dll9.0.30729.505462,80020-Aug-201002:59x86
Mfc90ita.dll9.0.30729.505461,26420-Aug-201001:06x64
Mfc90ita.dll9.0.30729.505461,26420-Aug-201002:59x86
Mfc90jpn.dll9.0.30729.505443,34420-Aug-201001:06x64
Mfc90jpn.dll9.0.30729.505443,34420-Aug-201002:59x86
Mfc90kor.dll9.0.30729.505442,83220-Aug-201001:06x64
Mfc90kor.dll9.0.30729.505442,83220-Aug-201002:59x86
Mfc90rus.dll9.0.30729.505459,72820-Aug-201001:06x64
Mfc90rus.dll9.0.30729.505459,72820-Aug-201002:59x86
Mfc90u.dll9.0.30729.50545,102,40820-Aug-201001:06x64
Mfc90u.dll9.0.30729.50543,780,42420-Aug-201002:59x86
Mfc90ud.dll9.0.30729.50547,463,24820-Aug-201001:06x64
Mfc90ud.dll9.0.30729.50545,979,47220-Aug-201002:59x86
Mfcm90.dll9.0.30729.505467,07220-Aug-201001:06x64
Mfcm90.dll9.0.30729.505459,90420-Aug-201003:00x86
Mfcm90d.dll9.0.30729.505493,18420-Aug-201001:06x64
Mfcm90d.dll9.0.30729.505480,89620-Aug-201003:00x86
Mfcm90u.dll9.0.30729.505467,07220-Aug-201001:06x64
Mfcm90u.dll9.0.30729.505459,90420-Aug-201003:00x86
Mfcm90ud.dll9.0.30729.505493,69620-Aug-201001:06x64
Mfcm90ud.dll9.0.30729.505480,89620-Aug-201003:00x86
Mfcmifc80u.dll9.0.30729.505413,13620-Aug-201023:00x86
Microsoft.visualc.stlclr.dll9.0.30729.505447,98420-Aug-201023:00x86
Msvcm90.dll9.0.30729.5054245,76020-Aug-201001:06x64
Msvcm90.dll9.0.30729.5054324,09620-Aug-201001:15IA-64
Msvcm90.dll9.0.30729.5054225,28020-Aug-201003:00x86
Msvcm90d.dll9.0.30729.5054333,31220-Aug-201001:06x64
Msvcm90d.dll9.0.30729.5054429,56820-Aug-201001:15IA-64
Msvcm90d.dll9.0.30729.5054312,83220-Aug-201003:00x86
Msvcp90.dll9.0.30729.5054853,32820-Aug-201001:06x64
Msvcp90.dll9.0.30729.50541,466,19220-Aug-201001:15IA-64
Msvcp90.dll9.0.30729.5054569,68020-Aug-201002:59x86
Msvcp90d.dll9.0.30729.50541,120,59220-Aug-201001:06x64
Msvcp90d.dll9.0.30729.50542,515,28020-Aug-201001:15IA-64
Msvcp90d.dll9.0.30729.5054871,76020-Aug-201002:59x86
Msvcr90.dll9.0.30729.5054624,46420-Aug-201001:06x64
Msvcr90.dll9.0.30729.50541,505,61620-Aug-201001:15IA-64
Msvcr90.dll9.0.30729.5054653,13620-Aug-201002:59x86
Msvcr90d.dll9.0.30729.50541,350,48020-Aug-201001:06x64
Msvcr90d.dll9.0.30729.50543,603,28020-Aug-201001:15IA-64
Msvcr90d.dll9.0.30729.50541,178,44820-Aug-201002:59x86

↑ Back to the top


Workaround

To work around this problem, assemble a wrapper function that calls an fnclex instruction before the wrapper function calls the fmod function. The following code is an example of how to assemble the wrapper function:
public  <Function Name> <Function Name>  proc     fnclex     call fmod     ret <Function Name>  endp 

↑ Back to the top


Status

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

↑ Back to the top


Keywords: kbnotautohotfix, kbhotfixdev, kbqfe, kbfix, kbhotfixserver, kbexpertiseadvanced, kbsurveynew, kb

↑ Back to the top

Article Info
Article ID : 982107
Revision : 2
Created on : 9/18/2018
Published on : 9/18/2018
Exists online : False
Views : 108