-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: RemoveAll failing silently in go 1.12.2 when removing non-empty directories at / #31468
Comments
Interestingly, I can delete |
This might be the culprit - if I revert this line it works as I expect: d039e12#diff-55fac2af5cab3979fb5c47e41d21e0e4L54 |
Resolved in PR - will sign CLA and other admin tomorrow. |
Thanks--I have a slightly different patch with a test. |
@gopherbot please open backport to 1.12 |
Backport issue(s) opened: #31474 (for 1.12). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases. |
Change https://golang.org/cl/172058 mentions this issue: |
@ianlancetaylor I was thinking about how I'd write a test for this given I'd need to write at / to reproduce with RemoveAll, but saw the export test file - neat trick! |
Change https://golang.org/cl/172080 mentions this issue: |
…"x") Updates #31468 Fixes #31474 Change-Id: I5c4e61631b8af35bfc14b0cb9bc77feec100e340 Reviewed-on: https://go-review.googlesource.com/c/go/+/172058 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> (cherry picked from commit 3ebd952) Reviewed-on: https://go-review.googlesource.com/c/go/+/172080
What version of Go are you using (
go version
)?1.12.{2|3|4}
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I work on the garden project, we help orchestrate container lifecycle operations. I bumped the version of go 1.12.4 we build with and saw a consistent failure in our CI for a test related to removing a file.
I see the same failure on go 1.12.2 and go 1.12.3, but not on go 1.12.1.
I have reproduced the issue with a small go binary here (I'm going to continue to tease out the issue here, for now it's doing roughly what my code in the garden project is doing):
Edited with simpler solution: the problem seems to occur when I try to RemoveAll a directory positioned at
/
after having ChDir'd to/
.Edited again: Chdir is not needed to repro
I run
make
with this makefile... and observe a panic on
"what?"
(indicating that I was able to stat a file I just deleted).When I run
make tag=1.12.1-alpine3.9
I observe no panic.What did you expect to see?
I expect this snippet to not panic.
What did you see instead?
The snippet panics on go 1.12.2+ but not on 1.12.1.
The text was updated successfully, but these errors were encountered: