Repository navigation
fix(jsc): port foreign-stack trap suspension to main - #30
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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. Buildingjscalso 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.