Microsoft KB Archive/920978

= FIX: You may receive an &quot;Access violation C0000005&quot; error message when .NET Framework 1.1 application calls a function that contains more than eight hierarchical nested objects =

Article ID: 920978

Article Last Modified on 12/3/2007

-

APPLIES TO


 * Microsoft .NET Framework 1.1 Service Pack 1

-





SYMPTOMS
When a Microsoft .NET Framework 1.1 application calls a function that contains more than eight hierarchical nested objects, the common language runtime (CLR) may fail, and you may receive an &quot;Access Violation C0000005&quot; error message during garbage collection. This behavior indicates that the managed heap is corrupted. Typically, this problem occurs when the PInvoke method is used incorrectly. Additionally, this problem occurs in a heavy load environment.



CAUSE
This problem occurs because a value in the register is changed but cannot be restored when the .NET Framework 1.1 application calls a function that contains very complex hierarchical nested objects. The corruption is caused by an error in the just-in-time (JIT) complier. The code that the JIT compiler generates does not safeguard the register when the register is not changed.



Service pack information
To resolve this problem, obtain the latest service pack for Windows Server 2003. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

889100 How to obtain the latest service pack for Windows Server 2003

Hotfix information
A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that this article describes. Apply it only to systems that are experiencing this specific problem.

Note You must have a Visual Studio license agreement to obtain this hotfix.

To resolve this problem, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product 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
Because of file dependencies, this hotfix requires the Microsoft .NET Framework 1.1 Service Pack 1 (SP1).

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.



WORKAROUND
To work around this problem, use an intermediate variable instead of complex nested objects.

For example, change code example A to code example B as follows:

Code example A ObjA.ObjB.ObjC.ObjD.ObjE.ObjF.ObjG.ObjH.ObjI.MyMethod; Code example B ObjFType TempObjF = ObjA.ObjB.ObjC.ObjD.ObjE.ObjF; TempObjF.ObjG.ObjH.ObjI.MyMethod;



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section. This problem was first corrected in Windows Server 2003 Service Pack 2.



MORE INFORMATION
For more information, 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

