Closed Bug 1503003 Opened 6 years ago Closed 6 years ago

Disable process priority manager for xpcshell tests

Categories

(Core :: DOM: Content Processes, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla66
Tracking Status
firefox66 --- fixed

People

(Reporter: alexical, Assigned: mconley)

References

Details

Attachments

(1 file)

Taking this for now.
Assignee: nobody → mconley

So the remaining failures, at least as far as I can tell, are xpcshell test failures in the toolkit/components/extensions/test/xpcshell/ directory, with: application crashed [@ mozilla::ipc::MessageChannel::Close()]

which, I think, might be related to both bug 1451192 and bug 1465092.

Having debugged this a tiny bit and discussed things with asuth, I suspect what's happening is this:

I'm hitting this assertion: https://searchfox.org/mozilla-central/rev/9528360768d81b1fc84258b5fb3601b5d4f40076/ipc/glue/MessageChannel.cpp#2692

I think what's happening is that the parent sends a "goodbye" message to the content process for the PBackground protocol. The child receives it, and the channel is marked as closing. Here: https://searchfox.org/mozilla-central/rev/9528360768d81b1fc84258b5fb3601b5d4f40076/ipc/glue/MessageChannel.cpp#1125

Then... something happens in the child, maybe a queued task to try to communicate over PBackground, and it fails and hits MessageChannel::NotifyMaybeChannelError, and because the channel was closing, we transition to the ChannelClosed state: https://searchfox.org/mozilla-central/rev/9528360768d81b1fc84258b5fb3601b5d4f40076/ipc/glue/MessageChannel.cpp#2540-2546

Then we shut down the content process, and fire the xpcom-shutdown-threads observer notification, and we enter here: https://searchfox.org/mozilla-central/rev/9528360768d81b1fc84258b5fb3601b5d4f40076/ipc/glue/BackgroundImpl.cpp#1267

we call this ThreadLocalDestructor thing here: https://searchfox.org/mozilla-central/rev/9528360768d81b1fc84258b5fb3601b5d4f40076/ipc/glue/BackgroundImpl.cpp#1294, which causes us to try to close the channel again here: https://searchfox.org/mozilla-central/rev/9528360768d81b1fc84258b5fb3601b5d4f40076/ipc/glue/BackgroundImpl.cpp#1505
and attempting to close an already closed channel causes us to explode.

See Also: → 1451192, 1465092

I actually have a much simpler solution.

I don't actually think it makes any sense to have the process priority manager enabled during xpcshell tests. The process priority manager only fiddles process priority when a tab becomes active in a content process, and xpcshell tests never have tabs. So they'd all be in the low priority state, which is definitely not desirable.

I think the best way forward here is probably to just disable the process priority manager when running xpcshell tests.

Summary: Fix remaining extensions test failures with dom.ipc.processPriorityManager.enabled on → Disable process priority manager for xpcshell tests
Pushed by mconley@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c6ec6b0911d2 Disable the process priority manager when running xpcshell tests. r=gsvelto
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: