Skip to content

fix: crash calling OSR shared texture release() after texture GC'd#50499

Merged
MarshallOfSound merged 1 commit into39-x-yfrom
trop/39-x-y-bp-fix-crash-calling-osr-shared-texture-release-after-texture-gc-d-1774460938425
Mar 26, 2026
Merged

fix: crash calling OSR shared texture release() after texture GC'd#50499
MarshallOfSound merged 1 commit into39-x-yfrom
trop/39-x-y-bp-fix-crash-calling-osr-shared-texture-release-after-texture-gc-d-1774460938425

Conversation

@trop
Copy link
Copy Markdown
Contributor

@trop trop bot commented Mar 25, 2026

Backport of #50473

See that PR for details.

Notes: Fixed a crash when calling an offscreen shared texture's release() after the texture object was garbage collected.

The weak persistent tracking the OffscreenReleaseHolderMonitor was tied
to the texture object, but the release() closure holds a raw pointer to
the monitor via its v8::External data. If JS retained texture.release
while dropping the texture itself, the monitor would be freed on GC and
a later release() call would crash.

Track the release function instead of the texture object. Since the
texture holds release as a property, this keeps the monitor alive as
long as either is reachable.

Co-authored-by: Sam Attard <sattard@anthropic.com>
@trop trop bot requested review from a team and MarshallOfSound March 25, 2026 17:49
@trop trop bot added 39-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes labels Mar 25, 2026
@MarshallOfSound MarshallOfSound merged commit 1173004 into 39-x-y Mar 26, 2026
70 checks passed
@MarshallOfSound MarshallOfSound deleted the trop/39-x-y-bp-fix-crash-calling-osr-shared-texture-release-after-texture-gc-d-1774460938425 branch March 26, 2026 07:49
@release-clerk
Copy link
Copy Markdown

release-clerk bot commented Mar 26, 2026

Release Notes Persisted

Fixed a crash when calling an offscreen shared texture's release() after the texture object was garbage collected.

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

Labels

39-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