This repository was archived by the owner on Oct 7, 2026. It is now read-only.
Repository navigation
Use Serial GC with capped address space for linux-x86_64 binary - #136
Merged
Merged
Conversation
G1 in a static musl image falls back to the legacy vsyscall getcpu, which segfaults on kernels with vsyscall=none such as WSL2 (#86). Cap the reserved heap address space so the binary still starts under ulimit -v (#46), and check that in the smoke test. 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #86.
Cause: with
--gc=G1, the static musl image runs HotSpot'ssched_getcpu_init()at startup. In a static musl binarydlsym(RTLD_DEFAULT, "sched_getcpu")returns null, so it falls back to calling the legacy vsyscallgetcpuat0xffffffffff600800. On kernels booted withvsyscall=none(e.g. WSL2) that page isn't mapped, so the binary segfaults on startup.Fix: go back to the default Serial GC. G1 was introduced in #63 to fix #46: with default settings, Serial GC reserves a large heap address space and fails under
ulimit -vwithFailed to create the main Isolate. To keep #46 fixed, this caps the reservation with-R:ReservedAddressSpaceSize=512m. The heap is already capped atMaxHeapSize=100M.The smoke test now also runs the binary with
ulimit -vset to 2 GB and 1 GB, to cover #46.🤖 Generated with Claude Code