Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os: possible regression from Go 1.23 to Go 1.24 when opening DevNull with O_TRUNC [1.24 backport] #71836

Closed
gopherbot opened this issue Feb 19, 2025 · 2 comments
Labels
CherryPickApproved Used during the release process for point releases
Milestone

Comments

@gopherbot
Copy link
Contributor

@qmuntal requested issue #71752 to be considered for backport to the next 1.24 minor release.

@gopherbot please backport this to go1.24 release.

This issue causes a regression when opening os.DevNull with the os.O_TRUNC bit set.

@gopherbot gopherbot added the CherryPickCandidate Used during the release process for point releases label Feb 19, 2025
@gopherbot gopherbot added this to the Go1.24.1 milestone Feb 19, 2025
@dmitshur dmitshur added CherryPickApproved Used during the release process for point releases and removed CherryPickCandidate Used during the release process for point releases labels Feb 19, 2025
@gopherbot
Copy link
Contributor Author

Change https://go.dev/cl/650597 mentions this issue: [release-branch.go1.24] syscall: don't truncate newly created files on Windows

gopherbot pushed a commit that referenced this issue Feb 19, 2025
…n Windows

There is no need for syscall.OpenFile to truncate newly created files.
Some special Windows files, like the NUL device, can't be
truncated, so we should avoid truncating unless it is really necessary.

For #71752
Fixes #71836

Change-Id: I8238048594f706f6a5281053d55cfe3dc898828d
Reviewed-on: https://go-review.googlesource.com/c/go/+/650276
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Damien Neil <[email protected]>
Reviewed-by: Michael Knyszek <[email protected]>
(cherry picked from commit 4267fd3)
Reviewed-on: https://go-review.googlesource.com/c/go/+/650597
Reviewed-by: Ian Lance Taylor <[email protected]>
Auto-Submit: Ian Lance Taylor <[email protected]>
Commit-Queue: Ian Lance Taylor <[email protected]>
Reviewed-by: Quim Muntal <[email protected]>
@gopherbot
Copy link
Contributor Author

Closed by merging CL 650597 (commit 30f4d9e) to release-branch.go1.24.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CherryPickApproved Used during the release process for point releases
Projects
None yet
Development

No branches or pull requests

2 participants