Event Timing API sometimes returns incorrect `startTime` (and `duration` because of it)
Categories
(Core :: DOM: Performance APIs, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox138 | --- | fixed |
People
(Reporter: canova, Assigned: canova)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
I noticed this while working on bug 1934683, but then tried it without these patches applied and I can still reproduce it.
It's not 100% reproducible all the time, but I can reproduce it after restarting Firefox a few times. Once it's reproduced, it stays reproducible until another restart.
For example one startTime
number I got was -73093753
. It looks like an overflow, but don't know why. This also affects the INP values because duration is computed by end - start
, so the duration
value becomes insanely huge, like 73095163
. I wouldn't want numbers like this to be reported by Firefox to websites' RUMs.
I will try to capture and rr session and put the pernosco link here soon.
Assignee | ||
Comment 1•6 months ago
|
||
I forgot to mention that I only reproduced this in Linux for now. I'm unsure if it's a cross-platform issue.
Here's a pernosco session: https://pernos.co/debug/JhS0aaIb5UP6qs-wPUfliA/index.html
Assignee | ||
Comment 2•6 months ago
|
||
Looked at the pernosco session a bit.
aStartTime.mValue = 556261938598153
(from here)
mNavigationStart.mValue = 620023287236088
(from here)
So in this code, when we do aStamp - mNavigationStart
, it does 556261938598153 - 620023287236088
which results in a negative number.
I'm still not so sure how it could be happening. Are these timestamps coming from different processes? Event's timestamp comes from the WidgetEventTime
class. Are we getting that from the parent process and sending it to the child?
Assignee | ||
Comment 3•6 months ago
|
||
Paul told me that this is an issue with TimeStamp
and we should probably start using AwakeTimeStamp
instead.
See bug 1709767 also.
Assignee | ||
Comment 4•6 months ago
|
||
In Linux, GTK returns uin32_t values for GdkEventButton.time
. It's known that
in the wild we encountered some incorrect values. But the latest I encountered
was in Bug 1950992. It was returning some incorrect values for
WidgetEvent::mTimeStamp. This change should prevent that overflow/underflow.
Updated•6 months ago
|
Assignee | ||
Comment 5•6 months ago
|
||
It turned out that this wasn't exactly related to bug 1709767, so removing that. It was about some overflow that we had during native GTK timetamp to TimeStamp
conversion.
Comment 7•5 months ago
|
||
bugherder |
Description
•