Repository navigation
fix(runner): stop leaking two descriptors per path argument - #1462
Merged
Chemaclass merged 1 commit intoNov 7, 2026
Merged
Conversation
cmd_test read each path argument through two process substitutions. Bash 3.x keeps their descriptors until the function returns, so a run given many files by name leaked two per file. Apple's Bash 3.2 corrupts its heap near 256 of them, which killed make test, make test/parallel and make test/strict on macOS. parse_file_path_filter now returns through slots, and the file lists for test and bench are captured once per argument and read from a here-string. Closes #1461
Chemaclass
deleted the
fix/1461-make-test-targets-are-killed-exit-137-on-macos
branch
November 7, 2026 18:22
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.
Summary
Closes #1461.
make test,make test/parallelandmake test/strictdied on macOS with exit 137 (or 134) before any test ran. The macOS crash report shows Apple's/bin/bash3.2 aborting inreallocwith "pointer being freed was not allocated". Bash 5.3 ran the same command fine.The cause was the loop in
cmd_testthat reads each path argument. It used two process substitutions per argument (< <(parse_file_path_filter ...)and< <(find_files_recursive ...)). Bash 3.x keeps those descriptors open until the function returns, so passing files by name leaked two per file. The Makefile passes about 241 paths, and Bash 3.2 corrupted its heap at about 126 of them, close to 256 open descriptors. Running against thetestsfolder passes one argument, which is why./bashunit testsworked.Changes
parse_file_path_filtersets_BASHUNIT_HELPER_PARSED_PATH_OUTand_BASHUNIT_HELPER_PARSED_FILTER_OUTinstead of printing two lines. One fewer subprocess per argument.cmd_testandcmd_benchcapturefind_files_recursiveonce per argument and read the result from a here-string.|| truekeeps the old behavior of ignoringfind's exit status, so a glob matching nothing still reports "No tests found".Test plan
cannot duplicate fd: Too many open files.make test,make test/parallel,make test/stricton macOS with/bin/bash3.2: 2835 passed, no crashmake sa,make lint