Skip to content

work around linux not honoring write_at for O_APPEND files - #143166

Open
the8472 wants to merge 2 commits into
rust-lang:mainfrom
the8472:fix-write-at-append
Open

the8472 wants to merge 2 commits into
rust-lang:mainfrom
the8472:fix-write-at-append

Conversation

@the8472

@the8472 the8472 commented Jun 28, 2025 •

Copy link
Copy Markdown
Member

View all comments

The workaround applies on kernels >= 6.9 according to the manpage.
It doesn't work on GHA runners, I suspect virtualization issues, maybe a faulty virtio implementation.
But both on my local machine and on the dev-desktop it works.

running test_append_write_at under strace:

strace: Process 460033 attached
[pid 460033] uname({sysname="Linux", nodename="dev-desktop-eu-1.infra.rust-lang.org", ...}) = 0
[pid 460033] openat(AT_FDCWD, "/tmp/rust-2231989334/file_test_append_write_at.txt", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666) = 3
[pid 460033] write(3, "it's not working!", 17) = 17
[pid 460033] openat(AT_FDCWD, "/tmp/rust-2231989334/file_test_append_write_at.txt", O_WRONLY|O_APPEND|O_CLOEXEC) = 3
[pid 460033] pwritev2(3, [{iov_base="   ", iov_len=3}], 1, 5, 0x20 /* RWF_??? */) = 3
[pid 460033] openat(AT_FDCWD, "/tmp/rust-2231989334/file_test_append_write_at.txt", O_RDONLY|O_CLOEXEC) = 4
[pid 460033] openat(AT_FDCWD, "/tmp/rust-2231989334", O_RDONLY|O_NOFOLLOW|O_CLOEXEC|O_DIRECTORY) = 3
[pid 460033] +++ exited with 0 +++
[pid 460032] write(1, "{ \"type\": \"test\", \"name\": \"os::u"..., 92) = 92
[pid 460032] write(1, "{ \"type\": \"suite\", \"event\": \"ok\""..., 137) = 137
[pid 459907] write(1, ".", 1.)           = 1
[pid 459907] write(1, "\n", 1
)          = 1
[pid 459907] write(1, "\n", 1
)          = 1
[pid 459907] write(1, "test result: ok. 1 passed; 0 fai"..., 101test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 477 filtered out; finished in 794.28µs

somewhat fixes #140867

@rustbot

rustbot commented Jun 28, 2025

Copy link
Copy Markdown
Collaborator

r? @thomcc

rustbot has assigned @thomcc.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jun 28, 2025
@rust-log-analyzer

This comment has been minimized.

@the8472
the8472 force-pushed the fix-write-at-append branch from b6ebbf6 to 8b87324 Compare June 29, 2025 14:48
@rust-log-analyzer

This comment has been minimized.

@the8472

the8472 commented Jun 29, 2025

Copy link
Copy Markdown
Member Author

Weird, the kernel should be new enough.

@the8472
the8472 force-pushed the fix-write-at-append branch from 8b87324 to bd44b22 Compare June 30, 2025 21:59
@rust-log-analyzer

This comment has been minimized.

@the8472
the8472 force-pushed the fix-write-at-append branch from bd44b22 to 9e75dad Compare June 30, 2025 22:27
@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Jun 30, 2025
@rust-log-analyzer

This comment has been minimized.

@the8472
the8472 force-pushed the fix-write-at-append branch from 9e75dad to 0d89239 Compare June 30, 2025 23:05
@rust-log-analyzer

This comment has been minimized.

@bors

bors commented Jul 3, 2025

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #143294) made this pull request unmergeable. Please resolve the merge conflicts.

@the8472
the8472 force-pushed the fix-write-at-append branch from 0d89239 to 23ca6f2 Compare July 5, 2025 11:26
@rust-log-analyzer

This comment has been minimized.

@the8472
the8472 force-pushed the fix-write-at-append branch from 23ca6f2 to 614bbb8 Compare July 5, 2025 11:35
@rust-log-analyzer

This comment has been minimized.

@the8472
the8472 force-pushed the fix-write-at-append branch from 614bbb8 to f23f736 Compare July 5, 2025 12:02
@rust-log-analyzer

This comment has been minimized.

@the8472
the8472 force-pushed the fix-write-at-append branch from f23f736 to e8c7701 Compare July 5, 2025 12:22
@rust-log-analyzer

This comment has been minimized.

@the8472
the8472 force-pushed the fix-write-at-append branch 2 times, most recently from 9b85793 to 705d195 Compare July 5, 2025 12:51
@rust-log-analyzer

This comment has been minimized.

@the8472

the8472 commented Jul 5, 2025 •

Copy link
Copy Markdown
Member Author

At this point I'm fairly sure this is a kernel bug in the runner. Tests pass locally, the pwritev2 also happens in CI and doesn't return an error, meaning the flag should be supported.

Filed actions/runner-images#12530

@rust-log-analyzer

This comment has been minimized.

@the8472 the8472 added the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Dec 26, 2025
@rust-bors

This comment has been minimized.

@the8472
the8472 force-pushed the fix-write-at-append branch from 777c463 to 7c4de82 Compare August 2, 2026 21:40
@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@the8472
the8472 force-pushed the fix-write-at-append branch from 7c4de82 to 4dc4ac0 Compare November 7, 2026 19:54
@rustbot rustbot added the A-filesystem Area: `std::fs` label Nov 7, 2026
@rustbot

rustbot commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rust-log-analyzer

This comment has been minimized.

@the8472
the8472 force-pushed the fix-write-at-append branch from 4dc4ac0 to 71ee42c Compare November 7, 2026 20:27
@rustbot

This comment was marked as outdated.

@the8472
the8472 force-pushed the fix-write-at-append branch from 71ee42c to 98dfe5c Compare November 7, 2026 20:35
@rust-log-analyzer

This comment has been minimized.

@the8472

the8472 commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Still broken on ubuntu 26.06. I now suspect something is wrong with GHA, not the ubuntu kernel.

I'll just ignore those tests when detecting an azure kernel.

@the8472
the8472 force-pushed the fix-write-at-append branch 2 times, most recently from da8cf5e to 18f3644 Compare November 7, 2026 22:20
@the8472

the8472 commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

@rustbot ready

@the8472 the8472 removed the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Nov 7, 2026
@rust-log-analyzer

This comment has been minimized.

@the8472
the8472 force-pushed the fix-write-at-append branch from 18f3644 to 556f934 Compare November 7, 2026 22:49
@rust-log-analyzer

This comment has been minimized.

@the8472
the8472 force-pushed the fix-write-at-append branch from 556f934 to 3447db7 Compare November 7, 2026 23:01
@rust-log-analyzer

This comment has been minimized.

@the8472
the8472 force-pushed the fix-write-at-append branch from 3447db7 to eec626f Compare November 7, 2026 23:51
@rust-log-analyzer

This comment has been minimized.

@the8472
the8472 force-pushed the fix-write-at-append branch from eec626f to db01fe3 Compare November 8, 2026 00:22

This branch has not been deployed

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

Labels

A-CI Area: Our Github Actions CI A-filesystem Area: `std::fs` A-testsuite Area: The testsuite used to check the correctness of rustc O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue with write_all_at on GitHub Action

5 participants