Closed Bug 1273414 Opened 9 years ago Closed 9 years ago

CPUUsage b38.085 firefox.exe!xul.dll!nsCSSBorderRenderer::DrawBorderSidesCompositeColors

Categories

(Core :: CSS Parsing and Computation, defect)

46 Branch
defect
Not set
critical

Tracking

()

RESOLVED DUPLICATE of bug 1269351

People

(Reporter: abbGZcvu_bugzilla.mozilla.org, Unassigned)

Details

(Keywords: hang, testcase)

Attachments

(2 files)

Attached file repro.html
Repro: <progress style=border-left-width:999999999em> Causes excessive CPU usage in nsCSSBorderRenderer::DrawBorderSidesCompositeColors: https://mxr.mozilla.org/mozilla-central/source/layout/base/nsCSSRenderingBorders.cpp#723 697 for (uint32_t i = 0; i < uint32_t(maxBorderWidth); i++) { ... lots of computations here... 726 } maxBorderWidth is controlled through the CSS style. The repro provides a high value that makes this loop take a very long time to complete. Even if the code inside the loop could be optimized, simply counting up to the highest possible unsigned integer would consume excessive CPU and take a long time. Possible solutions: a sane limit to the number of loops could be applied, but since the time spent running this loop relies on both the number of loops and the time it takes to complete one loop (which depends on the speed of the machine it is running on), measuring the time spend in the loop and terminating it after a set amount would be a better, but more (if not overly) complex solution.
Attached file BugId report
BugId (https://github.com/SkyLined/BugId) can now detect excessive CPU usage, determine which function is causing it and provide a unique id for the instance.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: