ReviewOS

zig-utils/zig-js

Threads: async-generator handler unwind asserts stack depth under parallel_js (Linux CI)

#727
Closed chris opened this 9 days ago ·
9 days ago

Parent: #502, #478

Evidence

Two consecutive CI runs panicked in `unit (shard 1/4)` on the same test, while the identical suite passes locally on macOS (6/6 single-test and full-shard runs):

Stack (both runs): `OperandStack.shrinkRetainingCapacity` assert `new_len <= items.len` fired from `execLoop`'s error-unwind path (`vm.zig:6026`) via `asyncDrive`/`runAsync` — i.e. an active `Handler` recorded a `stack_depth` greater than the live operand stack at throw time during async-generator resumption.

Analysis

  • The failing test never configures `heap_limit_bytes`, so the #722 conservative-pin grace is inert here (`budget_allocator == null`); the commit pairing is
9 days ago

CI recurrence on iterator-only descendant 9c682655f25f213e73f983c9c3cf2baa130869b8:

This is the same async handler/frame-unwind failure family. No async/jobs change is included in the iterator work.

9 days ago

Current verification after 4f02bbd4 (#791), which made nested suspendable activation ownership precise across moving-GC safepoints:

  • exact witness: 10/10 Debug passes, 0 leaks
  • exact witness: 5/5 ReleaseSafe passes, 0 leaks
  • exact witness: 5/5 unsuppressed TSan passes with TSAN_OPTIONS=halt_on_error=1, 0 leaks
  • #791 full local evidence: 2,230 passed / 1 skipped / 0 failed / 0 leaked, plus Debug, ReleaseSafe, TSan, no-GIL, and mid-GC async activation witnesses

The current Linux confirmation is CI run 33471275361, specifically unit shard 1. It is still queued; I will close this issue once that exact platform shard is green.

9 days ago

Resolved by 4f02bbd4 (#791), which made nested suspendable activation ownership precise across moving-GC safepoints.

Final evidence:

The original OperandStack.shrinkRetainingCapacity handler-depth panic did not recur.

Sign in to comment on this issue.