Novemberborn, Straight lines circle sometime

Crashing Firefox 1.0.0 in One Line of Code

I was looking at a bug report for sIFR today. It discussed how sIFR 3 crashed Firefox 1.0.0 on Windows. After the better part of the evening, here’s what I found: if you create a non-anonymous method, declare a variable inside it and set a property on the function object with the same name as the variable (and whatever value, I used null), Firefox 1.0.0 will crash after about ten seconds after loading the page. If it doesn’t, close the window and it should crash right away. It seems to be an issue in the JavaScript parser.

Here’s the code, adjusted for readability, but you bet this fits in one line!

(function nonAnonymousMethod() { 
  var aProperty;
}).aProperty = null;

In the case of sIFR, the parseSelector code contained a similar construct. Fixed now in r130.

Full testing details: Firefox 1.0.0 and Firefox 1.0.1 on Windows XP SP2 with the latest updates as of Sept 8, 2006. Firefox 1.0.0 crashes, Firefox 1.0.1 doesn’t. I therefore assume the problem will not occur in any versions later than 1.0.0. Download old Firefox versions.

link | javascript sifr3 | 8 September 2006, 22:00


Comments

  1. This is great news Mark! Glad you’ve found it. (I’d been doing some real dirty browser detection on production sites to avoid this ff bug!)

    manuel | 8 September 2006, 22:40 | link

  2. Wow, never thought that it was so easy, fortunately we don´t have to work with this version….

    Arzt | 11 November 2006, 12:23 | link

  3. I looked at the list of JavaScript bugs fixed in Firefox 1.0.1 and it is really hard to tell. However, judging by the patches 277069 should be most likely the reason here.

    Wladimir Palant | 10 January 2007, 11:39 | link

  4. Interesting, thanks Wladimir.

    Mark Wubben | 10 January 2007, 12:03 | link

Leave your comment

Please keep it polite and on topic. Yes, your e-mail address is required, but it's kept private. HTML is not allowed in the comments but you can use Markdown. Non-contributing comments run the risk of being removed. Especially if the website seem “fishy”. Spammers, beware.

(required)
(required, kept private)
(optional, but let's share it!)
(required)

Remember my details


Novemberborn: Extra

About the author

Mark Wubben is a hacker/writer in Enschede, the Netherlands.

Read more about Mark...

Go to

Jobs (NL)

Xopus zoekt programmeurs! Verbeter de code en win!

Please donate

If you like sIFR, please consider making a donation so I can spend more time on it. Thank you.

sIFR Documentation

See the documentation for sIFR 2 and sIFR 3.

Subscribe