Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Extension host terminated unexpectedly with SIGPIPE #1845

Closed
gpomykala opened this issue Aug 14, 2018 · 34 comments
Closed

Extension host terminated unexpectedly with SIGPIPE #1845

gpomykala opened this issue Aug 14, 2018 · 34 comments

Comments

@gpomykala
Copy link

Issue occurs on 2 different Linux systems: Debian 9 / Ubuntu 18. Default plugin / go env settings. GOPATH defined, go tools available in PATH
Steps to Reproduce:

  1. open Go project ie. influxDB
  2. open any .go file

Result:
Extension host terminated unexpectedly. Code: null Signal: SIGPIPE

Last entries from extension host log:

[2018-08-14 06:43:59.022] [exthost1] [info] ExtensionService#_doActivateExtension ms-vscode.Go {"startup":false,"activationEvent":"onLanguage:go"}
[2018-08-14 06:43:59.022] [exthost1] [info] ExtensionService#loadCommonJSModule /home/plgrpom/.vscode/extensions/ms-vscode.go-0.6.86/out/src/goMain
[2018-08-14 06:43:59.437] [exthost1] [info] eager extensions activated

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Aug 14, 2018

I am assuming you are on the latest version of VS Code (1.26.0). If so, an upstream issue microsoft/vscode#56301 is being tracked for this in the VS Code repo.

This is most likely related to an issue with electron throwing SIGPIPE error when passing stdin to a badly spawned process.

Please run Go: Install/Update Tools and update all the Go tools. Follow this up with closing all instances of VS Code and restarting.

@juliofarah
Copy link

I'm having exactly the same issue with ms-vscode.go. Is there a quick fix I can make locally before the next updates?

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Aug 14, 2018

So the upstream electron issue occurs when we try to spawn a process using a command that is not found and then pipe stdin.
Previously this would have resulted in a ENOENT which we catch and show an appropriate msg.
I have pushed a fix to try and catch such a case earlier.

The only place we use spawn and stdin is during formatting and providing auto-completions. The former handled the case of missing command well and the latter didn't for which I pushed a fix.

With the below fix, you should see a prompt for installing gocode instead of the SIGPIPE error. Go through with the prompt and install the tool and you should get your completions back.

Please try the below and let me know if it fixes the issue

@ramya-rao-a ramya-rao-a changed the title Extension host terminated unexpectedly shortly after opening a .go file Extension host terminated unexpectedly with SIGPIPE Aug 14, 2018
@juliofarah
Copy link

Thank you so much for the quick reply and for acting so fast on it!

I'm sorry but I don't believe it worked :(
I tried installing it both from the command line and from visual code "Install from VSIX".
This is the output I have from the terminal:

➜  service git:(staging) ✗ code --install-extension ~/Downloads/Go-latest.vsix
Extension 'Go-latest.vsix' was successfully installed!

Maybe I'm doing something wrong?

image

@ramya-rao-a
Copy link
Contributor

@juliofarah Can you run Go: Install/Update Tools and install all the tools and retry?

@mgitkin-vz
Copy link

Installing the latest version you linked above worked for me 🎉

Thanks @ramya-rao-a !

@juliofarah
Copy link

It worked!

Thanks @ramya-rao-a !

@mgitkin-vz
Copy link

@ramya-rao-a This issue is still occurring sporadically when I save a file. Not sure if its related to gofmt

@ramya-rao-a
Copy link
Contributor

@mgitkin-vz Can you try to run Go: Install/Update Tools to ensure you have all the tools in the right place and see if you still see the issue?

@calvn
Copy link

calvn commented Aug 14, 2018

@ramya-rao-a Also encountering this issue. I've installed the workaround and ensured that all the tools are up-to-date. The extension host still crashes on save.

@mgitkin-vz
Copy link

@ramya-rao-a Yes, I ran Go: Install/Update Tools after installing the new extension version

@ramya-rao-a
Copy link
Contributor

@calvn @mgitkin-vz

  • Can you consistently repro on file save?
  • The upstream electron issue may effect other extensions as well. Can you disable other extensions you might have installed other than Go and try?
  • Do the logs (Help -> Toggle Developer Tools -> Console) have any other helpful information?

@calvn
Copy link

calvn commented Aug 14, 2018

screen shot 2018-08-14 at 4 44 08 pm

These are the latest logs from the Console.

@ramya-rao-a
Copy link
Contributor

@calvn The first error about 'map' of undefined would have shown up when updating the tools right? Then how did you ensure all tools were updated?
Can you turn off the build, test, vet on save feature but not the lint,format on save feature and see if you still get the issue?

I am trying to narrow down which feature is actually causing this. If Go: Install/Update Tools was successful, then this issue should not be appearing at all as all required tools will be where they are expected to be

@calvn
Copy link

calvn commented Aug 15, 2018

@ramya-rao-a I just re-ran the tool installation command to make sure everything is up to date.

Installing 16 tools at /Users/cleung/go/bin
  gocode
  gopkgs
  go-outline
  go-symbols
  guru
  gorename
  dlv
  godef
  godoc
  goreturns
  golint
  gotests
  gomodifytags
  impl
  fillstruct
  goplay

Installing github.com/mdempsky/gocode SUCCEEDED
Installing github.com/uudashr/gopkgs/cmd/gopkgs SUCCEEDED
Installing github.com/ramya-rao-a/go-outline SUCCEEDED
Installing github.com/acroca/go-symbols SUCCEEDED
Installing golang.org/x/tools/cmd/guru SUCCEEDED
Installing golang.org/x/tools/cmd/gorename SUCCEEDED
Installing github.com/derekparker/delve/cmd/dlv SUCCEEDED
Installing github.com/rogpeppe/godef SUCCEEDED
Installing golang.org/x/tools/cmd/godoc SUCCEEDED
Installing github.com/sqs/goreturns SUCCEEDED
Installing github.com/golang/lint/golint SUCCEEDED
Installing github.com/cweill/gotests/... SUCCEEDED
Installing github.com/fatih/gomodifytags SUCCEEDED
Installing github.com/josharian/impl SUCCEEDED
Installing github.com/davidrjenni/reftools/cmd/fillstruct SUCCEEDED
Installing github.com/haya14busa/goplay/cmd/goplay SUCCEEDED

All tools successfully installed. You're ready to Go :).

Can you turn off the build, test, vet on save feature but not the lint,format on save feature and see if you still get the issue?

How do you disable some of the features? I've not done this before since it has always worked pretty well with out of the box config.

@mgitkin-vz
Copy link

@ramya-rao-a Ah good point. I just disabled all of my extensions and quickly after "reloading" the issue happened again:

image

However, after fully quitting the Code process and restarting, I haven't been able to reproduce the issue.

@ramya-rao-a
Copy link
Contributor

@calvn To disable the features, go to your settings (Ctrl+,), look for go.buildOnSave, go.vetOnSave and go.testOnSave and turn them off.

@mgitkin-vz Please keep an eye out if you see it now after fully quitting VS Code

@mgitkin-vz
Copy link

mgitkin-vz commented Aug 15, 2018

@ramya-rao-a I just got another crash, this one looks much more informative.

edit: attached log instead
vs-code-debug-cons-1534293596707.log

@calvn
Copy link

calvn commented Aug 15, 2018

I disabled the three features, did a hard restart of vscode, and after some time the crash occurred. I've attached the a screen capture of the console once again.
screen shot 2018-08-14 at 5 51 51 pm

@ramya-rao-a
Copy link
Contributor

@mgitkin-vz I believe all the errors in that log related to "expected this, got that" is from formatting.

@mgitkin-vz @calvn Can you disable the format on save feature and try again? Add the below setting

"[go]": {
    "editor.formatOnSave": false
}

@calvn
Copy link

calvn commented Aug 15, 2018

@ramya-rao-a No dice.

screen shot 2018-08-14 at 6 00 57 pm

@ramya-rao-a
Copy link
Contributor

@calvn I see that you are on gophers slack, can you log in there and we can continue the investigation there? it would be much faster.

@gpomykala
Copy link
Author

In my case reinstall of go sdk via apt helped. It seems like apt package contains much more than .tgz artifact hosted on golang. It seems like some tool used by an extension was missing in the system

@iotdog
Copy link

iotdog commented Aug 15, 2018

I encoutered the same issue, and I just return to VS Code 1.25.1 which works well

@lizebang
Copy link

Not work for me. Emmm...

@xuefeng-huang
Copy link

xuefeng-huang commented Aug 16, 2018

It appears that this issue happens whenever I enable vscodevim extension and vscodego together. It works fine if I enable vscodego only (edit: the issue still happens if only vscodego is enabled)

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Aug 16, 2018

@lizebang @xuefeng-huang Did you run Go: Install/Update Tools and updated all the Go tools? Follow this up with closing all instances of VS Code and restarting.

@lizebang
Copy link

@ramya-rao-a Thanks a lot. I have update go tools and it works well at least 8 hours. I think there is no problem for me. Thanks.

@mgitkin-vz
Copy link

@ramya-rao-a Using version 0.6.87 I'm not able to reproduce this issue any more (even when using editor.formatOnSave)

Thanks!

@ramya-rao-a
Copy link
Contributor

Thanks @mgitkin-vz, @lizebang, @gpomykala for confirming the fix.
@xuefeng-huang, @calvn, @iotdog Let me know if the fix (updating all tools -> close all vscode windows -> restart) works for you as well.

@xuefeng-huang
Copy link

xuefeng-huang commented Aug 17, 2018

@ramya-rao-a I installed the new vscodego extension and updated all tools, it works fine now

@ramya-rao-a
Copy link
Contributor

Alright then I'll close this issue.
Thanks everyone for verifying the fix.

@jhartman86
Copy link

Seeing this as well. Tried the fix and still occurring regularly.

@xuefeng-huang
Copy link

@jhartman86 did you upgrade VSCode to 1.26.1? it should fix this issue

@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants