Closed Bug 2079579 Opened 1 month ago Closed 1 month ago

testing/enterprise/test_felt_browser_new_window_from_cli.py FeltNewWindowFromCli.test_new_window_from_cli | subprocess.CalledProcessError: Command '['/builds/worker/workspace/build/application/firefox/firefox', [...], died with <Signals.SIGSEGV: 11>.

Categories

(Enterprise Products :: Firefox, defect, P5)

Desktop
Linux

Tracking

(firefox160 fixed)

RESOLVED FIXED
160 Branch
Tracking Status
firefox160 --- fixed

People

(Reporter: intermittent-bug-filer, Assigned: gerard-majax)

References

(Blocks 4 open bugs, Regression)

Details

(Keywords: intermittent-failure, intermittent-testcase, regression, Whiteboard: [collect_confirm_failure])

Attachments

(2 external files)

Assignee: nobody → lissyx+mozillians
Keywords: regression
Regressed by: 2076819

From Claude:

Common cause: when the second firefox process (the remoting client) sends its command to the running instance, it exits right away. XPCOM never started in that process, so nothing stops the background threads it started before it exits.

Linux (confirmed with a local repro):

  1. At exit, profiler shutdown records a Glean telemetry counter (Nightly builds only).
  2. That is the process's first Glean call, so it starts a new glean.dispatcher thread.
  3. Meanwhile the main thread exits, and static destructors destroy the profiler's mutex (gPSMutex).
  4. If the new thread starts late, it registers with the profiler, locks that destroyed mutex, and crashes.

Windows (suspected, not reproduced):

  1. At startup, COM setup (ProcessRuntime) starts a "COM MTA" thread without waiting for it to run.
  2. That thread is normally stopped during XPCOM shutdown, which never happens in the remoting client.
  3. The debug log shows the thread only began running after the main thread had finished XRE_main. It then used state already torn down, and the process crashed.

Why Bug 2076819 matters: it's an upstream change that turned on Glean's gecko feature. With it, every Glean thread registers with the profiler when it starts, and that registration is what takes the destroyed mutex on Linux. Before that change, the Glean thread started at exit never touched Gecko locks, so it couldn't crash this way. It reached our branch through the Oct 6 upstream merge, and the CI failures started on Oct 7. It doesn't explain the Windows crash.

(via GitHub webhook, authenticated as shared-secret)

Comparing https://treeherder.mozilla.org/jobs?repo=enterprise-firefox-try&revision=5268a0c17fa36c3e53cf2b85aee8cdbc56664c02 vs https://treeherder.mozilla.org/jobs?repo=enterprise-firefox-try&revision=1844eb3c6d46c94b5efbb8b959da21a32866e79c confirms the fix is clear.

I'd still like to verify if mozilla::AppShutdown::DoImmediateExit(0); is really the correct fix or if we need to properly join threads there?

(In reply to :gerard-majax from comment #2)

Windows (suspected, not reproduced):

  1. At startup, COM setup (ProcessRuntime) starts a "COM MTA" thread without waiting for it to run.
  2. That thread is normally stopped during XPCOM shutdown, which never happens in the remoting client.
  3. The debug log shows the thread only began running after the main thread had finished XRE_main. It then used state already torn down, and the process crashed.

So after investigating more the Windows part was already present back earlier. Looking at https://treeherder.mozilla.org/jobs?repo=enterprise-main&fromchange=e3428c0ea661d5344367d500fe426449ad793ceb&searchStr=enterprise%2Cwindows%2Cdebug%2Cmarionette-enterprise we could assume it started with https://treeherder.mozilla.org/jobs?repo=enterprise-main&searchStr=enterprise%2Cwindows%2Cdebug%2Cmarionette-enterprise&revision=632969ce3c285f26e2f5e7ef81b1d50193eb5430

OS: Unspecified → Linux
Hardware: Unspecified → Desktop
See Also: → 2079729
Blocks: 1777373
Attachment #9656177 - Attachment description: Bug 2079579 - Stop reporting CPU use on profiler shutdown r?#profiler-reviewers! → Bug 2079579 - Stop reporting CPU use on profiler shutdown r?#glean-reviewers!
Blocks: 2081461
Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 160 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: