Skip to content

Go Plugin Crashes On Compile Errors #476

@matthinrichsen-wf

Description

@matthinrichsen-wf

What version of Go, VS Code & VS Code Go extension are you using?

  • Run go version to get version of Go
    • go version go1.14.3 darwin/amd64
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders
    • 1.47.3
    • 91899dcef7b8110878ea59626991a18c8a6a1b3e
    • x64
  • Check your installed extensions to get the version of the VS Code Go extension
    • v0.16.0
  • Run go env to get the go development environment details
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/matthinrichsen/Library/Caches/go-build"
GOENV="/Users/matthinrichsen/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GONOPROXY="github.com/Workiva"
GONOSUMDB="github.com/Workiva"
GOOS="darwin"
GOPATH="/Users/matthinrichsen/workspaces/wf/go"
GOPRIVATE="github.com/Workiva"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.14.3/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.14.3/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/matthinrichsen/workspaces/wf/go/src/github.com/Workiva/skaardb/go.mod"
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/r5/vsc54hrs2hl7sh4spc29gt5h0000gn/T/go-build984606975=/tmp/go-build -gno-record-gcc-switches -fno-common"

Share the Go related settings you have added/edited

{
    "go.autocompleteUnimportedPackages": true,
    "go.lintTool": "golangci-lint",
    "files.autoSave": "onFocusChange",
    "editor.formatOnSave": true,
    "window.zoomLevel": 0
}

Describe the bug

I'm working in a rather large project with decently long file save times (if things are not cached). When using the go plugin and a compile error occurs in the file I am attempting to save, the following is in the console:

/[path]/.vscode/extensions/golang.go-0.16.0/dist/goMain.js:26315    throw err;    ^[Error: write EPIPE	at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:83:16)Emitted 'error' event at:	at errorOrDestroy (internal/streams/destroy.js:107:12)	at onwriteError (_stream_writable.js:439:5)	at onwrite (_stream_writable.js:460:5)	at internal/streams/destroy.js:49:7	at Socket._destroy (net.js:595:3)	at Socket.destroy (internal/streams/destroy.js:37:8)	at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:84:12)] {  errno: 'EPIPE',  code: 'EPIPE',  syscall: 'write'}

Steps to reproduce the behavior:

I think its a race condition around saving while another save is in progress which results in a compile-time error. I have not been able to reproduce in a simple file that formats/saves quickly.

  1. Make a file that takes awhile for the plugin to format/save
  2. Introduce a compile time error
  3. Initiate save
  4. Make a small change and save again before first save completes

Screenshots or recordings

Screen Shot 2020-08-05 at 12 16 25 PM

when opening up the developer tools:
Screen Shot 2020-08-05 at 12 17 03 PM

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions