Infinite loop in SVG using JavaScript with redraw hangs browser
Categories
(Core :: SVG, defect)
Tracking
()
People
(Reporter: mozilla, Unassigned)
References
(Depends on 1 open bug, )
Details
(Keywords: hang, perf)
Attachments
(2 files)
900 bytes,
image/svg+xml
|
Details | |
1.84 KB,
patch
|
tor
:
review+
|
Details | Diff | Splinter Review |
Reporter | ||
Comment 1•20 years ago
|
||
Comment 2•20 years ago
|
||
Comment 3•20 years ago
|
||
![]() |
||
Comment 4•20 years ago
|
||
Comment 5•20 years ago
|
||
Comment 6•20 years ago
|
||
Comment 7•20 years ago
|
||
Updated•20 years ago
|
![]() |
||
Comment 8•20 years ago
|
||
Comment 9•20 years ago
|
||
Comment 10•20 years ago
|
||
![]() |
||
Comment 11•20 years ago
|
||
![]() |
||
Comment 12•20 years ago
|
||
![]() |
||
Comment 13•20 years ago
|
||
Comment 14•20 years ago
|
||
![]() |
||
Comment 15•20 years ago
|
||
Comment 16•20 years ago
|
||
![]() |
||
Comment 17•20 years ago
|
||
Comment 18•20 years ago
|
||
Comment 19•20 years ago
|
||
Comment 20•19 years ago
|
||
Comment 21•18 years ago
|
||
![]() |
||
Comment 22•18 years ago
|
||
Updated•15 years ago
|
![]() |
||
Comment 23•15 years ago
|
||
![]() |
||
Comment 24•15 years ago
|
||
Comment 25•15 years ago
|
||
![]() |
||
Comment 26•15 years ago
|
||
Comment 27•2 years ago
•
|
||
(In reply to Neil Fraser from comment #0)
A while(1){} statement within JavaScript in a SVG causes a dialog box to
appear
asking if you want to terminate the script. This is good. What's bad is
that
if the infinite loop contains calls to "document.createElementNS" and
"appendChild", then the infinite loop goes unchecked. There's no way to
terminate the script without terminating the browser.
Two updates from testing in 2022-era Firefox:
- We do now show a "This page is slowing down Firefox" notification (if you try to interact with the page, at least)
- ...though interestingly: if I click that notification's "Stop" button, the content process remains pegged at 100% CPU with memory-usage still ticking ever-upwards.
- ...however, it looks like we did really stop the script. Memory usage and CPU is just thrashing because we're now left with an absurdly giant DOM which we attempt to render.
- And then the content process ultimately crashes with an out-of-memory exception, on my machine at least (which turns just that one tab into an error page, in our modern e10s-enabled world, essentially; and the rest of the browser is fine). This is to-be-expected for a page of the size that we're left with at the point where I was able to interrupt the script, I think.
This produces a crash report like bp-f16f5f95-ee35-4c33-9e14-ce8b50220818 (from me just now).
So I think this is essentially WORKSFORME at this point; the hang is still there but it's not as problematic given that we do show the "Stop" button, and we do kill the content process if it's sufficiently misbehaving (without taking down the rest of the browser).
Description
•