Write a test for crashing subframes
Categories
(Core :: DOM: Content Processes, task, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox70 | --- | fixed |
People
(Reporter: mconley, Assigned: ablayelyfondou)
References
Details
Attachments
(3 files)
Bug 1559240 fixes a regression where we weren't showing the about:framecrashed error page anymore for crashing subframes. That regression went undetected for almost a month because we don't have many people testing Fission on a day-to-day basis, and because we didn't have any automated testing for this particular scenario.
So we should add some automated testing for it.
Updated•2 years ago
|
| Reporter | ||
Updated•2 years ago
|
| Assignee | ||
Comment 2•2 years ago
•
|
||
(In reply to Neha Kochar [:neha] from comment #1)
Abdoulaye, is this something you can work on?
Sure!
Hey Mike, would you like to give some guidance here? From your comment in bug 1559240, you said some infrastructure is required to facilitate crash a subframe. Is it something that we will need to build as part of this work or is it a task to delegate to someone else.
| Assignee | ||
Updated•2 years ago
|
| Reporter | ||
Comment 3•2 years ago
|
||
(In reply to Abdoulaye O. LY from comment #2)
Hey Mike, would you like to give some guidance here? From your comment in bug 1559240, you said some infrastructure is required to facilitate crash a subframe. Is it something that we will need to build as part of this work or is it a task to delegate to someone else.
Hi Abdoulaye - thanks for taking this on! I think this is something we might as well get started with in this bug.
This is the method that we use to simulate a browser tab crash:
I think it needs to be adapted to use JS Window Actors instead of the frame script that it's currently using. That means creating and registering some kind of BrowserTestUtils actor - maybe when loading BrowserTestUtils.jsm. That actor should be able to receive a message that causes it to basically do what the frame script does (causes a crash).
So that'd be the first step - make crashBrowser use a JS Window Actor instead of the message manager. The next step is to modify crashBrowser so that it can work with subframes. I suggest:
- Add an optional BrowsingContext ID argument to crashBrowser that'll crash a subframe. If not supplied, we can default to crashing the top-level frame
- Bonus points: rename crashBrowser to something like causeCrash or crashFrame, since the method is no longer just crashing <xul:browser>'s anymore. You'll need to update all of the callers if you do this here. We could also spin that out to a follow-up.
After that, then we need to have the method handle the case where the subframe crashes. This means using JS Window Actors to listen for when the crashing subframe is navigated to about:framecrashed (you'll need to ask the parent of the crashing frame to access the embedding element for the crashing frame, since you can no longer message a crashed frame). I'm not even sure if the minidump stuff is working for OOP iframes yet, so if it's not, we should probably file a bug to get that fixed and skip the minidump cleanup part.
Does that give you a place to get started?
| Assignee | ||
Comment 4•2 years ago
|
||
(In reply to Mike Conley (:mconley) (:⚙️) from comment #3)
(In reply to Abdoulaye O. LY from comment #2)
Hey Mike, would you like to give some guidance here? From your comment in bug 1559240, you said some infrastructure is required to facilitate crash a subframe. Is it something that we will need to build as part of this work or is it a task to delegate to someone else.
Hi Abdoulaye - thanks for taking this on! I think this is something we might as well get started with in this bug.
This is the method that we use to simulate a browser tab crash:
I think it needs to be adapted to use JS Window Actors instead of the frame script that it's currently using. That means creating and registering some kind of BrowserTestUtils actor - maybe when loading BrowserTestUtils.jsm. That actor should be able to receive a message that causes it to basically do what the frame script does (causes a crash).
So that'd be the first step - make crashBrowser use a JS Window Actor instead of the message manager. The next step is to modify crashBrowser so that it can work with subframes. I suggest:
- Add an optional BrowsingContext ID argument to crashBrowser that'll crash a subframe. If not supplied, we can default to crashing the top-level frame
- Bonus points: rename crashBrowser to something like causeCrash or crashFrame, since the method is no longer just crashing <xul:browser>'s anymore. You'll need to update all of the callers if you do this here. We could also spin that out to a follow-up.
After that, then we need to have the method handle the case where the subframe crashes. This means using JS Window Actors to listen for when the crashing subframe is navigated to about:framecrashed (you'll need to ask the parent of the crashing frame to access the embedding element for the crashing frame, since you can no longer message a crashed frame). I'm not even sure if the minidump stuff is working for OOP iframes yet, so if it's not, we should probably file a bug to get that fixed and skip the minidump cleanup part.
Does that give you a place to get started?
I will probably come back to you next week but yes this is enough to get me started I think. Thank you!
| Assignee | ||
Comment 5•2 years ago
|
||
| Assignee | ||
Comment 6•2 years ago
|
||
Updated•2 years ago
|
| Reporter | ||
Comment 7•2 years ago
|
||
Hey Abdoulaye,
Great job here so far - so the next step is actually to write a test that crashes a subframe now. Let me know if you need any guidance with that.
| Assignee | ||
Comment 8•2 years ago
|
||
Pushed by mconley@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/17ab0c52dca0 Step 1: make BrowserTestUtils@crashBrowser function work with JSWindowActor. r=mconley https://hg.mozilla.org/integration/autoland/rev/467caef2ef9c Step 2: Add support for crashing sub-frame. r=mconley https://hg.mozilla.org/integration/autoland/rev/de76712278a6 Step 3: Add test for crashing an oop iframe. r=mconley
Comment 10•2 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/17ab0c52dca0
https://hg.mozilla.org/mozilla-central/rev/467caef2ef9c
https://hg.mozilla.org/mozilla-central/rev/de76712278a6
Comment 11•2 years ago
|
||
Backed out for causing bug 1370046
Push that started the failure: https://treeherder.mozilla.org/#/jobs?repo=autoland&selectedJob=258172467&revision=de76712278a60c88529798ccbc14d2bc72e8f51d
Tier1 failure: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=258180784&repo=autoland&lineNumber=10300
Backout: https://hg.mozilla.org/integration/autoland/rev/2d58a34fa15a4578382e55947b705d878e950937
| Assignee | ||
Comment 12•2 years ago
|
||
Humm I noticed while working on the fullscreen patch that some intermittent failures become more frequent with JSWindowActors.
Comment 14•2 years ago
|
||
Pushed by mconley@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/dabda4e90259 Step 1: make BrowserTestUtils@crashBrowser function work with JSWindowActor. r=mconley https://hg.mozilla.org/integration/autoland/rev/dced8cea7b23 Step 2: Add support for crashing sub-frame. r=mconley https://hg.mozilla.org/integration/autoland/rev/1ce7d9bbe7a1 Step 3: Add test for crashing an oop iframe. r=mconley
Comment 15•2 years ago
|
||
Backed out for 3 changesets (bug 1559244) for browser chrome failure in browser_background_tab_crash.js
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=261844226&repo=autoland&lineNumber=9724
Backout: https://hg.mozilla.org/integration/autoland/rev/fa80b89e0ce4969bed9ffe465c726b99878d94ae
Comment 16•2 years ago
|
||
Pushed by mconley@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/18cb9c11d421 Step 1: make BrowserTestUtils@crashBrowser function work with JSWindowActor. r=mconley https://hg.mozilla.org/integration/autoland/rev/8f3e218a7f94 Step 2: Add support for crashing sub-frame. r=mconley https://hg.mozilla.org/integration/autoland/rev/5fd88c9ac915 Step 3: Add test for crashing an oop iframe. r=mconley
| Assignee | ||
Updated•2 years ago
|
Comment 17•2 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/18cb9c11d421
https://hg.mozilla.org/mozilla-central/rev/8f3e218a7f94
https://hg.mozilla.org/mozilla-central/rev/5fd88c9ac915
Description
•