Skip to content

fix: memcheck's guard-page overhead and three real leaks; add Codecov - #210

Merged
omdxp merged 4 commits into
mainfrom
memcheck-vm-max-map-count-and-codecov
Oct 21, 2026
Merged

omdxp merged 4 commits into
mainfrom
memcheck-vm-max-map-count-and-codecov

Conversation

@omdxp

@omdxp omdxp commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • memcheck: small allocations (<=4096 bytes, in 64/256/1024/4096 classes) now share guarded slab arenas instead of paying dedicated guard pages each, fixing real OOM on compile-heavy test files under -memcheck in CI
  • memcheck: an unconditional exit-time sweep catches a slab overflow that's never freed before the process exits
  • fls: fixed an 8-site leak of read_to_string's result in symbols.fn/completion.fn/navigation.fn
  • codegen: format()'s vargs unpacking now always frees a string slot instead of assuming it's borrowed
  • ci: upload coverage to Codecov; docs/tooling.md's example bumped to codecov-action v5

Test plan

  • Full local suite (fun test .), 56/56
  • 3-stage bootstrap to a fixed point (stage2 == stage3 binary)
  • fun -fmt-check-all clean
  • scripts/run_examples.sh, 0 unexpected failures
  • fun test . -memcheck run in a Docker container matching CI's spec (ubuntu 24.04 arm64, 16GB RAM/16GB swap cap, 4 CPU), 53/56 - remaining 3 are this stripped container missing git/openssl-dev, confirmed unrelated to memcheck

omdxp added 4 commits October 21, 2026 02:42
read_to_string's result was never freed across 8 call sites that parse an import's file text standalone.
format()'s vargs unpacking skipped freeing string slots on the assumption they're always borrowed, leaking a caller's heap-built string.
Per-allocation guard pages exceeded a CI runner's memory budget on compile-heavy files; small allocations now share one guarded arena per size class instead.
Also updates docs/tooling.md's codecov-action example to v5 with a token, matching ci-dev.yml.
@codecov-commenter

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@omdxp
omdxp merged commit b1e79c6 into main Oct 21, 2026
4 checks passed
@omdxp
omdxp deleted the memcheck-vm-max-map-count-and-codecov branch October 21, 2026 00:47
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.

2 participants