-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: crash in buildPackageHandle (nil packageHandle) #66414
Comments
Hi, thanks for the report. Is this crash reproducible? |
yes it is `[Error - 9:40:22 PM] Request textDocument/inlayHint failed. [Info - 9:40:52 PM] 2024/03/19 21:40:52 background imports cache refresh starting [Info - 9:40:52 PM] 2024/03/19 21:40:52 background refresh finished after 276.249817ms` |
Thanks. We'll investigate this crash. Do you happen to be working in something that is open source, so that we may try to reproduce? |
Transferring to the Go repo, since this is a gopls issue. Tentatively assigning to the gopls/v0.16.0 milestone for mitigation. This crash would have been present since July, so it seems like it is probably rare. The fact that it is reproducible is interesting though. If we can fully understand the crash, and the fix is safe (and, likely, if there are other reasons to cut a v0.15.3), we can consider fixing this in a patch release. |
@findleyr Do i need to set below value externally ? |
Building that binary on Linux and (I assume) amd64, the failing instruction appears to be the load of ph.refs, i.e.
I do wish gopls would report field offsets in Hover. [Update: I nerdswiped myself: https://go.dev/cl/573076.] |
@adonovan yes, sorry I should have noted that aspect of my investigation. I agree that n.ph must be nil. I didn't spot anything obvious in a quick scan, though could have missed something. My intuition is that there is some sort of cycle that isn't broken properly. We can perhaps create a patch release of gopls with a more useful panic message. |
@rahukarmore I'm not sure I understand. You should not need to set those values in general, unless you have to customize your environment. Generally speaking, if |
@findleyr I appreciate your effort in the investigation.
Error while ctrl+click on some function:
in the meantime, I will try another approach. |
@rahukarmore Looks like at least, gopls doesn't crash according to your last comment (#66414 (comment)). The following setting will enable tracing.
Look for message exchanges or suspicious error message around "textDocument/definition" rpcs. |
@rahukarmore could you also please try installing gopls with a more recent version of Go (preferably Go 1.22)? |
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
@findleyr, the issue has been resolved. There were duplicate vendor files located in the same folder. Additionally, I updated the gopls to the latest version. Thank you so much for your support. |
When I try to use ctrl + click in VS Code, it doesn't work. I suspect there's an error.
gopls version: v0.15.2/go1.20.2
gopls flags:
update flags: proxy
extension version: 0.41.2
environment: Visual Studio Code linux
initialization error: undefined
issue timestamp: Tue, 19 Mar 2024 13:29:56 GMT
restart history:
Tue, 19 Mar 2024 13:29:44 GMT: activation (enabled: true)
ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.
Describe what you observed.
gopls stats -anon
gopls stats -anon failed after 1191 ms. Please check if gopls is killed by OS.OPTIONAL: If you would like to share more information, you can attach your complete gopls logs.
NOTE: THESE MAY CONTAIN SENSITIVE INFORMATION ABOUT YOUR CODEBASE.
DO NOT SHARE LOGS IF YOU ARE WORKING IN A PRIVATE REPOSITORY.
<OPTIONAL: ATTACH LOGS HERE>
The text was updated successfully, but these errors were encountered: