Repository navigation
fix(node:vm): reject empty cached data and cover execution modes - #121
Merged
Merged
Conversation
Extend the cachedData regression from oven-sh#41769 and #118 with per-tier round trips, invalid input, and Bun 1.4.2 cache rejection. Keep source fallback and cache regeneration working without JIT dependence.
The earlier source-position fix now reports constructor columns matching Node. Preserve the existing filename, line-offset, column-offset, and caret checks while replacing old JSC-only column expectations. These corrections pass on unchanged fork main as well as the cached-data candidate, and under Node 24.
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.
The
vm.Scriptconstructor now distinguishes explicitly emptycachedDatafrom an omitted option. Empty data reportscachedDataRejected === true, executes the source normally, and still supportsproduceCachedDataregeneration, matching Node 24.This extends the standalone JIT-unavailable fix in #118 (adapted from oven-sh#41769, thanks @robobun). That fix removes a synchronous baseline compilation of a decoded block that cannot execute. This follow-up preserves decode-only acceptance and owned payload lifetime, and depends only on fork main: no WebKit artifact or private-cache promotion changes.
Fresh-process regressions cover default, interpreter, baseline, DFG, and FTL configurations. Each exercises
produceCachedData,createCachedData()before/after execution, consumption in a separate process, execution in all three context forms after buffer mutation/GC, empty/junk/truncated/source-mismatched data, regeneration, and rejection of a real Bun 1.4.2 payload. The identical assertion fixture passes under Node 24.21.0.The requested broader Node VM run also exposed three stale column expectations from the earlier stack-position fix. This PR corrects those specific expected columns while retaining the filename, line-offset, column-offset, and caret checks. The corrected tests pass on unchanged main, the candidate, and Node 24.
Native Linux release/no-LTO proof against the published WebKit artifact:
4540c115f3: interpreter repro exits 139. LLDB showsconstructScript → JIT::compileSync → emitSlow_op_enter → JITThunks::ctiStub(this=null) → RecursiveLockAdapter::lock(this=0x4e0).a852955d800: the crash repro passes; all five new empty-cache cases fail as expected.Native runtime proof uses
ca9b13163ff; subsequent changes only reposition the changelog and correct the three independently re-run Node fixtures. Hosted CI is green in both fork lanes on exact final heada915fd1ed072d03f009c1049c2958b6df2dcc8b5: https://github.com/openclaw/bun/actions/runs/37255516055 (attempt 1). Formatting, JavaScript lint, and source lints are green too. The valid-cache repro also passes under a 2 GiB address-space limit and systemdMemoryDenyWriteExecute=yes; both restrictions abort the pre-fix binary. Upstream proof update: oven-sh#41769 (comment).