Skip to content

fix: tear down Node's per-process state before the process exits - #52992

Merged
MarshallOfSound merged 1 commit into
42-x-yfrom
manual-bp/42-x-y/52856
Aug 19, 2026
Merged

MarshallOfSound merged 1 commit into
42-x-yfrom
manual-bp/42-x-y/52856

Conversation

@VerteDinde

Copy link
Copy Markdown
Member

Backport of #52856

See that PR for details.

Manual backport notes: include-order conflict only (browser.cc); node::TearDownOncePerProcess() exists in this branch's Node.

Notes: Fixed a possible crash (SIGABRT) during process exit when the process had loaded tls/https shortly before exiting, affecting app.exit() before ready and short-lived ELECTRON_RUN_AS_NODE / child_process.fork() scripts.

)

Loading `tls` makes Node start a background thread that parses the CA
certificates. Node joins that thread in TearDownOncePerProcess(), which
Electron never called, so a process that loaded tls/https and exited soon
after could have exit() destroy Node's static mutexes underneath that
thread and abort().

Call node::TearDownOncePerProcess() at the end of the ELECTRON_RUN_AS_NODE
entry point, from the NodeBindings instance that initialized Node (browser
and utility processes), and before the direct exit() that app.exit() takes
when called before 'ready'.

(cherry picked from commit c36d14c)
@VerteDinde VerteDinde added backport This is a backport PR semver/patch backwards-compatible bug fixes 42-x-y labels Aug 18, 2026
@MarshallOfSound
MarshallOfSound enabled auto-merge (squash) August 19, 2026 07:21
@MarshallOfSound
MarshallOfSound merged commit b43b5e1 into 42-x-y Aug 19, 2026
89 checks passed
@MarshallOfSound
MarshallOfSound deleted the manual-bp/42-x-y/52856 branch August 19, 2026 07:38
@release-clerk

release-clerk Bot commented Aug 19, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed a possible crash (SIGABRT) during process exit when the process had loaded tls/https shortly before exiting, affecting app.exit() before ready and short-lived ELECTRON_RUN_AS_NODE / child_process.fork() scripts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

42-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants