Skip to content

fix: delete the file instead of truncating it when updating busy executable#1466

Merged
davidlattimore merged 1 commit into
wild-linker:mainfrom
karolzwolak:fix-text-file-is-busy
Jan 18, 2026
Merged

fix: delete the file instead of truncating it when updating busy executable#1466
davidlattimore merged 1 commit into
wild-linker:mainfrom
karolzwolak:fix-text-file-is-busy

Conversation

@karolzwolak

@karolzwolak karolzwolak commented Jan 17, 2026

Copy link
Copy Markdown
Contributor

When we try to update a running executable, and we fail because the file is busy, we retried with truncate which fails too. Instead, we have to remove the file, and create it again.

I encountered this bug sporadically when building stuff in the LLVM repo.

@karolzwolak

Copy link
Copy Markdown
Contributor Author

I don't think our tests infra can tests this scenario. We'd have to have to try to modify some binary while it was running. Maybe we can rely on mold test suite to cover this.

@karolzwolak

Copy link
Copy Markdown
Contributor Author

I see no new passes on mold test suite.
But weirdly enough, --gbd-index tests that should be failing, are passing (not that this changed with this PR).

@lapla-cogito lapla-cogito left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I haven't reviewed the changes for this PR yet, but the issue related to the mold test suite appears to have existed for some time, specifically starting from this commit. Therefore, your changes are likely unrelated to this problem. (I'll take a look that when I have some available time.)

@davidlattimore davidlattimore left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for noticing and fixing this!

@davidlattimore davidlattimore merged commit b1baf7a into wild-linker:main Jan 18, 2026
20 checks passed
lapla-cogito added a commit that referenced this pull request Jan 21, 2026
context:
#1466 (review)

Some mold tests check for specific tool availability and skip them if
the tool is missing (e.g., `command -v gdb >& /dev/null || skip`), which
can lead to tests passing accidentally if additional packages aren't
installed.
@karolzwolak karolzwolak deleted the fix-text-file-is-busy branch January 26, 2026 19:41
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.

3 participants