-
Notifications
You must be signed in to change notification settings - Fork 279
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
Obscure build failures referencing non-existent code with error "undefined: fs in fs.FileMode" #325
Comments
Just a quick heads up to use the |
Thanks, I do get the same errors with that as well though |
To possibly help narrow the problem, can you try with Go 1.15? |
go1.15 does seem to work |
A good next step likely is going back to Go 1.16 and do The instrumented source for k8s.io/client-go/util/homedir should be located inside a (On mobile, so brief). |
homedir.go.txt Snippet:
Note go 1.16 does add a new "fs" package: https://golang.org/doc/go1.16#fs which may be causing some confusion somehow? I am not too familiar with this, but it seems like perhaps it is wrapping |
Which I think is added here: https://github.com/dvyukov/go-fuzz/blob/master/go-fuzz-build/cover.go#L306 |
I suspect that the https://golang.org/src/os/types.go?s=798:825#L18
|
Hey, I also stepped on this bug while implementing some fuzzing harnesses. If anybody is looking for a workaround for the following error: /home/dc/go/pkg/mod/k8s.io/client-go@v0.20.5/util/homedir/homedir.go:72: undefined: fs in fs.FileMode This can be hotfixed by modifying the problematic file and adding the import (
"os"
"path/filepath"
"runtime"
"io/fs"
)
type X = fs.FileInfo Of course I don't recommend doing this for the long term, but if you need something working right away, this works. |
Hi all, I'm curious if anyone else encountering this issue was able to successfully use the workaround that @disconnect3d suggested immediately above, or on the other hand, if anyone tried that workaround where it seemed to not help? FWIW, when I looked at this briefly when it was first reported, my suspicion was that this has been a latent bug in go-fuzz-build for ~5 years since the introduction of type aliases in Go 1.9, but happens to be getting triggered & reported now thanks to a popular type alias for fs.FileMode introduced in Go 1.16, where that particular type also happens to have a decent shot of being nearby when the |
@thepudds good question and... I don't know, but Trail of Bits have a winternship project which will try to fix this and improve some other things in Go-fuzz. (I know that Go added a beta support for fuzzing, but it seems to me that we are still some time before it will make sense to switch to it) |
I am running into some weird issues trying to run go-fuzz-build.
Reproduction steps:
git clone http://github.com/istio/istio
docker run -v $PWD:$PWD -w $PWD -it --init golang:1.16
But if we look at the file, there is no
fs
reference, nor FileModeLooking at https://github.com/kubernetes/client-go/blob/master/util/homedir/homedir.go, we can also see there have been no changes since 2019 so its not somehow picking up the wrong version I think
cc @AdamKorcz
The text was updated successfully, but these errors were encountered: