Open Bug 410706 Opened 17 years ago Updated 3 years ago

setTimeout and setInterval stops repeating after system time date or clock changed

Categories

(Core :: DOM: Core & HTML, defect, P5)

x86
Windows XP
defect

Tracking

()

People

(Reporter: info, Unassigned)

References

()

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11 We have to timers there reflecting time in two different ways. If I change the system time, they will stop working. The function called by a setInterval statement just stops being called afterwards Reproducible: Always Steps to Reproduce: 1.Open the link 2.Change system time Actual Results: The timers stopped (setInterval sopped working) Expected Results: I was expecting the timers to keep running on every setInterval function call.
No crash involved though, right? "crash" means abnormal/abrupt termination of the Firefox process. /be
Assignee: general → nobody
Status: UNCONFIRMED → NEW
Component: JavaScript Engine → DOM: Level 0
Ever confirmed: true
QA Contact: general → general
Summary: setInterval crashes and stops after system time changed → setInterval stops repeating after system time changed
Matias, can you remove the console.log call? It is undefined in Minefield.
Note for the fix: make sure the invisible "lateness" argument provided to the called function is the correct value, too.
(In reply to comment #0) > If I change the system time, they will stop working. > The function called by a setInterval statement just stops being called afterwards Phenomenon depends on "change of system time" (far future or far ancient) and software's (Firefox in your case) implementation which relates to timer (setInterval/setTimeout when user coded JavaScript). "From what date/time to what date/time" did you change system-time? What is your "setInterval" value?
(In reply to comment #1) > No crash involved though, right? "crash" means abnormal/abrupt termination of > the Firefox process. > > /be > Correct, no crash involoved. just setInterval stops working
(In reply to comment #4) > (In reply to comment #0) > > If I change the system time, they will stop working. > > The function called by a setInterval statement just stops being called afterwards > > Phenomenon depends on "change of system time" (far future or far ancient) and > software's (Firefox in your case) implementation which relates to timer > (setInterval/setTimeout when user coded JavaScript). > "From what date/time to what date/time" did you change system-time? > What is your "setInterval" value? > Any time change on windows XP will cause the setInterval to stop, when clicking on "Apply" or "Ok" button. I tested it by changing seconds (+- 30 sec) and hours (+- 1 hour)
Attached file testcase
on linux, if i set the time to the past the timers will appear to stop for the period of the adjustment. setting the time into the future does not cause any stoppage.
ditto on windows. invalid?
(In reply to comment #2) > Matias, can you remove the console.log call? It is undefined in Minefield. > See if it works now, console is an object which belongs to firebug extension. I put it on a conditional, it should be called if console doesn't exist. But it's usefull to notice when the function is called (or not)
(In reply to comment #9) yes, that is essentially the same modification I made. The timer works now in Firefox without the extension.
(In reply to comment #8) > ditto on windows. invalid? > The timer stops when I set the time to one hour in the past. The same thing happens with setTimeout(). Aren't setInterval/setTimeout supposed to fire after a delay (in milliseconds) and not at a fixed currentDate+delay? Even if that was the case, there's a bug here because of the inconsistent behavior when changing the system time to the past or to the future. IE7 & Opera 9.5 do not seem to have this problem.
I've got the exact same problem. I'm also pretty certain that this wasn't happening in the past (but I can't say I know exactly which version). "Aren't setInterval/setTimeout supposed to fire after a delay (in milliseconds) and not at a fixed currentDate+delay? Even if that was the case, there's a bug here because of the inconsistent behavior when changing the system time to the past or to the future." - YES! I think that what's happened here is that someone has changed either (1) the way that these two functions measure time to be based on the new Date() function or (2) they're always used the new Date() function, but the code that handles possible client changes to the past has been removed. I will try to fix this and report back.
Summary: setInterval stops repeating after system time changed → setTimeout and setInterval stops repeating after system time date or clock changed
Has been fixed in 4.0b11?
Has this been fixed in 53b? (I'm sorry, I couldn't resist)
overholt: Is this still an issue?
Flags: needinfo?(overholt)
Priority: -- → P3
Flags: needinfo?(overholt)
Priority: P3 → P5
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: