Microsoft KB Archive/824192

= BUG: General protection fault when you make changes to XML nodes =

Article ID: 824192

Article Last Modified on 3/13/2004

-

APPLIES TO


 * Microsoft Internet Explorer (Programming) 6 (SP1)
 * Microsoft XML Parser 2.0
 * Microsoft XML Parser 2.5
 * Microsoft XML Parser 2.6
 * Microsoft XML Core Services 4.0
 * Microsoft XML Core Services 4.0

-





SYMPTOMS
When you make a change to an XML node directly in an XMLHTTP application, you receive the following general protection fault (GP fault) error message:

The instruction at  referenced memory at. The memory could not be &quot;read&quot;.

Note is the placeholder for the respective memory address.



CAUSE
When an event is raised in an XMLHTTP application, the Mshtml.dll file may destroy a node to replace the node during XML node manipulation in the event handler. Other statements may exist in the event handler in an Internet Explorer message loop that may access the XML node directly for manipulation. When the node is accessed directly, a GP fault occurs because it accesses a node that no longer exists. The node was moved by the Mshtml.dll file.



WORKAROUND
To work around this problem, avoid direct access of the node in the event handler, and include a process timer to fire the manipulation code after a short delay of 100 milliseconds.

For example, if the original call that changes the nodes is the MoveNode(item) function, create a worker function that is named MoveNode_Worker(item), and then move the code that actually handles the manipulation of the nodes to the MoveNode_Worker(item) function. In the MoveNode function, call the MoveNode_Worker(item) worker thread after 100 milliseconds by using the window.setInterval function function. interval = window.setInterval(&quot;MoveNode_Worker(item)&quot;,100);



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the &quot;Applies to&quot; section of this article.

