Visitar URL original
fix: object lifetime bugs in sharedTexture, service-worker ipcRenderer and utilityProcess.fork() by trop[bot] · Pull Request #53278 · electron/electron · GitHub
Skip to content

fix: object lifetime bugs in sharedTexture, service-worker ipcRenderer and utilityProcess.fork() - #53278

Merged
MarshallOfSound merged 3 commits into
43-x-yfrom
trop/43-x-y-bp-fix-object-lifetime-bugs-in-sharedtexture-service-worker-ipcrenderer-and-utilityprocess-fork--1787939444009
Aug 28, 2026
Merged

MarshallOfSound merged 3 commits into
43-x-yfrom
trop/43-x-y-bp-fix-object-lifetime-bugs-in-sharedtexture-service-worker-ipcrenderer-and-utilityprocess-fork--1787939444009

Conversation

@trop

@trop trop Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Backport of #53259

See that PR for details.

Notes: Fixed crashes in sharedTexture, service-worker ipcRenderer and utilityProcess.fork() caused by object lifetime bugs.

trop Bot and others added 3 commits August 28, 2026 17:50
The native side of utilityProcess.fork() read options.stdio into a
std::vector and then indexed the first three entries unconditionally,
with no default for unrecognised values. An array that validates in JS
but yields fewer elements (or different strings) when gin re-reads it
would index past the end of the vector and leave IOType uninitialised.
Clamp to the vector's size, fall back to the default configuration for
missing slots, and treat unknown values as inherit.

Co-authored-by: Sam Attard <sattard@anthropic.com>
…reachable

The native wrapper behind sharedTexture.subtle.importSharedTexture() was
freed from a weak callback on the returned object, but the release /
getVideoFrame / startTransferSharedTexture / getFrameCreationSyncToken /
setReleaseSyncToken functions all hold the same raw pointer through a
shared v8::External. Retaining one of those functions after dropping the
object let the wrapper be deleted underneath it. Key the weak callback on
the External instead, which every method keeps alive, and make release()
a no-op once the reference has already been dropped.

Co-authored-by: Sam Attard <sattard@anthropic.com>
IPCServiceWorker is a cppgc-managed object that adds itself to the
current worker thread's content::WorkerThread observer list in its
constructor but never removed itself. If the object was swept by a
worker-isolate GC before the thread shut down, WorkerThreadRegistry
would later dispatch WillStopCurrentWorkerThread() through a dangling
pointer. Add a prefinalizer, mirroring IPCRenderFrame, that removes the
observer while the per-thread registry is still alive.

Co-authored-by: Sam Attard <sattard@anthropic.com>
@trop
trop Bot requested a review from MarshallOfSound August 28, 2026 17:51
@trop trop Bot added 43-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes labels Aug 28, 2026
@MarshallOfSound
MarshallOfSound merged commit 1002688 into 43-x-y Aug 28, 2026
96 checks passed
@MarshallOfSound
MarshallOfSound deleted the trop/43-x-y-bp-fix-object-lifetime-bugs-in-sharedtexture-service-worker-ipcrenderer-and-utilityprocess-fork--1787939444009 branch August 28, 2026 19:27
@release-clerk

release-clerk Bot commented Aug 28, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed crashes in sharedTexture, service-worker ipcRenderer and utilityProcess.fork() caused by object lifetime bugs.

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

Labels

43-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.

1 participant