Skip to content

v145.0.2

Choose a tag to compare

@github-actions github-actions released this 22 Feb 13:15
· 131 commits to main since this release
fix(locker): make Locker a pure mutex, add IsolateScope for Enter/Exit

V8's Isolate::Enter()/Exit() manage a per-isolate entry_stack_ that
stores the "previous isolate" at each nesting level. When multiple
Lockers coexist on the same thread (cooperative scheduling via
spawn_local), non-LIFO drop ordering causes Exit() to restore a stale
pointer, leading to a NULL dereference on the next Enter().

Fix: Locker now acquires only the V8 mutex (pure mutex). It temporarily
enters the isolate during construction so the C++ Locker sees
IsCurrent()==true and sets top_level_=false, then immediately exits.
The new IsolateScope type manages Enter/Exit at fine-grained boundaries
around each synchronous V8 work block, ensuring proper nesting.

API change: callers must now call locker.enter() to get an IsolateScope
before performing V8 operations. Existing tests updated accordingly.