-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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
path/filepath: endless loop in EvalSymlinks because it resolves a link to the same path it asked for #40176
Comments
The code path also is not using go API surface or private internal code paths that public go API surface uses to do path math and gets it wrong. |
@gopherbot add OS-Windows |
@ericwj thank you for creating this issue. I think this issue is a duplicate of #39786. Same reproduction steps as per @networkimprov (see #39786 (comment)). No? Alex |
Not really, the code paths are different. This one fails for links to a target volume that does have a DOS device name (C:\EmptyDir) while the other one only fails for links to a target volume that doesn't ( I think the confusion is that the other issue was filed with the error that occurs here, while in the description it sais that the situation had been that there was no DOS device name. But then you don't get the 'too many links' error. |
If this is not a dup of #39786. I am happy to investigate this separately. But I cannot run your steps. See #39786 (comment) for details. Alex |
This failure mode can be reproduced without Hyper-V with the code snippet down below. In fact, it reproduces on all OSes, not only on Windows. Note that my reproducer is quite stupid and probably not something that someone would do, @ericwj's one interesting to demonstrate a real use case. package main
import (
"fmt"
"os"
"path/filepath"
)
func main() {
err := os.Symlink("./self", "./self")
if err != nil {
panic(err)
}
p, err := filepath.EvalSymlinks("./self")
if err != nil {
panic(err)
}
fmt.Println(p)
} |
Change https://go.dev/cl/453915 mentions this issue: |
In the example of
I'm not familiar with the Windows filesystem operations in the original example in this issue, so I'm not certain what the correct behavior there is. |
@neild in your example, |
The equivalent to what
|
My bad, I thought |
Change https://go.dev/cl/516695 mentions this issue: |
Change https://go.dev/cl/536655 mentions this issue: |
Change https://go.dev/cl/565136 mentions this issue: |
What version of Go are you using (
go version
)?1.14.4
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?Windows
What did you do?
What did you expect to see?
"$PWD\Test"
What did you see instead?
EvalSymlinks: too many links
The text was updated successfully, but these errors were encountered: