Visitar URL original
fix: crash when V8 optimises a call to a node:wasi import by trop[bot] · Pull Request #53268 · electron/electron · GitHub
Skip to content

fix: crash when V8 optimises a call to a node:wasi import - #53268

Merged
jkleinsc merged 1 commit into
44-x-yfrom
trop/44-x-y-bp-fix-crash-when-v8-optimises-a-call-to-a-node-wasi-import-1787910373802
Aug 28, 2026
Merged

jkleinsc merged 1 commit into
44-x-yfrom
trop/44-x-y-bp-fix-crash-when-v8-optimises-a-call-to-a-node-wasi-import-1787910373802

Conversation

@trop

@trop trop Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Backport of #53262

See that PR for details.

Notes: Fixed a crash when calling node:wasi functions in optimized code.

Backports nodejs/node#63679. WASI::WasiFunction::SetFunction passed the
address of a stack-local v8::CFunction to FunctionTemplate::New. Since
https://chromium-review.googlesource.com/c/v8/v8/+/7828135 V8 keeps that
pointer rather than copying the address and type info out of it, so once
TurboFan optimised a call to any wasiImport function it read a dead stack
slot. Upstream made the CFunction static on main but marked the change
dont-land-on-v24.x/v26.x because their bundled V8 predates the lifetime
change; ours does not, so carry it as a patch.

The node_external_reference.h half of the upstream commit is already part
of electron_enable_node_startup_snapshot_generation_in_chromium_s_v8.patch.

Co-authored-by: Sam Attard <sattard@anthropic.com>
@trop
trop Bot requested a review from a team as a code owner August 28, 2026 09:46
@trop
trop Bot requested a review from MarshallOfSound August 28, 2026 09:46
@trop trop Bot added 44-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes labels Aug 28, 2026
@jkleinsc
jkleinsc merged commit 82cad53 into 44-x-y Aug 28, 2026
92 checks passed
@jkleinsc
jkleinsc deleted the trop/44-x-y-bp-fix-crash-when-v8-optimises-a-call-to-a-node-wasi-import-1787910373802 branch August 28, 2026 13:51
@release-clerk

release-clerk Bot commented Aug 28, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed a crash when calling node:wasi functions in optimized code.

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

Labels

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

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant