Closed Bug 1909614 Opened 3 months ago Closed 3 months ago

TimeUnit::operator== is nonsense for large numerators and denominators

Categories

(Core :: Audio/Video, defect)

defect

Tracking

()

RESOLVED FIXED
130 Branch
Tracking Status
firefox-esr115 --- wontfix
firefox-esr128 --- wontfix
firefox128 --- wontfix
firefox129 --- wontfix
firefox130 --- fixed

People

(Reporter: karlt, Assigned: karlt)

References

(Blocks 1 open bug, Regression, )

Details

(Keywords: crash, regression, sec-other, Whiteboard: [adv-main130-])

Attachments

(1 file)

Perhaps 128-bit arithmetic might be useful to make TimeIntervals more predictable.

Do we ever use bases > 2^32?
If not, 96-bit arithmetic would be sufficient.

Blocks: 1849216

Set release status flags based on info from the regressing bug 1817997

:padenot, since you are the author of the regressor, bug 1817997, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

If different precision is used in different situations, such as using 53-bit precision floating point sometimes in operator== and exact arithmetic when its easier, then this can lead to inconsistent results such as a < c when a == b == c.

Assuming denominators are either hard-coded or come from up-to-32-bit fields in media resources, 96-bit fixed point (exact) arithmetic could be sufficient.

When TimeUnit comparisons are between microseconds and tenths of microseconds, the fallback path is used for times greater than 10 days. (2^63/10^6/10^7/60/60/24).

If comparisons are between nanoseconds and tenths of microseconds, then the fallback path is used for times greater than 15 minutes (2^63/10^9/10^7/60).

Bug 1835044 comment 4 indicates that sites can use large start times (53 years).

Severity: -- → S2
Flags: needinfo?(padenot)

Downgrading because the Reduce() operations provide that equal TimeUnits return true and unequal TimeUnits return true only if they differ only in a unique factor that moves from numerator in one argument to denominator in the other.

Severity: S2 → S3
Assignee: nobody → karlt

As well as removing 53-bit precision rounding in >= and <= operators, this
resolves a bug where operator== would sometimes returning true for very
different TimeUnits.

Pushed by ktomlinson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/557afaf1731b use exact 96-bit integer arithmetic for TimeUnit comparison operators r=padenot
Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 130 Branch

The patch landed in nightly and beta is affected.
:karlt, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox129 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(karlt)

I don't know of any particular real life situations hitting this, so i think this is better to have some time to ride the trains.

Flags: needinfo?(karlt)
Flags: in-testsuite+
Whiteboard: [adv-main130-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: