Skip to content

fix(node:vm): accept cached data when the JIT is unavailable - #118

Merged
steipete merged 1 commit into
mainfrom
claude/w154-vm-cached-data-jitless
Oct 5, 2026
Merged

steipete merged 1 commit into
mainfrom
claude/w154-vm-cached-data-jitless

Conversation

@steipete

@steipete steipete commented Oct 5, 2026 •

Copy link
Copy Markdown

Constructing vm.Script with valid cachedData crashes when JavaScriptCore runs without a JIT, including when executable memory is unavailable. The constructor synchronously compiles a decoded block into a private executable, but every actual run uses unlinkedCodeBlockFor() and links its own program.

Remove the unused JIT compilation and cached executable. Keep owned-byte decoding and source-key validation as the accept/reject check. Add a subprocess regression that disables the JIT and verifies cachedDataRejected === false and execution returning 42.

Adapted from oven-sh#41769. Thanks @robobun; contributor credit is preserved in the commit.

Native Linux validation: the unchanged baseline reproduces SIGSEGV/exit 139; the corrected matched-engine build passes 358 VM tests (3 existing skips and 60 existing TODOs) and all 47 fork-selection results (45 files plus two dependency checks). The complete patch has a scoped-clean Codex P2 review. Hosted fork CI must pass on this branch before merge.

Hosted validation is green on faa4dc840b29eb8528dee3b4c264e34a447ac909: Linux x64, macOS arm64, formatting, JavaScript lint, and source lints. The native run is https://github.com/openclaw/bun/actions/runs/37248965689/attempts/2. macOS needed a same-head retry after the unchanged wall-clock timeout fixture failed, as previously recorded in #105; no timeout assertion or runtime behavior was changed. The independent issue/duplicate-finder bot could not start because its provider credentials are not configured in the fork.

Adapt oven-sh#41769 while retaining owned bytecode payloads. Every run uses the ordinary unlinked program path.

Co-authored-by: robobun <robobun@oven.sh>
@steipete
steipete merged commit a852955 into main Oct 5, 2026
9 of 11 checks passed
@steipete
steipete deleted the claude/w154-vm-cached-data-jitless branch October 5, 2026 01:35
steipete added a commit that referenced this pull request Oct 5, 2026
Explicitly empty vm.Script cachedData now reports cachedDataRejected=true while preserving source execution and produceCachedData regeneration, matching Node 24.

Extend the cachedData crash coverage from oven-sh#41769 and the credited standalone port in #118. Thanks @robobun for identifying and removing the constructor's unused JIT compilation. Preserve owned-payload decoding and the standalone fork-main boundary; no engine artifact or private-cache promotion changes.

Add default, interpreter, baseline, DFG, and FTL subprocess coverage for produce/createCachedData round-trips, buffer mutation/GC, context execution, rejection, regeneration, and an actual older-version payload. Correct three stale constructor-column expectations in the Node VM suite without changing runtime stack behavior or weakening the other assertions.

Validation: symbolized the Linux parent crash at 0x4e0. The patched interpreter, 2 GiB RLIMIT_AS, and systemd MemoryDenyWriteExecute cases pass. All 363 VM tests, 99 Node VM result rows, 47 fork-selection rows, and 98 OpenClaw consumer tests pass. Corrected Node fixtures also pass on unchanged main and Node 24. Complete P2 autoreview is scoped-clean. Both fork CI lanes, formatting, JavaScript lint, and source lints passed on exact head a915fd1. CI: https://github.com/openclaw/bun/actions/runs/37255516055 (attempt 1). Upstream proof: oven-sh#41769 (comment).
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