Closed Bug 2083149 Opened 16 days ago Closed 13 days ago

Startup crashes are not detected on Linux and macOS when Firefox is started by another Firefox process

Categories

(Toolkit :: Startup and Profile System, defect)

defect

Tracking

()

RESOLVED FIXED
160 Branch
Tracking Status
firefox160 --- fixed

People

(Reporter: jmendez, Assigned: jmendez)

Details

Attachments

(1 external file)

TLDR: Checking if the "XRE_PROFILE_PATH" env var is set should check both whether the env var exists and whether it has a value.

At the end of XRE_main, SaveToEnv("XRE_PROFILE_PATH=") clears the variable set for restarts. On Windows _putenv deletes it, but on Unix it stays in the environment with an empty value, and any Firefox process started by this one inherits it.

nsAppStartup::TrackStartupCrashBegin skips crash detection when XRE_PROFILE_PATH is set (bug 731613), and it only checks that PR_GetEnv returns non-null. So in a Firefox process started by another one on Linux or macOS, startup crashes are never counted and automatic Safe Mode is never offered.

This matters for the Firefox Enterprise launcher, which starts every browser process, but it applies to any Firefox launched from Firefox.

The fix is to also require the value to be non-empty, as Firefox Enterprise's nsAppRunner already does when it reads the same variable for profile selection. toolkit/components/startup/tests/unit/test_startup_crash.js can cover both the set and the emptied cases.

On Unix, clearing the variable at startup leaves it empty in the environment of
any Firefox process this one launches, which turned off startup crash detection
there.

Pushed by jmendez@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/d6d4389650bc https://hg.mozilla.org/integration/autoland/rev/c5a929833bd7 Treat an empty XRE_PROFILE_PATH as unset when tracking startup crashes. r=firefox-desktop-core-reviewers ,Gijs
Status: NEW → RESOLVED
Closed: 13 days ago
Resolution: --- → FIXED
Target Milestone: --- → 160 Branch
QA Whiteboard: [qa-triage-done-c161/b160]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: