-
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
x/tools/gopls: stack overflow when autocompleting #37104
Comments
Thank you for filing a gopls issue! Please take a look at the Troubleshooting guide, and make sure that you have provided all of the relevant information here. |
Can describe exactly where you were triggering completion to reproduce the crash? |
Yes. I wrote |
What file were you in and what package were you completing? |
It happened in any file, the package I tried to autocomplete was the one generated by gowsdl. I probably cannot share the file as its from a company internal Soap Service. |
Okay I was able to reproduce it: type foo *foo |
Will check at home if I have any of that in the generated code. But it sounds very likely to cause a stack overflow |
Indeed I do have such a thing type Duration *Duration |
Change https://golang.org/cl/218579 mentions this issue: |
I tried your fixed version and can confirm that gopls works fine now. |
Change https://golang.org/cl/219122 mentions this issue: |
We were recursing infinitely evaluating objects of recursive pointer types such as "type foo *foo". Now we track named pointer types we have already seen to avoid trying to dereference such objects forever. I lazily initialized the "seen" map to avoid the allocation in the normal case when you aren't dealing with named pointer types. Fixes golang/go#37104. Change-Id: I5f294cfc5a641e7b5fd24e1d9dc55520726ea560 Reviewed-on: https://go-review.googlesource.com/c/tools/+/218579 Run-TryBot: Muir Manders <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Rebecca Stambler <[email protected]> (cherry picked from commit 61798d6) Reviewed-on: https://go-review.googlesource.com/c/tools/+/219122 Reviewed-by: Heschi Kreinick <[email protected]>
What version of Go are you using (
go version
)?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 generated a SOAP service with https://github.com/hooklift/gowsdl which compiles just fine with "go build". However, if I try to use autocompletion gopls crashes with a stackoverflow. It only happens with the generated soap service. Interestingly the file is linted just fine. Its just the autocompletion
Another interesting detail is after I restart the crashed server and remove the import statement, it will autocomplete, but show everything as a variable.
What did you expect to see?
The autocompletion result of the package.
What did you see instead?
Additional Info
VSCode Settings:
{
"git.autofetch": true,
"go.useLanguageServer": true,
"git.confirmSync": false,
"git.enableSmartCommit": true,
"files.exclude": {
// REDACTED
},
"go.autocompleteUnimportedPackages": true,
}
Gopls Version:
golang.org/x/tools/gopls v0.3.1
golang.org/x/tools/[email protected] h1:yNTWrf4gc4Or0UecjOas5pzOa3BL0WDDyKDV4Wz5VaM=
The text was updated successfully, but these errors were encountered: