Skip to content

fix: purge-holes secure guard-page segfault, C++ test scope, scavenger-polluted pacing test (#618) - #622

Merged
zackees merged 2 commits into
mainfrom
fix/618-purge-test-blockers
Oct 23, 2026
Merged

zackees merged 2 commits into
mainfrom
fix/618-purge-test-blockers

Conversation

@zackees

@zackees zackees commented Oct 23, 2026

Copy link
Copy Markdown
Owner

Closes #618. The fixes from draft #616, split out because V7 itself was rejected (see #616). All three defects reproduce on main (227eef0); none depends on V7.

  1. Allocator: secure guard-page segfault. mi_page_discard_slack ran its range up to the end of the slices, which includes the MI_SECURE≥5 trailing PROT_NONE guard page. The scavenger's eager-zero memset there segfaulted every time (idle-thread-releases-large-page, secure C++ build; backtrace in fix: resolve purge-test C++ compilation and pacing validation blockers #618). The range now stops before the guard page, matching page_noguard_size in arena.c. RED: SIGSEGV 3/3. GREEN: 32/32, 3/3 runs.
  2. Test: C++ scope. test_owner_sweep_pacing's early goto done crossed initialized locals, which C++ rejects (MI_USE_CXX). An inner scope fixes it; reads, checks and cleanup are unchanged. RED: compile error at line 1939. GREEN: compiles.
  3. Test: pacing pollution. new-thread-does-not-sweep-at-once counted process-wide discards, so a background scavenger sweep was charged to thread C. Under load: 33/144 failures at 227eef0, 0/144 with the scavenger off. The test now runs in its own process with no scanner (test-new-thread-pacing, static builds), like test-reserved-page-reuse. The thresholds are unchanged, and the background-release cases still run with the scavenger on.

Local: Release 70/70, shared 38/38, secure C++ purge-holes 3/3 runs, plus the ctest runs on #616's head (owner-gate Debug 86/86). The same fixes passed #616's full PR CI, including native MSVC and win-gnu. C and Rust vendor are in separate commits. Local gate passed.

Not fixed here: #619 (test-fork-locks C++ link failure, pre-existing).

🤖 Generated with Claude Code

…luted pacing test (#618)

- page-holes.c: mi_page_discard_slack ran its range to the end of the
  slices, over the MI_SECURE>=5 trailing PROT_NONE guard page; the
  scavenger's eager-zero memset there segfaulted (idle-thread-releases-
  large-page, deterministic in a secure C++ build). Stop before the guard,
  as arena.c's page_noguard_size does.
- test-purge-holes.c: scope test_owner_sweep_pacing's measurement locals
  so its early goto done is valid C++ (MI_USE_CXX); reads unchanged.
- new-thread-does-not-sweep-at-once counted process-wide discards, so a
  background scavenger sweep of thread A's page during C's life was
  charged to C (loaded: 33/144 fail at 227eef0; 0/144 with the scavenger
  off). Run it in its own process with no scanner (test-new-thread-pacing,
  static builds), as test-reserved-page-reuse does.

Split out of the rejected V7 draft #616 so the fixes land on their own.
Local-Gate: v1 tree=4e8686a912585756840b5a6d1bb1f4a6993c6a78 secs=73 lanes=lint:run
Ci-Attestation: {"at":1792738979,"gate":"python/all/lint","host":"linux-x86_64","key":"a205b85527b6c381cb0d7b1b8f84a8462b6b50492a47b48b07c583ea0879eb00","lane":"lint","parents":["322fd8352a89f7ed4d063c486a8a4742d0cb2c37"],"secs":73,"stamp":"8bfbb21af4ce30960798d94dba866ac8","tree":"4e8686a912585756840b5a6d1bb1f4a6993c6a78","v":1,"via":"run"}
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.

fix: resolve purge-test C++ compilation and pacing validation blockers

1 participant