title: My website keeps crashing IE, can't debug
body: <p>I have a website that suddenly started to crash internet explorer.</p>
  
  <p>The website loads and starts executing javascript but somewhere in there the machinery explodes. I don't even get a script error, it just crashes. I've tried to manually step through every single line of js with the built in debugger but then of course the problem doesn't occur.</p>
  
  <p>If i choose to debug the application when it crashes i see the following message.</p>
  
  <p>Unhandled exception at 0x6c5dedf5 in iexplore.exe: 0xC0000005: Access violation reading location 0x00000090.</p>
  
  <p>The top 5 items in the call stack looks like this</p>
  
  <blockquote>
    <p>VGX.dll!6c5dedf5()<br>
        [Frames below may be incorrect and/or missing, no symbols loaded for VGX.dll]<br>
        VGX.dll!6c594d70()<br>
        VGX.dll!6c594f63()<br>
        VGX.dll!6c595350()<br>
        VGX.dll!6c58f5e3()<br>
        mshtml.dll!6f88dd17()   </p>
  </blockquote>
  
  <p>VGX.dll seems to be part of the vml renderer and i am in fact using VML. I'm not suprised because i've had so many problems with vml, attributes has to be set in specific order, sometimes you cant set attributes when you have elements attached to the dom or vice versa (everything undocumented btw) but then the problems can usually be reproduced when debugging but not now :(</p>
  
  <p>The problem also occurs in no plugin-mode.</p>
  
  <p>Is there a better approach than trial and error to solve this?</p>
  
  <p><strong>Edit:</strong>
  Adding a console outputting every suspect modification to the DOM made the problem only occur sometimes. (the console is also implemented in javascript on the same page, i'm able to see the output even after a crash as the window is still visible) Apparently it seems to be some kind of race condition.</p>
  
  <p>I managed to track it down even further, and it seems to occur when you remove an object from the DOM too quickly after it's just been added. (most likely only for vml-elements with some special attribute, didn't try further) And it can't be fixed by adding a dead loop in front of removeChild(pretty bad solution anyway), the page has to be rendered by the browser once after the addChild before you can call removeChild.  sigh</p>