Skip to content

fix(deps): take Electron 43.7.0 for the glibc environ use-after-free (#20081) - #20089

Merged
nwparker merged 1 commit into
mainfrom
nwparker/bug-linux-nvidia-x11-1.4.199-1.4.200-sigsegv-on
Sep 11, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/bug-linux-nvidia-x11-1.4.199-1.4.200-sigsegv-on

Conversation

@nwparker

@nwparker nwparker commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​57 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​57
Prod 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​64 $\color{#cf222e}{\Huge{\mathbf{−}}}$​32 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​32

Fixes #20081 — Orca 1.4.199/1.4.200 SIGSEGV on launch on Linux.

What actually broke

Not the GPU. Electron 43.5.0 (electron#53070) started wrapping gtk_init() in setenv("GDK_GL","disable") / unsetenv(…), and in the same change moved FontConfig warm-up onto a thread-pool thread that runs concurrently with toolkit init.

Below glibc 2.41, setenv/unsetenv reallocate the environ array and free the old one. FontConfig calls getenv() constantly. So the browser process reads freed memory about a second into startup. Every Linux target we support is under that line (Ubuntu 20.04–24.04 = glibc 2.31–2.39).

That explains every detail in the report:

Reported symptom Explanation
SIGSEGV ~1s in, no window Browser-process UAF during toolkit init
GPU fallback never engages No GPU child is involved; Safe Graphics could not have helped even if it ran on Linux
gtk_widget_realize → libxcb-dri3 on first keystroke Heap already corrupted; PartitionAlloc trips wherever the next allocation lands
1.4.198 fine, 1.4.199+ dead 1.4.198 = Electron 43.4.1, before #53070
NVIDIA/X11 correlation Timing, not cause — the NVIDIA GL dlopen shifts the thread interleaving

Upstream saw the same thing from the other end: electron#53200 — "Linux SIGTRAP: PartitionAlloc freelist corruption detected during Fontconfig startup" — and the ASan shards were "crashing in fontconfig's getenv() at startup."

The fix

Electron 43.7.0 carries electron#53491: it overrides setenv/unsetenv/putenv/clearenv process-wide so a published environ is never freed (glibc's own 2.41 approach), and defers to glibc on 2.41+. Backported to 42/43/44/45.

Chromium is unchanged at 150.0.7871.250 between 43.6.0 and 43.7.0 — Node goes 24.20.0 → 24.21.0 (ABI 148, unchanged). This is the fix and nothing else.

Also in this PR

  • config/scripts/electron-runtime-floor.test.ts — fails the suite if the Electron pin ever drops below 43.7.0. Orca is a first-class trigger for this race, not a bystander: patchPackagedProcessPath, configureOrcaUserDataPathEnv, and hydrate-shell-path all write process.env during early startup.
  • A "Runtime floor" section in docs/reference/linux-glibc-compatibility.md recording the constraint.

Verification

  • pnpm tc — clean
  • pnpm test src/main/startup config/scripts/electron-runtime-floor.test.ts — 501 passed, 8 skipped
  • pnpm run check:code-quality:changed — 0 new findings
  • pnpm run build:electron-vite — clean
  • Boot smoke on macOS: app reaches a loaded renderer on Electron/43.7.0 Chrome/150.0.7871.250

Not verified on the reporter's hardware — I have no Ubuntu + NVIDIA/X11 box. Needs a test build from this branch confirmed against the original repro.

Electron 43.5.0 wraps `gtk_init()` in `setenv("GDK_GL","disable")` /
`unsetenv` and, in the same change, moves FontConfig warm-up onto a
thread-pool thread that runs concurrently. Below glibc 2.41 `setenv`
frees the old `environ`, so the FontConfig thread's `getenv()` reads
freed memory — a browser-process use-after-free about a second into
startup, on every Linux we ship to (Ubuntu 20.04-24.04 are 2.31-2.39).

That is what 1.4.199/1.4.200 shipped. The corruption surfaces wherever
the next allocation lands, which is why the reports name unrelated
frames (gtk_widget_realize, libxcb-dri3, expat) and read as an NVIDIA
GPU fault: no GPU child is involved, and Safe Graphics could not have
helped even if it ran on Linux.

43.7.0 carries electron#53491, which overrides setenv/unsetenv/putenv/
clearenv so a published `environ` is never freed and defers to glibc on
2.41+. Chromium is unchanged at 150.0.7871.250, so this is the fix and
nothing else.

Fixes #20081

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Electron 43.6.0 → 43.7.0 — takes the fix for the glibc environ use-after-free (electron#53491, backported to 43-x-y as #53510) that caused the 1.4.199/1.4.200 launch SIGSEGV on Linux.
  • Runtime-floor guard test — config/scripts/electron-runtime-floor.test.ts pins Electron at or above 43.7.0 and would fail on a downgrade.
  • Docs — a "Runtime floor" section in docs/reference/linux-glibc-compatibility.md records the constraint; the referenced startup symbols (patchPackagedProcessPath, configureOrcaUserDataPathEnv, hydrateShellPath) all exist.
  • Workspace config — [email protected] added to minimumReleaseAgeExclude (released 2026-09-10, under the 3-day gate) plus lockfile regeneration.

I independently confirmed the load-bearing claims: v43.7.0 exists and its release notes carry the Linux process.env concurrent read/write crash fix (the #53510 43-x-y backport of #53491), and Node moved to 24.21.0 as stated. The guard test is a real tripwire, not theatre — its meetsRuntimeFloor assertions are exact and a downgrade to 43.6.0 fails. The one open item is the one the PR body already discloses: it has not been confirmed on the reporter's Ubuntu + NVIDIA/X11 hardware (only a macOS boot-smoke), so a test build against the original repro is still worth doing before release.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@coderabbitai

coderabbitai Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

📝 Walkthrough

Walkthrough

Adds a test that enforces Electron version 43.7.0 or newer. Updates the Electron development dependency and workspace release-age exception to 43.7.0. Documents a Linux glibc below 2.41 startup race, its impact on Electron 43.5.0 and later, and the Electron 43.7.0 fix.

Priority: ⬆️ High

Severity of issue fixed: Medium

Merge Risk: 🟡 Moderate · up to 33df6

A prerelease Electron version can bypass the required stable runtime floor and reintroduce the Linux startup crash. Update the version validation before merging.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description provides a detailed problem statement, root cause, fix, linked issue, scope, and verification results. However, it omits several template sections, including ELI5, Visual Proof with an… Add the missing template sections. Include an ELI5 summary, state N/A with a reason or attach visual proof, complete the Review, Agent skill upstream boundary, Notes, and Checklist sections, and record the relevant testing and cross-platfor…
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. (3 skipped: 3 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the Electron 43.7.0 dependency update and the Linux glibc environ use-after-free fix.
Linked Issues check ✅ Passed The changes address issue #20081 by updating Electron from 43.6.0 to 43.7.0, which includes the upstream fix for the glibc environ use-after-free race linked to the Linux startup SIGSEGV. The runtim…
Out of Scope Changes check ✅ Passed All reviewed changes support issue #20081. The package.json update supplies the fix. The pnpm-workspace.yaml entry permits the required Electron version. The runtime-floor test prevents regression…
Full details: Description check

Explanation

The description provides a detailed problem statement, root cause, fix, linked issue, scope, and verification results. However, it omits several template sections, including ELI5, Visual Proof with an explicit N/A if applicable, Review, Agent skill upstream boundary, Notes, and the Checklist.

Resolution

Add the missing template sections. Include an ELI5 summary, state N/A with a reason or attach visual proof, complete the Review, Agent skill upstream boundary, Notes, and Checklist sections, and record the relevant testing and cross-platform considerations.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. (3 skipped: 3 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: cbd3b9f8-0589-47b4-bc2a-1d9a9b858103

📥 Commits

Reviewing files that changed from the base of the PR and between 94c2f96 and 33df65a.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • config/scripts/electron-runtime-floor.test.ts
  • docs/reference/linux-glibc-compatibility.md
  • package.json
  • pnpm-workspace.yaml

Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review.

const MINIMUM_ELECTRON_VERSION = '43.7.0'

function parseVersion(specifier: string): [number, number, number] {
const match = /(\d+)\.(\d+)\.(\d+)/.exec(specifier)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Validate the Electron dependency as an npm semver range, not by extracting a numeric triple.

parseVersion treats 43.7.0-beta.1 as 43.7.0, so meetsRuntimeFloor returns true. An explicit prerelease dependency update can therefore bypass the stable 43.7.0 floor and reintroduce the Linux launch crash. Use a semver range parser that rejects prerelease minimums while accepting stable ranges such as ^43.7.0 and ~43.7.0. Add tests for both cases.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const match = /(\d+)\.(\d+)\.(\d+)/.exec(specifier)
const match = /^(\d+)\.(\d+)\.(\d+)$/.exec(specifier)
🧰 Tools
🪛 OpenGrep (1.28.0)

[ERROR] 16-16: Dynamic command passed to child_process.exec/execSync. Use child_process.execFile or spawn with an argument array instead.

(coderabbit.command-injection.exec-js)

@nwparker
nwparker merged commit 9c918b9 into main Sep 11, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Linux NVIDIA/X11: 1.4.199/1.4.200 SIGSEGV on launch and on first keystroke (Electron 43.6.0); 1.4.198 is fine

1 participant