Skip to content

util: do not retry close after EINTR - #461

Open
tokenjunkielabs wants to merge 2 commits into
Tarsnap:masterfrom
woahwhattheheck:zz-sol-delta/close-eintr-20260920
Open

tokenjunkielabs wants to merge 2 commits into
Tarsnap:masterfrom
woahwhattheheck:zz-sol-delta/close-eintr-20260920

Conversation

@tokenjunkielabs

@tokenjunkielabs tokenjunkielabs commented Sep 21, 2026 •

Copy link
Copy Markdown

Fixes #460.

Stop retrying close() after EINTR in two cleanup paths:

  • /dev/urandom teardown in entropy_read_done();
  • IPC synchronization pipe-end teardown through a shared ipc_sync_close() helper.

On systems where the descriptor has already been released before EINTR is returned, retrying can close a descriptor which another thread has since acquired. The patch treats EINTR as non-retry cleanup and preserves error reporting for every other failure.

Reporter / bounty claimant: @woahwhattheheck
Exact source head: 1e576fd56f78a6aed950c6160a7d71ef76cd2b0d

AI disclosure (per AGENTS.md): This PR was prepared with LLM assistance acting on behalf of Bryce / @woahwhattheheck through @tokenjunkielabs. Bryce is available to discuss the finding and revise the patch in response to maintainer review.

@tokenjunkielabs

Copy link
Copy Markdown
Author

Maintainer review requested. The PR changes only cleanup handling of close() returning EINTR in the two identified utility paths. Please merge if acceptable or leave concrete change requests on this carrier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

[bug bounty] retrying close after EINTR can close a reused descriptor

2 participants