Skip to content

fix-bkinterp-concurrency-issues#359

Merged
jhheider merged 1 commit into
mainfrom
fix-bkinterp-concurrency-issues
Jun 26, 2026
Merged

fix-bkinterp-concurrency-issues#359
jhheider merged 1 commit into
mainfrom
fix-bkinterp-concurrency-issues

Conversation

@jhheider

Copy link
Copy Markdown
Contributor

fix race condition with r/w handles in the bkinterp relocator.

Copilot AI review requested due to automatic review settings June 26, 2026 22:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to fix a race condition in bkinterp when multiple concurrent invocations (e.g., make -jN) attempt to read/patch the same wrapped binary, reducing ETXTBSY failures during execve.

Changes:

  • Switch PT_INTERP inspection to read-only and close the fd before any poke/exec path.
  • Open the target writable only when a PT_INTERP “poke” is actually required.
  • Add retry logic around execveZ to handle brief “text file busy” windows during concurrent pokes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread share/brewkit/bkinterp.zig
@jhheider jhheider merged commit a478884 into main Jun 26, 2026
39 checks passed
@jhheider jhheider deleted the fix-bkinterp-concurrency-issues branch June 26, 2026 22:54
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.

2 participants