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

cmd/govim: failed to resolve buffer #821

Closed
a-palchikov opened this issue Mar 12, 2020 · 4 comments · Fixed by #823
Closed

cmd/govim: failed to resolve buffer #821

a-palchikov opened this issue Mar 12, 2020 · 4 comments · Fixed by #823
Labels
bug Something isn't working
Milestone

Comments

@a-palchikov
Copy link

What version of Vim/Gvim are you using?

Vim/Gvim version
$ vim --version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Mar 01 2020 17:17:52)
Included patches: 1-343
Modified by jonathon.fernyhough@york.ac.uk
Compiled by jonathon.fernyhough@york.ac.uk
Huge version with GTK3 GUI.  Features included (+) or not (-):
+acl               -farsi             -mouse_sysmouse    -tag_old_static
+arabic            +file_in_path      +mouse_urxvt       -tag_any_white
+autocmd           +find_in_path      +mouse_xterm       +tcl
+autochdir         +float             +multi_byte        +termguicolors
-autoservername    +folding           +multi_lang        +terminal
+balloon_eval      -footer            -mzscheme          +terminfo
+balloon_eval_term +fork()            +netbeans_intg     +termresponse
+browse            +gettext           +num64             +textobjects
++builtin_terms    -hangul_input      +packages          +textprop
+byte_offset       +iconv             +path_extra        +timers
+channel           +insert_expand     +perl              +title
+cindent           +job               +persistent_undo   +toolbar
+clientserver      +jumplist          +popupwin          +user_commands
+clipboard         +keymap            +postscript        +vartabs
+cmdline_compl     +lambda            +printer           +vertsplit
+cmdline_hist      +langmap           +profile           +virtualedit
+cmdline_info      +libcall           -python            +visual
+comments          +linebreak         +python3           +visualextra
+conceal           +lispindent        +quickfix          +viminfo
+cryptv            +listcmds          +reltime           +vreplace
+cscope            +localmap          +rightleft         +wildignore
+cursorbind        +lua               +ruby              +wildmenu
+cursorshape       +menu              +scrollbind        +windows
+dialog_con_gui    +mksession         +signs             +writebackup
+diff              +modify_fname      +smartindent       +X11
+digraphs          +mouse             +sound             -xfontset
+dnd               +mouseshape        +spell             +xim
-ebcdic            +mouse_dec         +startuptime       +xpm
+emacs_tags        +mouse_gpm         +statusline        +xsmp_interact
+eval              -mouse_jsbterm     -sun_workshop      +xterm_clipboard
+ex_extra          +mouse_netterm     +syntax            -xterm_save
+extra_search      +mouse_sgr         +tag_binary        
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Wdate-time  -g -O2 -fdebug-prefix-map=/build/vim-IoFkAi/vim-8.2.0343=. -fstack-protector-strong -Wformat -Werror=format-security -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
Linking: gcc   -L. -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-E  -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim   -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE  -lm -ltinfo -lnsl  -lselinux  -lcanberra -lacl -lattr -lgpm -ldl  -L/usr/lib -llua5.2 -Wl,-E  -fstack-protector-strong -L/usr/local/lib  -L/usr/lib/x86_64-linux-gnu/perl/5.26/CORE -lperl -ldl -lm -lpthread -lcrypt  -L/usr/lib/python3.6/config-3.6m-x86_64-linux-gnu -lpython3.6m -lpthread -ldl -lutil -lm -L/usr/lib/x86_64-linux-gnu -ltcl8.6 -ldl -lz -lpthread -lm -lruby-2.5 -lpthread -lgmp -ldl -lcrypt -lm

What version of Go are you using (go version)?

$ go version
go version go1.12.17 linux/amd64

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/deemok/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="redacted"
GOPROXY=""
GORACE=""
GOROOT="redacted"
GOTMPDIR=""
GOTOOLDIR="redacted"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build762905150=/tmp/go-build -gno-record-gcc-switches"

What version/commit of govim are you using?

56e86d7

Do the Vim channel, govim or gopls log files show anything interesting?

See below

What did you do?

I have a question about:

govim/plugin/govim.vim

Lines 219 to 220 in 56e86d7

au govim CursorMoved,CursorMovedI * ++nested :call s:userBusy(1)
au govim CursorHold,CursorHoldI * ++nested :call s:userBusy(0)

Specifically if there is a reason to have userBusy callback for all filetypes (and not just Go).
With userBusy configured for all filetypes, the unnamed buffers always fail with failed to resolve buffer <bufnum> after updatetime.

The issue is pretty similar to this.

What did you expect to see?

No failures on buffers govim does not know about.

What did you see instead?

Everytime userBusy is triggered inside an unnamed buffer, the vim shows an error (from the log file):

 16.851146 RECV on 0(out): '[50,["got error whilst handling GOVIM_internal_SetUserBusy: failed to get current position: cursorPos: failed to resolve buffer 3",""]]
'
 16.851177 on 0: Getting JSON message 50
 16.851209 on 0: Received JSON for id 50
 16.851290 : ERROR: Error detected while processing function <SNR>72_userBusy[3]..GOVIM_internal_SetUserBusy[2]..<SNR>72_callbackFunction[2]..<SNR>72_ch_evalexpr:
 16.851394 : ERROR: line    4:
 16.851441 : ERROR: E605: Exception not caught: got error whilst handling GOVIM_internal_SetUserBusy: failed to get current position: failed to resolve buffer 3
 16.851587 : looking for messages on channels
 17.640830 : ERROR: Error detected while processing function <SNR>72_userBusy:
 17.640981 : ERROR: line    3:
 17.641043 : ERROR: E171: Missing :endif
@myitcv
Copy link
Member

myitcv commented Mar 12, 2020

Thanks for the report - I was already investigating this thanks to a report from @leitzler. Fix should land shortly. This bug got introduced as a result of 8926dec which was backing out the broken changes introduced in 8826ef5. All of this would ideally by fixed by vim/vim#5694 (comment)

@myitcv myitcv added the bug Something isn't working label Mar 12, 2020
@myitcv myitcv added this to the Next milestone Mar 12, 2020
myitcv added a commit that referenced this issue Mar 12, 2020
In 8926dec we backed out the changes for tracking all buffer changes.
But in so doing we didn't properly handle the situation where the busy
state changes and the cursor is in a non-go file.

Fix that and add a test to verify we don't regress.

Fixes #821
myitcv added a commit that referenced this issue Mar 12, 2020
In 8926dec we backed out the changes for tracking all buffer changes.
But in so doing we didn't properly handle the situation where the busy
state changes and the cursor is in a non-go file.

Fix that and add a test to verify we don't regress.

Whilst we are at it:

* consistently use GOVIM_test_SetUserBusy in our testscript tests
* slightly refactor the types/consts used for getting the current cursor
  position

Fixes #821
@myitcv
Copy link
Member

myitcv commented Mar 12, 2020

@a-palchikov @aitva - I've just created #823 to fix this. Thanks for your respective reports, and apologies this slipped through.

If you are able to give that PR a try that would be appreciated. However, per the commit message and test I'm fairly confident the issue is fixed.

@aitva
Copy link

aitva commented Mar 12, 2020

@myitcv I have tried it and I cannot reproduce the issue. 🎉

myitcv added a commit that referenced this issue Mar 12, 2020
In 8926dec we backed out the changes for tracking all buffer changes.
But in so doing we didn't properly handle the situation where the busy
state changes and the cursor is in a non-go file.

Fix that and add a test to verify we don't regress.

Whilst we are at it:

* consistently use GOVIM_test_SetUserBusy in our testscript tests
* slightly refactor the types/consts used for getting the current cursor
  position

Fixes #821
myitcv added a commit that referenced this issue Mar 12, 2020
In 8926dec we backed out the changes for tracking all buffer changes.
But in so doing we didn't properly handle the situation where the busy
state changes and the cursor is in a non-go file.

Fix that and add a test to verify we don't regress.

Whilst we are at it:

* consistently use GOVIM_test_SetUserBusy in our testscript tests
* slightly refactor the types/consts used for getting the current cursor
  position

Fixes #821
@a-palchikov
Copy link
Author

works for me as well.

myitcv added a commit that referenced this issue Mar 12, 2020
In 8926dec we backed out the changes for tracking all buffer changes.
But in so doing we didn't properly handle the situation where the busy
state changes and the cursor is in a non-go file.

Fix that and add a test to verify we don't regress.

Whilst we are at it:

* consistently use GOVIM_test_SetUserBusy in our testscript tests
* slightly refactor the types/consts used for getting the current cursor
  position

Fixes #821
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants