Open Bug 670551 Opened 13 years ago Updated 2 years ago

nsIdleService occasionally has spurious "back"/"idle" notifications in the middle a long idle periods

Categories

(Core :: Widget, defect)

x86
Windows 7
defect

Tracking

()

People

(Reporter: bugzilla-mozilla-20000923, Unassigned)

References

Details

(Keywords: regression, Whiteboard: dupme)

Attachments

(1 file)

I noticed this problem when I upgraded my XULRunner for ChatZilla to Gecko 2.0 and while idle overnight, every 10 minutes or so, it would mark me "back" and then immediately "away" again. The ChatZilla away/back is directly tied to the nsIIdleService so I logged that and saw the data (idleTime -> timeStr in the code) was just fine - i.e. it has a large idle time even for the "back" notifications!

So I've compiled trunk (18c8c2ea4caf07635792b70168fad1d8a6694a38) and attached is a log from nsIdleService.cpp, just after timeStr.AppendInt(idleTime), using the following code:

printf("nsIdleService::CheckAwayState: mLHA=%d -> %d, cTime=%d, lTime=%d, iTime=%d (%d)\n", mLastHandledActivity, curTime - idleTime, curTime, lastTime, idleTime, idleTimeMS);

I have intermixed it with the notifcations ChatZilla received during the same period to highlight when it goes wrong.

As far as I can tell, this problem exists as a result of bug 544240 switching all the important calculations to use seconds instead of milliseconds. It now has rounding issues. :)
In case there's any confusion, I added idleTimeMS myself a little earlier to see how badly it was rounding, like this:

  PRUint32 idleTimeMS = idleTime;
  idleTime /= 1000;
This may have been resolved by bug 811459.
Whiteboard: dupme
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: