Skip to content

fix: use v8::Global instead of TracedReference in PromiseHandle - #51463

Closed
ckerr wants to merge 1 commit into
mainfrom
fix/promise-traced-reference
Closed

ckerr wants to merge 1 commit into
mainfrom
fix/promise-traced-reference

Conversation

@ckerr

@ckerr ckerr commented May 4, 2026

Copy link
Copy Markdown
Member

Description of Change

Experimental PR to test a theory about #51462.

The theory here is that the Promise's resolver is being collected before the promise resolves, causing isAlive() to return false and make Resolve() and Reject() no-ops.

Checklist

Release Notes

Notes: none

TracedReference handles inside cppgc objects can be cleared during
minor (Scavenge) GC when write-barrier bookkeeping is missed — for
example when the reference is stored during MakeGarbageCollected
construction, which uses kInitializingStore and skips the
remembered-set write barrier.

When the Promise resolver handle is cleared, IsAlive() returns false,
Resolve/Reject silently no-ops, the JS-side await never settles, and
the process hangs.

Replace with v8::Global, which is an unconditionally strong root.
PromiseHandle remains cppgc::GarbageCollected — its destructor
releases the v8::Global handles when cppgc sweeps the object.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-pr 🌱 PR opened recently semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant