Skip to content

Find the stale-pid test's registry by its members - #443

Merged
jserv merged 2 commits into
mainfrom
fix
Oct 16, 2026
Merged

jserv merged 2 commits into
mainfrom
fix

Conversation

@jserv

@jserv jserv commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

test-registry-stale-pid failed on main (https://github.com/sysprog21/elfuse/actions/runs/38861780525) with "expected one new registry ... saw 'elfuse-procs-10730122573492932859 elfuse-procs-17723615197976724426'". Concurrent runners of the same user share DARWIN_USER_TEMP_DIR, so the recipe's "the one new elfuse-procs-* file" picked up a registry from another lane. The recipe now keeps only a new registry holding records for the family root and one of its children, and the READY wait follows TEST_TIMEOUT instead of a fixed 5 seconds.

The first commit folds the four confstr(_CS_DARWIN_USER_TEMP_DIR) path builders in src/syscall/proc.c into one helper. It changes no file name and no failure path.

Verified on macOS Apple Silicon: make check passes; test-registry-stale-pid passes alone and with four copies run at once, the case that failed in CI; make check-format and make check-ascii are clean.


Summary by cubic

Fixes the stale-pid registry test failing on macOS CI, where concurrent runners shared DARWIN_USER_TEMP_DIR and the test picked up a registry from another lane.

The recipe now selects the new registry by its contents (records for the family root and one child) instead of by being the only new file, and the READY wait follows TEST_TIMEOUT, falling back to a fixed 5 seconds when TEST_TIMEOUT=0 (which timeout(1) treats as no limit). Refactors the four confstr(_CS_DARWIN_USER_TEMP_DIR) path builders in src/syscall/proc.c into one private_tmp_path helper, keeping file names, bounds checks, and fail-closed returns unchanged.

Written for commit b2ff765. Summary will update on new commits.

View guided diff Turn on auto-fix

The pid sequence, signal transport, process registry and lifecycle
registry each repeated the same confstr(_CS_DARWIN_USER_TEMP_DIR)
lookup, snprintf and bounds check. private_tmp_path now does it once,
and the security rationale for the 0700 per-user directory sits on that
helper instead of on only one of its four users. File names and the
fail-closed returns are unchanged.
cubic-dev-ai[bot]

This comment was marked as resolved.

test-registry-stale-pid took the one elfuse-procs-* file that appeared
in DARWIN_USER_TEMP_DIR while it ran. Concurrent runners of the same
user share that directory, so a CI host running two lanes saw two new
registries and failed. The recipe now keeps only a new registry that
holds records for the family root and one of its children; the
snapshot of files present before the run still excludes leftovers whose
pids macOS has since reused.

The READY wait also follows TEST_TIMEOUT instead of a fixed 5 seconds,
so a loaded host does not give up before the family's own timeout. A
zero, which timeout(1) takes as no limit, keeps the 5 second wait.
@jserv
jserv merged commit b5e3fe8 into main Oct 16, 2026
15 checks passed
@jserv
jserv deleted the fix branch October 16, 2026 14:01
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