Repository navigation
JIT: find the GC runtime next to tslang, and say so when it is missing - #633
Merged
Merged
Conversation
The JIT looked for TypeScriptRuntime in --tslang-lib-path, ../lib and the current folder, never in tslang's own folder - where the release package puts it. Run from a project folder (a VS Code launch with cwd = workspace) it found none and went on without one, so on Linux the default library failed mid-run with "symbol lookup error: ... undefined symbol: GC_malloc". tslang's own folder is now the last place it looks, and -mm=gc with no runtime anywhere is an error naming the file and the two ways to pass it. The Linux collector test runs a hard-linked tslang from a package-like folder with no --tslang-lib-path: refused without the runtime next to it, passing with. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ge folder Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ld layout) Without it, a JIT run in the Linux build tree with no runtime passed stopped on the missing-runtime error before lowering could report the program's own error (test-jit-main-argv-string-array-error). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 22, 2026
ASDAlexander77
added a commit
that referenced
this pull request
Oct 23, 2026
A global, or a global's field, given to a call as a view - an interface,
a base class, an object literal holding it - and given a new value by a
later argument of the same call (`f(G, (G = mk(), x))` with an interface
parameter, `f({ v: G.v }, (G = mk(), x))`) was freed before the call ran.
The view is made at the call, after every argument is evaluated, and
holdGlobalArguments did not see through it: `globalOf` stopped at
`ts.NewInterface`, and an object literal holds what it was given with no
count until it is boxed for the interface, at the call too. Under rc the
hold now keeps the value behind the view - the object a cast or an
interface is made over, or each value stored into the literal's slot -
retained where it is read (#647). The fuzzer (#646) found these as A1's
view variant; they failed on #633 as well.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
Running the alpha105 package's JIT from a project folder on Linux (a VS Code GDB launch with
cwd = ${workspaceFolder}) failed mid-run:The JIT looked for
libTypeScriptRuntimeonly in--tslang-lib-path/TSLANG_LIB_PATH,../librelative to the current folder, and the current folder. It never looked in tslang's own folder, which is where the package ships it. When it found nothing it carried on without the runtime and printed nothing (the error was commented out). #632's load-order fix only helps when the runtime is found.Change (
tslang/tslang/jit.cpp)bin) and in../libbeside tslang (the Linux build tree).-mm=gc, finding no runtime is now an error that names the file and says how to pass it (--tslang-lib-pathor--shared-libs). Before, the run failed later on an unresolvedGC_*symbol.Test (
defaultlib-collector.cmake, Linux JIT)A hard-linked
tslangin a folder laid out like the package, run from another folder with no--tslang-lib-path:bad: 0)Verified
DEFAULT_LIB_PATHset to the alpha105 package's default library: 4838/4838 passed, includingtest-jit-gc-defaultlib-collectorand its new runs.--tslang-lib-pathfixed it.Note: under
-mm=gca missing runtime is reported before lowering, so it comes ahead of any lowering error in the program. That is why../libbeside tslang is searched, so the Linux build tree's own tests find the runtime.🤖 Generated with Claude Code