Skip to content

Commit 413c93f

Browse files
committed
fix(Session): prevent V8 JIT corruption during cleanup on Alpine
Hold strong references to Session JS objects during DeleteAllSessions() cleanup. This prevents GC from destroying Sessions while we iterate, avoiding V8 JIT page corruption that manifested as SIGSEGV on Alpine/musl. The bug: When Sessions were GC'd during Jest cleanup, their ObjectReference destructors corrupted V8's JIT allocations. This only happened on Alpine because musl has different GC timing during process exit. The fix: Three-phase cleanup: 1. Create temporary ObjectReferences to all Sessions (prevents GC) 2. Clear SQLite sessions and session_ pointers 3. Clear database_ref_ for all Sessions (may trigger GC, but safe) 4. Release temporary refs - Sessions can be GC'd with empty database_ref_
1 parent 5d1edcb commit 413c93f

2 files changed

Lines changed: 163 additions & 180 deletions

File tree

0 commit comments

Comments
 (0)