Skip to content

🐛 fix(probe): don't hang on macOS closing fds before exec - #282

Merged
gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:fix/probe-close-fds
Nov 28, 2026
Merged

gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:fix/probe-close-fds

Conversation

@gaborbernat

Copy link
Copy Markdown
Member

virtualenv's macOS CI hangs in the interpreter probe (main run, PR run). The sample of the stuck child shows it blocked in close() inside CPython's close_fds loop, before exec:

678 child_exec  (in python3.15) + 1076
  678 _close_open_fds_maybe_unsafe  (in python3.15) + 232
    678 close  (in libsystem_kernel.dylib) + 8

The parent waits on that child in Popen.__init__ until pytest times out. The probe now passes close_fds=False, which skips the loop; Python opens descriptors non-inheritable since PEP 446, so nothing extra leaks into the probe.

@gaborbernat gaborbernat added the bug Something isn't working label Nov 28, 2026
virtualenv's macOS CI hung in the interpreter probe: the forked child sat
in close() inside CPython's close_fds loop before exec, and the parent
waited on it until the test timed out. Python opens descriptors
non-inheritable, so the probe passes close_fds=False and skips that loop.
@gaborbernat
gaborbernat merged commit 6ebd906 into tox-dev:main Nov 28, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant