Closed Bug 1370520 Opened 5 years ago Closed 5 months ago
_CRASHREPORTER _SHUTDOWN environment variable set the browser should quit with a non 0 exit code
48 bytes, text/x-phabricator-request
|Details | Review|
With bug 1311016 we originally implemented the shutdown sequence for a content crash and MOZ_CRASHREPORTER_SHUTDOWN set. Sadly this causes Firefox to quit with the exit code 0. To better reflect that the browser has been quit due to a crash we should select a non 0 exit code. Has anyone an idea how to do this?
I'm going to link to the codepaths currently involved in setting a return value, but I don't see an obvious place to interject this. rv here: http://searchfox.org/mozilla-central/rev/d441cb24482c2e5448accaf07379445059937080/toolkit/xre/nsAppRunner.cpp#4833 comes from the end of xre_mainrun where it calls nsAppStartup::Run: http://searchfox.org/mozilla-central/rev/d441cb24482c2e5448accaf07379445059937080/toolkit/xre/nsAppRunner.cpp#4571 which comes from here: http://searchfox.org/mozilla-central/rev/d441cb24482c2e5448accaf07379445059937080/toolkit/components/startup/nsAppStartup.cpp#288 Since return codes are fragile, please add an automated test to make sure this keeps working? I suspect you're aware of the old bug 894697 which asked for a generic API for setting the Firefox return code. I rejected that because at the time we couldn't write tests for it, and there are end-user cases where it would break. For specific automation needs where we know we're not going to be doing restarts for update that's less of a problem, but it's still going to be fragile.
Component: General → Startup and Profile System
Product: Firefox → Toolkit
Flags: needinfo?(dtownsend) → needinfo?(nalexander)
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/autoland/rev/cc56afa024dc Use SIGUSR1 (245) as exit code for a content crash forced shutdown. r=webdriver-reviewers,gsvelto,jgraham
You need to log in before you can comment on or make changes to this bug.