Closed Bug 1311016 Opened 9 years ago Closed 9 years ago

Make Firefox honor MOZ_CRASHREPORTER_SHUTDOWN environment variable to quit browser on content process crash

Categories

(Firefox :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 52
Tracking Status
firefox52 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

Details

Attachments

(1 file)

Similar to bug 976120 for B2G we would like to have Firefox respect the crash environment especially for MOZ_CRASHREPORTER_SHUTDOWN which should cause Firefox to quit. A patch should be similar to the following changeset: https://hg.mozilla.org/mozilla-central/rev/471b293539c6
Ted, do you know where we would have to get this code added?
Flags: needinfo?(ted)
We'd want to handle this in the existing browser code that handles ipc:content-shutdown: https://dxr.mozilla.org/mozilla-central/rev/7452437b3ab571b1d60aed4e973d82a1471f72b2/browser/modules/ContentCrashHandlers.jsm#79
Flags: needinfo?(ted)
Summary: Make Firefox crash reporting respect crash environment → Make Firefox honor MOZ_CRASHREPORTER_SHUTDOWN environment variable to quit browser on content process crash
Looks like an easy thing to do. I will take it.
Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Attachment #8803899 - Flags: review?(ted)
Tested and works perfectly fine locally with the environment variable set. Ted, please let me know if that is the right place to insert this shutdown. If yes, I will request review from a browser peer. Thanks.
Comment on attachment 8803899 [details] Bug 1311016 - Make Firefox honor MOZ_CRASHREPORTER_SHUTDOWN environment variable to quit browser on content process crash https://reviewboard.mozilla.org/r/88110/#review87288 That looks like the correct patch.
Attachment #8803899 - Flags: review?(ted)
Attachment #8803899 - Flags: review?(mconley)
Comment on attachment 8803899 [details] Bug 1311016 - Make Firefox honor MOZ_CRASHREPORTER_SHUTDOWN environment variable to quit browser on content process crash https://reviewboard.mozilla.org/r/88110/#review87330 Thanks! ::: browser/modules/ContentCrashHandlers.jsm:121 (Diff revision 1) > } > + > + // check for environment affecting crash reporting > + let env = Cc["@mozilla.org/process/environment;1"] > + .getService(Ci.nsIEnvironment); > + let shutdown = env.get("MOZ_CRASHREPORTER_SHUTDOWN"); Note that the documentation in `nsIEnvironment` [suggests we use env.exists for this use case instead](http://searchfox.org/mozilla-central/rev/e3e8571c5378ac92663d4f583ccc4ad0a3019716/xpcom/threads/nsIEnvironment.idl#29-31). ::: browser/modules/ContentCrashHandlers.jsm:124 (Diff revision 1) > + let appStartup = Cc["@mozilla.org/toolkit/app-startup;1"] > + .getService(Ci.nsIAppStartup); > + appStartup.quit(Ci.nsIAppStartup.eForceQuit); You should be able to use `Services.startup.quit` here instead.
Attachment #8803899 - Flags: review?(mconley) → review+
Pushed by hskupin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f7a9e4b09055 Make Firefox honor MOZ_CRASHREPORTER_SHUTDOWN environment variable to quit browser on content process crash r=mconley
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 52
Does this, and should it, work with the GPU process?
Flags: needinfo?(hskupin)
Flags: needinfo?(dvander)
I think that Ted might better know the details if the GPU process is also covered.
Flags: needinfo?(hskupin) → needinfo?(ted)
This patch probably doesn't cover the GPU process. But I don't know why we'd want to shutdown the UI for a gpu process crash, unless we're specifically interested in stopping testing when that happens (we definitely would not normally want to).
Flags: needinfo?(dvander)
I assume this does not cover GPU process crashes, since the notification it keys off of is "ipc:content-shutdown". dvander: this is intended solely for testing, where we likely want to stop testing when we experience an unexpected crash since it's unlikely that things will continue to work as expected.
Flags: needinfo?(ted)
For the GPU process it's the opposite: things are likely to keep working and if not, that's a problem. We want to know about those failures.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: