Skip to content
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

GO layer seems to continuously create working buffers and slows spacemacs down #7979

Closed
InvisibleTech opened this issue Dec 16, 2016 · 14 comments

Comments

@InvisibleTech
Copy link

Description :octocat:

Using spacemacs to edit any GO lang files and over time the number of go-eldocs and gocode buffers begin to get out of control. Every edit, every save they just keep coming. It is like being in a Bruce Lee movie where bad guys keep coming through the door one at a time. It might be a setting. However, I am using the on label install of spacemacs for OSX. The GO layer is installed by spacemacs and GO by brew.

Reproduction guide 🪲

  • Start Emacs
  • Open a go file and make changes that break the compile and save it
  • use SPC - b - b to see the list of buffers
  • correct the file and save it
  • use SPC - b - b to list of buffers - you should see them.

Observed behaviour: 👀 💔
You should see more and more go-eldoc and gocode buffers if you use SPC - b - b to see the list.

Expected behaviour: ❤️ 😄
You should only see one set of these buffers or none as they clean up.

System Info 💻

  • OS: darwin
  • Emacs: 25.1.1
  • Spacemacs: 0.200.5
  • Spacemacs branch: master (rev. 664ba6a)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
(javascript better-defaults auto-completion emacs-lisp osx git markdown org spell-checking syntax-checking go elixir scala python)
  • System configuration features: JPEG RSVG IMAGEMAGICK NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES

Backtrace 🐾

@bmag
Copy link
Collaborator

bmag commented Dec 17, 2016

Looking at company-go--invoke-autocomplete and go-eldoc--invoke-autocomplete I'd say that those buffers aren't supposed to accumulate. Those functions try to kill the temporary buffer each time.

Search the *Messages* buffer for any error messages you may have missed, or try debugging these two (almost identical) functions. You can copy the functions to the scratch buffer, modify them and evaluate the new definition by using C-M-x (in emacs-lisp-mode), and you can also invoke Edebug if you want.

@InvisibleTech
Copy link
Author

InvisibleTech commented Dec 26, 2016

I will try to get back to this issue in the near future. Had to switch gears. Other than the "look for any error messages [I] may have missed" advice, I am not sure what want me to change in the two functions in question. But I'll worry about that when I get there. Thanks

@InvisibleTech
Copy link
Author

Working off of another machine, so far cannot reproduce it. I'll close this issue until I can.

@rbrtl
Copy link

rbrtl commented Feb 28, 2017

I've reproduced this issue, I think:
screen shot 2017-02-28 at 13 09 40

I'm afraid I'm still learning Spacemacs, so I'm not sure how to provide much more detail, but I'll do my best.

System Info 💻

  • OS: OS X El Capitan 10.11.6
  • Emacs: 25.1
  • Spacemacs: ?? (not sure which version)
  • Spacemacs branch: master (not sure which revision)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers: ( go helm auto-completion emacs-lisp git java )

My situation is largely the same as @InvisibleTech's, but if anyone needs more info from me, I'll do my best.

@bmag bmag reopened this Feb 28, 2017
@bmag
Copy link
Collaborator

bmag commented Feb 28, 2017

@rbrtl thanks for the interest. We need someone to debug/research why this bug occurs. I don't really have time to install the Go tools, reproduce the issue and debug it myself, so someone else will need to do this. The goal is to understand if the code that's supposed to kill the buffers is even called. If yes, why doesn't it kill the buffers? If no, why not?

@nyxwulf
Copy link

nyxwulf commented Mar 2, 2017

I have been experiencing this issue on Windows, OSX, and macOS. Checked the errors today and saw these gocode errors. Installing and running gocode seems to have resolved the issue for me.

eldoc error: (file-error Searching for program No such file or directory gocode) [4 times]
auto trimmed 0 chars
eldoc error: (file-error Searching for program No such file or directory gocode) [3 times]
auto trimmed 0 chars
eldoc error: (file-error Searching for program No such file or directory gocode) [2 times]
auto trimmed 0 chars
eldoc error: (file-error Searching for program No such file or directory gocode) [18 times]

@nyxwulf
Copy link

nyxwulf commented Mar 3, 2017

Confirmed on a second machine. The layer recommends installing the following packages, and says you will need gocode and godef. The errors in Messages I have seen have only been about gocode.

  go get -u -v github.com/nsf/gocode
  go get -u -v github.com/rogpeppe/godef
  go get -u -v golang.org/x/tools/cmd/guru
  go get -u -v golang.org/x/tools/cmd/gorename
  go get -u -v golang.org/x/tools/cmd/goimports

Installing all of the packages makes the el-doc issue stop happening in two different environments.

@bmag
Copy link
Collaborator

bmag commented Mar 3, 2017

I think I identified the cause and opened issue reports upstream: nsf/gocode#435, emacsorphanage/go-eldoc#47. The cause is an error when calling an external command. In @nyxwulf's case the program was missing and the solution was to install it.

@bmag
Copy link
Collaborator

bmag commented Mar 4, 2017

The multiple *gocode* buffers is fixed upstream, but we're still waiting for *go-eldoc*.

@bmag
Copy link
Collaborator

bmag commented Mar 5, 2017

Should be fixed upstream now

@bmag bmag closed this as completed Mar 5, 2017
@rbrtl
Copy link

rbrtl commented Mar 6, 2017

I installed the Go packages as above, and I've got a more serious issue now:
screen shot 2017-03-06 at 00 24 44

Info in Report screen:

Process: Emacs [37816]
Path: /usr/local/Cellar/emacs-plus/25.1/Emacs.app/Contents/MacOS/Emacs
Identifier: org.gnu.Emacs
Version: ???
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Emacs [37816]
User ID: 501

Date/Time: 2017-03-06 00:24:32.423 +0000
OS Version: Mac OS X 10.11.6 (15G1217)
Report Version: 11
Anonymous UUID: 15AA939B-E8D8-3696-A484-BE064B2F3476

Sleep/Wake UUID: 8DF5EF56-47CB-4AA3-82E7-94FE41B242D3

Time Awake Since Boot: 590000 seconds
Time Since Wake: 930 seconds

System Integrity Protection: enabled

Crashed Thread: 0

Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000002, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY

Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
Library not loaded: /usr/local/opt/imagemagick/lib/libMagickWand-6.Q16.2.dylib
Referenced from: /usr/local/Cellar/emacs-plus/25.1/Emacs.app/Contents/MacOS/Emacs
Reason: image not found

Binary Images:
0x7fff6c682000 - 0x7fff6c6b9a47 dyld (360.22) <884763FC-CC0F-31CC-ACC4-75A805CE401D> /usr/lib/dyld
0x7fff8b21d000 - 0x7fff8be46ff7 com.apple.AppKit (6.9 - 1404.47) /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
0x7fff9258f000 - 0x7fff92590ffb libSystem.B.dylib (1226.10.1) <012548CD-614D-3AF0-B3B1-676F427D2CD6> /usr/lib/libSystem.B.dylib
0x7fff95d58000 - 0x7fff95dcdfff com.apple.framework.IOKit (2.0.2 - 1179.50.2) /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit

If anyone needs more info let me know.

@bmag
Copy link
Collaborator

bmag commented Mar 6, 2017

What the hell? @rbrtl sorry, I don't have any experience with macOS. According to the error message:

Dyld Error Message:
Library not loaded: /usr/local/opt/imagemagick/lib/libMagickWand-6.Q16.2.dylib
Referenced from: /usr/local/Cellar/emacs-plus/25.1/Emacs.app/Contents/MacOS/Emacs
Reason: image not found

I'm guessing imagemagick couldn't be loaded for some reason. Maybe it's not installed or not in the correct path? Maybe you really need to reinstall Emacs itself (not Spacemacs), as the popup suggests?

Any way, I doubt the Go layer can cause this, I just don't see any connection. @d12frosted any clue?

@rbrtl
Copy link

rbrtl commented Mar 7, 2017

I think I said something like that when I saw that message. I think I've fixed things now. Read this PR: Homebrew/homebrew-core#7775 and reinstalled emacs-plus (--without-imagemagick) and that fixed up the macOS error, and then sured up my Go install and installed the support tools, and everything looks fine.

Cheers for your help, all.

@digizeph
Copy link

For those who still have trouble configuring the path correctly (like myself), make sure you have PATH setup correctly. Even if you followed all the instructions here, without a correct path, you will still fail to find packages.

Go follow the instructions here to set it up correctly: https://golang.org/doc/code.html#GOPATH , or adding the following lines to your .profile file:

export PATH=$PATH:$(go env GOPATH)/bin
export GOPATH=$(go env GOPATH)

It is strange that they didn't put this on the installation guide page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants