Repository navigation
Conversation
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.
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.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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_DIRand 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 whenTEST_TIMEOUT=0(whichtimeout(1)treats as no limit). Refactors the fourconfstr(_CS_DARWIN_USER_TEMP_DIR)path builders insrc/syscall/proc.cinto oneprivate_tmp_pathhelper, keeping file names, bounds checks, and fail-closed returns unchanged.Written for commit b2ff765. Summary will update on new commits.