Disable process priority manager for xpcshell tests

RESOLVED FIXED in Firefox 66

Status

()

RESOLVED FIXED
5 months ago
2 months ago

People

(Reporter: dthayer, Assigned: mconley)

Tracking

unspecified
mozilla66
Points:
---

Firefox Tracking Flags

(firefox66 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Comment 1

5 months ago
Taking this for now.
Assignee: nobody → mconley
(Assignee)

Comment 2

2 months ago

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: → bug 1451192, bug 1465092
(Assignee)

Comment 3

2 months ago

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.

(Assignee)

Updated

2 months ago
Summary: Fix remaining extensions test failures with dom.ipc.processPriorityManager.enabled on → Disable process priority manager for xpcshell tests

Comment 5

2 months ago
Pushed by mconley@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c6ec6b0911d2
Disable the process priority manager when running xpcshell tests. r=gsvelto

Comment 6

2 months ago
bugherder
Status: NEW → RESOLVED
Last Resolved: 2 months ago
status-firefox66: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
You need to log in before you can comment on or make changes to this bug.