Skip to content

error: recover async stack frames dropped under AsyncLocalStorage - #35772

Closed
robobun wants to merge 5 commits into
mainfrom
farm/e9e0550c/als-async-stack-frames
Closed

error: recover async stack frames dropped under AsyncLocalStorage#35772
robobun wants to merge 5 commits into
mainfrom
farm/e9e0550c/als-async-stack-frames

error: recover async stack frames dropped under AsyncLocalStorage

a4b4fc3
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 25, 2026 in 21m 53s

Code review found 1 potential issue

Found 1 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 1
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit src/jsc/bindings/AsyncStackTrace.cpp:251-268 Recovered async frames land after outer entry frame's sync frames

Annotations

Check warning on line 268 in src/jsc/bindings/AsyncStackTrace.cpp

See this annotation in the file changed.

@claude claude / Claude Code Review

Recovered async frames land after outer entry frame's sync frames

The hook appends recovered frames to the *end* of `results`, but `getStackTrace` afterwards inserts JSC's own async frames at `asyncStackTraceInsertPos` — which was captured mid-walk, before any *outer* VM entry frame's sync frames. So when a nested VM entry sits below the async-origin entry (e.g. `node:vm` with `microtaskMode: 'afterEvaluate'` draining microtasks with JS still on the stack), the recovered `at async` frames land *after* the outer caller's sync frames instead of directly after JS