FIX: On a computer that is running the .NET Framework 3.5 Service Pack 1, the JIT compiler and the Native Image Generator (Ngen.exe) that use the Mscorjit.dll file may generate incorrect code
On a computer that is running the Microsoft .NET Framework 3.5 Service Pack 1 (SP1), the just-in-time (JIT) compiler and the Native Image Generator (Ngen.exe) that use the Mscorjit.dll file may generate incorrect code. Therefore, a 32-bit Managed C++ application may produce incorrect results.
This problem occurs if the following conditions are true:
The struct or the class in the source code has less than four scalar varieties and no managed object references.
You use the Cpblk instruction or the Initblk instruction.
Note This problem does not occur in a 64-bit application.
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 this specific problem. 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.
To download this hotfix from the MSDN Code Gallery, visit the following Microsoft Web site:
Note The MSDN Code Gallery displays the languages for which the hotfix is available. If you do not see your language listed, it is because the Code Gallery resource page is not available for that language.
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 If you have a 32-bit application that runs on a 64-bit platform, apply the hotfix for the 64-bit version to resolve this problem.
Prerequisites
You must have the .NET Framework 3.5 SP1 installed to apply this hotfix.
Restart requirement
You may have to restart the computer if any of the files that are updated are being used.
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.
Windows 2000, Windows XP, and Windows Server 2003, x86 versions
Collapse this tableExpand this table
File name
File version
File size
Date
Time
Mscordacwks.dll
2.0.50727.3068
992,264
16-Sep-2008
13:13
Mscorjit.dll
2.0.50727.3068
367,104
16-Sep-2008
13:13
Mscorlib.dll
2.0.50727.3068
4,546,560
16-Sep-2008
13:13
Mscorwks.dll
2.0.50727.3068
5,815,808
16-Sep-2008
13:13
Windows 2000, Windows XP, and Windows Server 2003, x64 versions
Collapse this tableExpand this table
File name
File version
File size
Date
Time
Platform
Mscordacwks.dll
2.0.50727.3068
992,264
16-Sep-2008
13:13
x86
Mscorjit.dll
2.0.50727.3068
367,104
16-Sep-2008
13:13
x86
Mscorlib.dll
2.0.50727.3068
4,546,560
16-Sep-2008
13:13
x86
Mscorwks.dll
2.0.50727.3068
5,815,808
16-Sep-2008
13:13
x86
Mscordacwks.dll
2.0.50727.3068
1,767,944
16-Sep-2008
10:33
x64
Mscorjit.dll
2.0.50727.3068
1,580,032
16-Sep-2008
10:33
x64
Mscorlib.dll
2.0.50727.3068
4,562,944
16-Sep-2008
10:33
x64
Mscorwks.dll
2.0.50727.3068
10,079,744
16-Sep-2008
10:33
x64
Windows 2000, Windows XP, and Windows Server 2003, IA-64 versions
Collapse this tableExpand this table
File name
File version
File size
Date
Time
Platform
Mscordacwks.dll
2.0.50727.3068
992,264
16-Sep-2008
13:13
x86
Mscorjit.dll
2.0.50727.3068
367,104
16-Sep-2008
13:13
x86
Mscorlib.dll
2.0.50727.3068
4,546,560
16-Sep-2008
13:13
x86
Mscorwks.dll
2.0.50727.3068
5,815,808
16-Sep-2008
13:13
x86
Mscordacwks.dll
2.0.50727.3068
3,087,880
16-Sep-2008
10:44
IA-64
Mscorjit.dll
2.0.50727.3068
2,560,512
16-Sep-2008
10:44
IA-64
Mscorlib.dll
2.0.50727.3068
4,005,888
16-Sep-2008
10:44
IA-64
Mscorwks.dll
2.0.50727.3068
20,153,856
16-Sep-2008
10:44
IA-64
Windows Vista Service Pack 1 (SP1) and Windows Server 2008, x86 versions
Collapse this tableExpand this table
File name
File version
File size
Date
Time
Platform
Mscorlib.resources.dll
2.0.50727.3053
352,256
15-Sep-2008
22:25
x86
Mscorlib.resources.dll
2.0.50727.3053
303,104
15-Sep-2008
22:25
x86
Mscorlib.resources.dll
2.0.50727.3053
299,008
15-Sep-2008
22:25
x86
Mscorlib.resources.dll
2.0.50727.3053
315,392
27-Jul-2008
17:58
x86
Mscorlib.resources.dll
2.0.50727.3053
425,984
15-Sep-2008
22:25
x86
Mscorlib.resources.dll
2.0.50727.3053
307,200
27-Jul-2008
17:58
x86
Mscorlib.resources.dll
2.0.50727.3053
299,008
15-Sep-2008
22:25
x86
Mscorlib.resources.dll
2.0.50727.3053
311,296
27-Jul-2008
17:58
x86
Mscorlib.resources.dll
2.0.50727.3053
331,776
15-Sep-2008
22:25
x86
Mscorlib.resources.dll
2.0.50727.3053
315,392
15-Sep-2008
22:25
x86
Mscorlib.resources.dll
2.0.50727.3053
307,200
27-Jul-2008
17:55
x86
Mscorlib.resources.dll
2.0.50727.3053
348,160
27-Jul-2008
17:58
x86
Mscorlib.resources.dll
2.0.50727.3053
319,488
27-Jul-2008
17:55
x86
Mscorlib.resources.dll
2.0.50727.3053
290,816
15-Sep-2008
22:25
x86
Mscorlib.resources.dll
2.0.50727.3053
303,104
15-Sep-2008
22:25
x86
Mscorlib.resources.dll
2.0.50727.3053
311,296
15-Sep-2008
22:25
x86
Mscorlib.resources.dll
2.0.50727.3053
303,104
27-Jul-2008
17:55
x86
Mscorlib.resources.dll
2.0.50727.3053
307,200
15-Sep-2008
22:25
x86
Mscorlib.resources.dll
2.0.50727.1434
397,312
11-Jan-2008
22:59
x86
Mscorlib.resources.dll
2.0.50727.3053
299,008
15-Sep-2008
22:25
x86
Mscorlib.resources.dll
2.0.50727.3053
299,008
15-Sep-2008
22:25
x86
Mscorlib.resources.dll
2.0.50727.3053
278,528
27-Jul-2008
17:55
x86
Mscorlib.resources.dll
2.0.50727.3053
278,528
27-Jul-2008
17:55
x86
Big5.nlp
Not Applicable
66,728
18-Dec-2007
21:03
Not Applicable
Bopomofo.nlp
Not Applicable
82,172
18-Dec-2007
21:03
Not Applicable
Ksc.nlp
Not Applicable
116,756
18-Dec-2007
21:04
Not Applicable
Mscorlib.dll
2.0.50727.3068
4,546,560
01-Oct-2008
22:27
x86
Normidna.nlp
Not Applicable
59,342
18-Dec-2007
21:05
Not Applicable
Normnfc.nlp
Not Applicable
45,794
18-Dec-2007
21:05
Not Applicable
Normnfd.nlp
Not Applicable
39,284
18-Dec-2007
21:05
Not Applicable
Normnfkc.nlp
Not Applicable
66,384
18-Dec-2007
21:05
Not Applicable
Normnfkd.nlp
Not Applicable
60,294
18-Dec-2007
21:05
Not Applicable
Prc.nlp
Not Applicable
83,748
18-Dec-2007
21:05
Not Applicable
Prcp.nlp
Not Applicable
83,748
18-Dec-2007
21:05
Not Applicable
Sortkey.nlp
Not Applicable
262,148
18-Dec-2007
21:05
Not Applicable
Sorttbls.nlp
Not Applicable
20,320
18-Dec-2007
21:05
Not Applicable
Xjis.nlp
Not Applicable
28,288
18-Dec-2007
21:05
Not Applicable
Mscordacwks.dll
2.0.50727.3068
992,264
01-Oct-2008
22:27
x86
Mscorjit.dll
2.0.50727.3068
367,104
24-Sep-2008
22:21
x86
Mscorwks.dll
2.0.50727.3068
5,815,808
01-Oct-2008
22:27
x86
Windows Vista SP1 and Windows Server 2008, x64 versions
Collapse this tableExpand this table
File name
File version
File size
Date
Time
Platform
Big5.nlp
Not Applicable
66,728
18-Dec-2007
21:01
Not Applicable
Bopomofo.nlp
Not Applicable
82,172
18-Dec-2007
21:01
Not Applicable
Ksc.nlp
Not Applicable
116,756
18-Dec-2007
21:02
Not Applicable
Mscorlib.dll
2.0.50727.3068
4,562,944
01-Oct-2008
22:25
x64
Normidna.nlp
Not Applicable
59,342
18-Dec-2007
21:03
Not Applicable
Normnfc.nlp
Not Applicable
45,794
18-Dec-2007
21:03
Not Applicable
Normnfd.nlp
Not Applicable
39,284
18-Dec-2007
21:03
Not Applicable
Normnfkc.nlp
Not Applicable
66,384
18-Dec-2007
21:03
Not Applicable
Normnfkd.nlp
Not Applicable
60,294
18-Dec-2007
21:03
Not Applicable
Prc.nlp
Not Applicable
83,748
18-Dec-2007
21:03
Not Applicable
Prcp.nlp
Not Applicable
83,748
18-Dec-2007
21:03
Not Applicable
Sortkey.nlp
Not Applicable
262,148
18-Dec-2007
21:03
Not Applicable
Sorttbls.nlp
Not Applicable
20,320
18-Dec-2007
21:03
Not Applicable
Xjis.nlp
Not Applicable
28,288
18-Dec-2007
21:03
Not Applicable
Mscordacwks.dll
2.0.50727.3068
1,767,944
01-Oct-2008
22:25
x64
Mscorjit.dll
2.0.50727.3068
1,580,032
24-Sep-2008
23:06
x64
Mscorwks.dll
2.0.50727.3068
10,079,744
01-Oct-2008
22:25
x64
Mscorlib.resources.dll
2.0.50727.3053
352,256
15-Sep-2008
22:26
x86
Mscorlib.resources.dll
2.0.50727.3053
303,104
15-Sep-2008
22:25
x86
Mscorlib.resources.dll
2.0.50727.3053
299,008
15-Sep-2008
22:26
x86
Mscorlib.resources.dll
2.0.50727.3053
315,392
27-Jul-2008
18:02
x86
Mscorlib.resources.dll
2.0.50727.3053
425,984
15-Sep-2008
22:26
x86
Mscorlib.resources.dll
2.0.50727.3053
307,200
27-Jul-2008
18:02
x86
Mscorlib.resources.dll
2.0.50727.3053
299,008
15-Sep-2008
22:26
x86
Mscorlib.resources.dll
2.0.50727.3053
311,296
27-Jul-2008
18:02
x86
Mscorlib.resources.dll
2.0.50727.3053
331,776
15-Sep-2008
22:26
x86
Mscorlib.resources.dll
2.0.50727.3053
315,392
15-Sep-2008
22:25
x86
Mscorlib.resources.dll
2.0.50727.3053
307,200
27-Jul-2008
17:56
x86
Mscorlib.resources.dll
2.0.50727.3053
348,160
27-Jul-2008
18:02
x86
Mscorlib.resources.dll
2.0.50727.3053
319,488
27-Jul-2008
17:56
x86
Mscorlib.resources.dll
2.0.50727.3053
290,816
15-Sep-2008
22:26
x86
Mscorlib.resources.dll
2.0.50727.3053
303,104
15-Sep-2008
22:25
x86
Mscorlib.resources.dll
2.0.50727.3053
311,296
15-Sep-2008
22:25
x86
Mscorlib.resources.dll
2.0.50727.3053
303,104
27-Jul-2008
17:56
x86
Mscorlib.resources.dll
2.0.50727.3053
307,200
15-Sep-2008
22:25
x86
Mscorlib.resources.dll
2.0.50727.1434
397,312
11-Jan-2008
22:59
x86
Mscorlib.resources.dll
2.0.50727.3053
299,008
15-Sep-2008
22:25
x86
Mscorlib.resources.dll
2.0.50727.3053
299,008
15-Sep-2008
22:25
x86
Mscorlib.resources.dll
2.0.50727.3053
278,528
27-Jul-2008
17:56
x86
Mscorlib.resources.dll
2.0.50727.3053
278,528
27-Jul-2008
17:56
x86
Big5.nlp
Not Applicable
66,728
18-Dec-2007
21:03
Not Applicable
Bopomofo.nlp
Not Applicable
82,172
18-Dec-2007
21:03
Not Applicable
Ksc.nlp
Not Applicable
116,756
18-Dec-2007
21:04
Not Applicable
Mscorlib.dll
2.0.50727.3068
4,546,560
01-Oct-2008
22:27
x86
Normidna.nlp
Not Applicable
59,342
18-Dec-2007
21:05
Not Applicable
Normnfc.nlp
Not Applicable
45,794
18-Dec-2007
21:05
Not Applicable
Normnfd.nlp
Not Applicable
39,284
18-Dec-2007
21:05
Not Applicable
Normnfkc.nlp
Not Applicable
66,384
18-Dec-2007
21:05
Not Applicable
Normnfkd.nlp
Not Applicable
60,294
18-Dec-2007
21:05
Not Applicable
Prc.nlp
Not Applicable
83,748
18-Dec-2007
21:05
Not Applicable
Prcp.nlp
Not Applicable
83,748
18-Dec-2007
21:05
Not Applicable
Sortkey.nlp
Not Applicable
262,148
18-Dec-2007
21:05
Not Applicable
Sorttbls.nlp
Not Applicable
20,320
18-Dec-2007
21:05
Not Applicable
Xjis.nlp
Not Applicable
28,288
18-Dec-2007
21:05
Not Applicable
Mscordacwks.dll
2.0.50727.3068
992,264
01-Oct-2008
22:27
x86
Mscorjit.dll
2.0.50727.3068
367,104
24-Sep-2008
22:21
x86
Mscorwks.dll
2.0.50727.3068
5,815,808
01-Oct-2008
22:27
x86
Windows Vista SP1 and Windows Server 2008, IA-64 versions
Name the .ini file the same as the problematic module, but use the .ini extension instead of the .dll extension. For example, for the sample code in the "More Information" section, name the .ini file the Bug.ini file. Put the Bug.ini file in the same directory as the Bug.dll file.
Note The drawback of this method is the potential performance effect for no optimizations. If you use the Native Image Generator (Ngen.exe) to precompile the module, this method is not applicable.
Method 3
Selectively apply the NoOptimization option of the MethodImplOptions enumeration to the problematic methods by using the MethodImplAttribute class.
Note This method disables the optimizations for the JIT compiler and for the Native Image Generator (Ngen.exe) on a per-method level. How much the performance is affected varies, depending on the method.
To compile the Bug.cpp file, run the following command:
cl /clr /GL /O2 bug.cpp /link /dll /out:bug.dll
Create a new Microsoft Visual C# project to be used as the client project.
Name the code file the Test.cs file, and then paste the following code in the Test.cs file.
using Geometry;
namespace Test
{
class Tester
{
static void Main()
{
Vector3d v = new Vector3d(200, 200, 0);
v = v.DivideBy(150);
System.Console.WriteLine("{0}", v);
}
}
}
To compile the Test.cs file, run the following command:
csc /r:bug.dll test.cs
To embed the manifest into the Test.exe file, run the following command: