Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JQuery & IE8 crash detection

I was recently asked to help debug an issue with a website that caused IE8 to crash under certain conditions. The company that owns the website was unable to reproduce the problem, but they were receiving many reports from affected users.

I was able to reproduce the problem, and eventually found that it was being caused by this jQuery/IE 8 issue. The problem occurs when a background image is applied to the body tag using CSS, and jQuery is loaded. A post on the jQuery bug ticket comments provided this jsFiddle example, which, for me at least, reproduces the problem consistently.

  • Go to http://fiddle.jshell.net/ZKPZq/6/ with IE8.
  • Right click in the result screen, and make it refresh - IE8 will crash

The problem I have is reproducing this reliably in a test environment. Can anyone suggest methods to test for this sort of thing? Despite copying the exact code used by the jsFiddle example, I am unable to consistently reproduce the problem locally - it may rely on particular timing, but I'm not sure. I would like to add something to the automated test suite that checks for this problem (the jQuery fix had been applied previously, and accidentally removed in a later version).

How can I test for browser crashes? The site is written in Perl, and some automated tests are carried out using Selenium and WWW::Mechanize.

Note: I considered posting this on Pro Webmasters, but having read the FAQ, I think it is more suited to SO.

like image 594
Mike Avatar asked Aug 24 '11 07:08

Mike


2 Answers

I don't think you can do anything other than run both unit tests and stress tests with as wide a variety of combinations of factors as possible.

This is the nature of so-called "Mandelbugs".

like image 175
Lightness Races in Orbit Avatar answered Sep 20 '22 18:09

Lightness Races in Orbit


Given that the only consistent thing appears to be that there's not a problem if you load JQ before the style declaration, I would try setting the JQ to load at different intervals after the CSS declaration/linked CSS file loads.

From immediately after the style is established to well after DOM ready. My guess would be that JQ references something IE8 has made accessible that it wasn't ready to share just yet as a result of something really silly going on in its DOM-loading process.

I've seen multiple incidents of developer tools crashing permanently in IE8 even after you re-open the app. If not for that I'd consider such bugs unlikely.

Edit: To be fair, JQ is probably doing something odd in 1.62 or this bug would be more well-known in general. IE8 has been out a few years now.

like image 26
Erik Reppen Avatar answered Sep 22 '22 18:09

Erik Reppen