Closed Bug 571605 Opened 10 years ago Closed 9 years ago

High CPU and freeze (sort of) with recurring setInterval functions

Categories

(Core :: General, defect, major)

x86_64
Windows 7
defect
Not set
major

Tracking

()

RESOLVED DUPLICATE of bug 335256

People

(Reporter: spansjh, Unassigned)

References

()

Details

(Keywords: hang)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; nl; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; nl; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3

When making recurring function calls to a secific function, the program freezes and has a huge CPU amount and memory keeps growing to infinity. It _is_ closable, but it still eats CPU, freezes and takes memory.

Reproducible: Always

Steps to Reproduce:
1. Make javascript function a to setInterval("b()",1);
2. Make javascript function b to setInterval("b()",1);
3. Open page.
Actual Results:  
Browser froze, CPU 25% (quad core, so that's a full core), memory kept raising to infinity and 

Expected Results:  
Catched the recurring calls and jump out of the loop so the browser doesn't freeze.

<script>
// Crash

var interval = 1;

function init(){
	setInterval("ret()",interval);
}

function ret(){
	setInterval("ret()",interval);
}

window.onload = init;
</script>
Please give a testcase in an attachment to this bug.
Attached file Crashing HTML file.
Is this what you mean?
Severity: critical → major
Keywords: hang
Version: unspecified → Trunk
Not a crash, but that is a hang, and I see it with Mozilla/5.0 (Windows; U; Windows NT 6.1; WOW64; en-US; rv:1.9.3a6pre) Gecko/20100611 Minefield/3.7a6pre
Status: UNCONFIRMED → NEW
Ever confirmed: true
Yes, sorry, I didn't exactly know how to call it.
The problem is that this isn't a loop.  It's just exponential growth in the number of interval timers set.  There are existing bugs on this...
Whiteboard: DUPEME
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 335256
Whiteboard: DUPEME
You need to log in before you can comment on or make changes to this bug.