-
Notifications
You must be signed in to change notification settings - Fork 18k
go/build: Quadratic complexity in Context.Import #63966
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
Comments
I appear not to have the permissions needed to view that issue. Can you summarize it here? |
How would the
I don't see how it would end up being treated as such a list — what leads you to believe that it does? |
There is nothing more there beyond the reproducer https://go.dev/play/p/R_pJ6FL70Ok
I am not sure there is an issue indeed... But it looks a bit fishy (I do not see any warning in the documentation, and this is the first time ngolo-fuzzing finds something for
If the value gets shorter, we do not get the timeout any longer... |
I would guess that the quadratic behavior comes from the calls to Since we don't expect |
I ran a profile.
Then searchVendor looping over the srcDir being split over `/
I am ok for closing this |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
It happens only on gotip, not on go 1.21
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Run https://go.dev/play/p/R_pJ6FL70Ok
What did you expect to see?
The program finishing and printing Hello
What did you see instead?
timeout running program
Found by https://github.com/catenacyber/ngolo-fuzzing with oss-fuzz :
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=63873
This looks due to a quadratic complexity between the number of directories in GOPATH for the build.Context (which do not seem to get deduplicated) and the number of colon-separated entries in srcDir argument for https://pkg.go.dev/go/build@go1.21.3#Context.Import
The documentation does not seem to mention that
srcDir
gets interpreted as a colon-separated list of entries...Is this a problem ?
The text was updated successfully, but these errors were encountered: