Open Bug 1673636 Opened 4 years ago Updated 4 years ago

Slow script dialog is not shown when lots of new Javascript array objects being created

Categories

(Core :: XPConnect, defect, P3)

defect

Tracking

()

People

(Reporter: whimboo, Unassigned)

References

Details

(Keywords: hang, perf, power)

As seen on bug 1670181 comment 16 websites can abuse the browser to hang / freeze by allocating lots of new Javascript array objects that then triggers a lot of minor GCs.

Trying to shutdown Firefox will cause a hang until the processes get killed by the terminator.

Here a gecko profile:
https://share.firefox.dev/33JXohQ

When that happens the content process has a 100% CPU usage until it gets killed, or Firefox closed (which also hangs due to the not reacting content process).

Component: DOM: Content Processes → JavaScript: GC

The hang in the child processes is fine, but having super slow shutdown isn't.

(I wrote this before Olli's comment above)

It looks like the page is looping while allocating array objects, which is causing a ton of minor GCs. This is not unexpected. However normally we would break out of this with the slow script dialog or on shutdown, but that doesn't seem to happen here.

I don't see any evidence that it GC activity per se that is block the stopping the user killing the script or the content process from shutting down.

Having said that, the profile is spending most of its time clearing memory which is probably due to nursery poisoning which is only present on nightly. This can be disabled by setting the JSGC_DISABLE_POISONING environment variable.

Yeah, I think this is more a process handling issue.

Component: JavaScript: GC → DOM: Content Processes

The profile shows JS:InterruptCallback is being called periodically, so we should have the opportunity to show the slow script dialog. But we disable the slow script dialog in automation. We need to figure how why the slow script dialog is not being shown.

Moving to XPConnect component.

Severity: -- → S3
Component: DOM: Content Processes → XPConnect
Priority: -- → P3
Summary: Hangs of content process due to lots of new Javascript array objects being created → Slow script dialog is not shown when lots of new Javascript array objects being created under Marionette

kmag says this is probably related to the 20 second shutdown time limit for pending user input and the slow script dialog.

This is not related to Marionette. It's just that the website runs specific code when navigator.webdriver returns true. So nothing related to automation.

Summary: Slow script dialog is not shown when lots of new Javascript array objects being created under Marionette → Slow script dialog is not shown when lots of new Javascript array objects being created
You need to log in before you can comment on or make changes to this bug.