Skip to content

fix(jsc): port foreign-stack trap suspension to main - #30

Merged
steipete merged 1 commit into
openclaw/mainfrom
claude/foreign-stack-suspension-main
Oct 9, 2026
Merged

steipete merged 1 commit into
openclaw/mainfrom
claude/foreign-stack-suspension-main

Conversation

@steipete

@steipete steipete commented Oct 9, 2026 •

Copy link
Copy Markdown

Port the Linux foreign-stack suspension deadlock fix from #25 to openclaw/main, after #26. A Worker waiting in a native call on a foreign stack could keep the asynchronous trap sender retrying under the process-wide suspension lock, blocking another VM's collection and the callback needed to release that native call.

All six production source files and the native regression are byte-identical to release merge 791431dcde36ed21da655ed856acfc92c5a15528. Optional trap sampling makes one attempt and releases the lock before retrying. Termination stays pending; mandatory GC suspension still requires a valid snapshot, and Mach suspension keeps its existing operation. General same-VM foreign-stack scanning and the sampling profiler's separate blocking path remain outside this fix.

The only build adaptation links the new native test with main's existing mimalloc-obj, without the release branch's absent idle-hook shim. Building jsc also builds the test; the native Linux artifact gate executes it alongside the existing storage and allocator regressions. Build recipes and Bun qualification inputs are unchanged. No new Bun runtime adapter is needed.

The #25 proof remains bound to its original source: released Bun had 66 timeouts in 200 Koffi processes, patched Bun passed 200/200 (2,000 Worker terminations), and the matched native negative control deadlocked while the candidate passed. ASAN passed with its standard swapcontext warning. TSAN was not clean: all eight signatures also reproduced in an unpatched ordinary two-VM GC control; no suppressions were used. This port does not claim a new run of that matrix or sanitizer proof.

Local validation: 14 release-integrity tests, four JSC-result verifier tests, whitespace checks, and scoped WebKit style checks pass. Independent P2 review is scoped-clean. All three exact-head checks are green at ab0d471676115135e1e4d0cb02c8c108cca633fc: engine checks and Linux ARM64. The fresh native foreign-stack regression prints both PASS lines. Paired Bun qualification passes 46/46 result entries per arm; both retained executables and fixture hashes were independently verified. ARM64 passes 1,779 stress and 1,639 module results, and macOS compilation passes. The inherited parallel runner encounters its known epoll setup errors and resumes 26 unfinished files per arm, with zero files classified failed before resumption. The raw aggregate setup-error counters remain in the logs; no failed-file or workflow rerun was requested.

Related upstream work remains WebKit#65562 and oven-sh#235, oven-sh#741 and oven-sh#742; those handle alternate signal stacks or saved contexts rather than an interrupted pointer genuinely outside the registered stack.

@steipete
steipete marked this pull request as ready for review October 9, 2026 20:05
@steipete
steipete merged commit 13438f2 into openclaw/main Oct 9, 2026
3 checks passed
@steipete
steipete deleted the claude/foreign-stack-suspension-main branch October 9, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant