-
Notifications
You must be signed in to change notification settings - Fork 18k
x/tools/gopls: causes vscode-go hangs - mac hard reboot mac is the only option #40835
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 caught a crash for the renaming a field . but this didn't hang my mac it only crashed the gopls server. this is the output i see output i get when i see in view->outputs->gopls(server) `[Info - 3:39:20 AM] 2020/08/17 03:39:20 go/packages.Load [Info - 3:39:20 AM] 2020/08/17 03:39:20 go/packages.Load panic: runtime error: invalid memory address or nil pointer dereference goroutine 13316 [running]: ` the output of gopls.log which i gave in setting doesn't have any crash logs. i see logs like `[Trace - 03:47:21.719 AM] Sending request 'textDocument/codeAction - (21)'. [Trace - 03:47:21.719 AM] Received response 'textDocument/codeAction - (21)' in 0ms. [Trace - 03:50:40.071 AM] Received notification 'window/logMessage'. [Trace - 03:50:40.461 AM] Received notification 'window/logMessage'. |
Change https://golang.org/cl/248797 mentions this issue: |
Do you mind providing a full Even if you can't get the logs when your Mac hangs, they may still be useful (if something else is misconfigured in your workspace, that might be causing the issue). Also, if you know of an open-source project in which you can reproduce the issue, that would be the most helpful. I've mailed a change to fix the nil pointer you encountered. |
@stamblerre thank you for getting back to me. I was able to reproduce it with https://github.com/terraform-providers/terraform-provider-aws
see the below screenshot. once it hangs we can not even move mouse or use keyboard. |
The symptoms you describe sound like your computer is running out of memory, and Terraform is a fairly large project. When you're coding, please keep an eye on Activity Monitor to see how much memory you have free. If that's the case, installing gopls at master may help. Please try that. If you still have problems, please upload a memory debug zip. These are automatically written to the temporary directory (/tmp for Unixes) with names like gopls.1234-5GiB-withnames.zip. If you are uncomfortable sharing the package names of your code, you can share the -nonames zip instead. |
@heschik I had plenty of memory on mac. After I rebooted I haven't opened anything yet and I got like 16 GB of RAM. This was just an example i was showing. I had a small project even with that i was able to reproduce this error. But mac running out of memory is pretty hard to reboot every time it happens. How do I collect the memory dump. Since it is an open source project I can share the dumps. |
If your machine isn't running out of memory, then I have no idea what gopls could be doing to crash the entire computer. Sorry. Memory debug zips are automatically written to the temporary directory (/tmp for Unixes) with names like gopls.1234-5GiB-withnames.zip. |
hi @heschik @stamblerre gopls version First time
Date/Time: 2020-08-19 10:01:53.178893 +1000
OS Version: Mac OS X 10.13.6 (Build 17G11023)
Architecture: x86_64
Report Version: 19
Command: gopls Event: wakeups Hardware model: MacBookPro14,3 Fan speed: 2165 rpm Powerstats for: gopls [21222] Binary Images: Second time
Date/Time: 2020-08-19 09:26:43.370766 +1000
OS Version: Mac OS X 10.13.6 (Build 17G11023)
Architecture: x86_64
Report Version: 19
Command: gopls Event: wakeups Hardware model: MacBookPro14,3 Fan speed: 2160 rpm Powerstats for: gopls [13590] Binary Images: mds storesDate/Time: 2020-08-19 10:13:06.322032 +1000 Command: mds Event: memory high watermark Hardware model: MacBookPro14,3 Signature: app-specific tag 2,MALLOC_LARGE_REUSED,MALLOC_LARGE,MALLOC_TINY,MALLOC_SMALL Section: footprint --summary ==========================================================================================
|
I don't know whether that's a kernel bug or if your computer is broken somehow, but it doesn't seem like it's due to gopls. |
Closing as this is in the WaitingForInfo state and |
Please direct general questions to:
#vscode
channel in Gophers SlackPlease review the documentation before filing an issue.
Helpful pages include:
I disabled all extensions except go lang for vscode and still got the issue.
Please answer these questions before submitting your issue. Thanks!
What version of Go, VS Code & VS Code Go extension are you using?
go version
to get version of Gogo version go1.14 darwin/amd64
code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders1.47.3
91899dcef7b8110878ea59626991a18c8a6a1b3e
x64
go env
to get the go development environment detailsGO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/myuser/Library/Caches/go-build"
GOENV="/Users/myuser/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GONOPROXY="github.com,go.googlesource.com,gopkg.in,localhost,go.uber.org"
GOOS="darwin"
GOPATH="/Users/myuser/workspace/go/"
GOPRIVATE="myenterpiserserverrepos"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.14/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.14/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/53/hjtfgcyx565bfnxtj1d2s3340000gn/T/go-build630458320=/tmp/go-build -gno-record-gcc-switches -fno-common"
Share the Go related settings you have added/edited
Run
Preferences: Open Settings (JSON)
command to open your settings.json file.Share all the settings with the
go.
or["go"]
orgopls
prefixes.{
"window.zoomLevel": 0,
"explorer.openEditors.visible": 0,
"editor.fontSize": 18,
"files.autoSave": "off",
"editor.minimap.enabled": false,
"editor.scrollBeyondLastLine": false,
"editor.renderIndentGuides": true,
"vsicons.dontShowNewVersionMessage": true,
"terminal.integrated.copyOnSelection": true,
"workbench.activityBar.visible": true,
"editor.matchBrackets": "always",
"editor.suggestSelection": "first",
"workbench.iconTheme": "vscode-icons",
"files.autoSaveDelay": 5000,
"java.semanticHighlighting.enabled": true,
"files.exclude": {
"/.classpath": true,
"/.project": true,
"/.settings": true,
"/.factorypath": true
},
"java.requirements.JDK11Warning": false,
"editor.codeActionsOnSave":{},
"extensions.autoCheckUpdates": false,
"editor.tokenColorCustomizations": null,
"update.mode": "manual",
"extensions.autoUpdate": false,
"go.formatTool": "goimports",
"go.languageServerFlags": [
"serve",
"-rpc.trace",
"--debug=localhost:6060",
"-logfile=/Users/chandrakasiraju/Downloads/gopls.log"
],
"go.useLanguageServer": true,
"[go]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true,
},
"editor.snippetSuggestions": "none",
},
"[go.mod]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true,
},
},
"gopls": {
"usePlaceholders": true,
"staticcheck": false,
}
}
Describe the bug
vscode freezes the mac.
Steps to reproduce the behavior:
when ever i try editing a file, especially if that file is big or if i replace whole content of a file , or if i change package name or rename a variable or add a new package which brings new dependency the whole vscode hangs. I can't even move my mouse. i can not get out of vscode window and then kill vscode to restart. the only way is to force restart mac. this happened so many times in my mac. To make sure it is not a linting problem i even tried to disables file.autosave to false. I think it has some thing to do with gopls or language server. I tried using atom editor for this issue. when i tried enabling gopls there as well it made my mac hang. This happens once in a while when code file is big , you try to import a new dependency etc.
Screenshots or recordings
If applicable, add screenshots or recordings to help explain your problem.

The text was updated successfully, but these errors were encountered: