Skip to content

pref: re-enable boehm GC by default for musl (fix #27090) - #27220

Merged
medvednikov merged 1 commit into
masterfrom
worktree-fix-27090-alpine-gc
May 24, 2026
Merged

medvednikov merged 1 commit into
masterfrom
worktree-fix-27090-alpine-gc

Conversation

@medvednikov

Copy link
Copy Markdown
Member

Summary

  • Reverts the || p.is_musl clause in vlib/v/pref/default.v introduced by 6978ca9, which was disabling the GC for all Alpine/musl builds in an attempt to work around the old Segfaults when using gc on musl-based systemΒ #14737 segfault (V 0.2.4).
  • That change caused the regression reported in [Alpine] without GC by defaultΒ #27090: the issue's repro grows to 5 GB+ of RAM on Alpine with the default flags, but stays at ~4 KB with -gc boehm.
  • Restores the pre-regression help text in build-c.txt and the unknown--gc error message in pref.v to their original wording.
  • Replaces test_musl_defaults_to_no_gc / test_musl_keeps_explicit_gc_selection with a single regression test test_musl_still_defaults_to_boehm_gc referencing [Alpine] without GC by defaultΒ #27090.

Boehm GC works on current musl/Alpine; anyone who specifically wants -gc none can still pass it explicitly.

Test plan

  • ./v -o vfix cmd/v builds cleanly in the worktree.
  • VFLAGS="-gc none" ./vfix test vlib/v/pref/pref_test.v passes (including the new regression test).
  • ./vfix -musl examples/hello_world.v builds and runs.
  • CI on Alpine / docker-ubuntu-musl jobs.

Commit 6978ca9 made musl-based targets default to `-gc none` to
sidestep an old Alpine segfault (#14737 from V 0.2.4). The downside,
reported in #27090, is that all Alpine binaries now run without a GC
and grow without bound β€” the repro from the issue eats 5 GB+ of RAM
where `-gc boehm` finishes in 4 KB.

Boehm GC works on current musl/Alpine, so revert the special case and
restore the historical default. Users who specifically need `-gc none`
can still pass it explicitly.
@medvednikov
medvednikov merged commit 5db35ea into master May 24, 2026
4 of 161 checks passed
@JalonSolov
JalonSolov deleted the worktree-fix-27090-alpine-gc branch July 28, 2026 01:12
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