[vim/vim] after restart X server vim boots slows (#6199)

39 views
Skip to first unread message

link

unread,
Jun 3, 2020, 11:30:13 PM6/3/20
to vim/vim, Subscribed

Instructions: Replace the template text and remove irrelevant text (including this line)

Describe the bug

I use ubuntu 20.04 with kde, and after x server restarts, vim starts slowly and gives these error info

XSMP opening connection                                                                                                                                                                                                                                                                   
XSMP SmcOpenConnection failed: Could not open network socket

And it cannot access to system clipboard.
After execute :xrestore, it can access to system clipboard. But it still starts slowly like before.

To Reproduce
Detailed steps to reproduce the behavior:

  1. kill x server by press ctrl+alt+backspace on Ubuntu
  2. Run vim --clean (or gvim --clean, etc.)
  3. starts slow and show error info about connect to X server and cannot access system clipboard
  4. Run :xrestore
  5. can access to system clipboard
  6. another vim boot is still slow

Expected behavior
vim boots quickly after :xrestore

Screenshots
If applicable, copy/paste the text or add screenshots to help explain your problem.

Environment (please complete the following information):

  • Vim version [e.g. 8.1.1234] (Or paste the result of vim --version.)
VIM - Vi IMproved 8.1 (2018 May 18, compiled Apr 15 2020 06:40:31)
Included patches: 1-2269
Modified by team...@tracker.debian.org
Compiled by team...@tracker.debian.org
Huge version with GTK3 GUI.  Features included (+) or not (-):
+acl               -farsi             -mouse_sysmouse    -tag_any_white
+arabic            +file_in_path      +mouse_urxvt       +tcl
+autocmd           +find_in_path      +mouse_xterm       +termguicolors
+autochdir         +float             +multi_byte        +terminal
-autoservername    +folding           +multi_lang        +terminfo
+balloon_eval      -footer            -mzscheme          +termresponse
+balloon_eval_term +fork()            +netbeans_intg     +textobjects
+browse            +gettext           +num64             +textprop
++builtin_terms    -hangul_input      +packages          +timers
+byte_offset       +iconv             +path_extra        +title
+channel           +insert_expand     +perl              +toolbar
+cindent           +job               +persistent_undo   +user_commands
+clientserver      +jumplist          +postscript        +vartabs
+clipboard         +keymap            +printer           +vertsplit
+cmdline_compl     +lambda            +profile           +virtualedit
+cmdline_hist      +langmap           -python            +visual
+cmdline_info      +libcall           +python3           +visualextra
+comments          +linebreak         +quickfix          +viminfo
+conceal           +lispindent        +reltime           +vreplace
+cryptv            +listcmds          +rightleft         +wildignore
+cscope            +localmap          -ruby              +wildmenu
+cursorbind        +lua               +scrollbind        +windows
+cursorshape       +menu              +signs             +writebackup
+dialog_con_gui    +mksession         +smartindent       +X11
+diff              +modify_fname      +sound             -xfontset
+digraphs          +mouse             +spell             +xim
+dnd               +mouseshape        +startuptime       +xpm
-ebcdic            +mouse_dec         +statusline        +xsmp_interact
+emacs_tags        +mouse_gpm         -sun_workshop      +xterm_clipboard
+eval              -mouse_jsbterm     +syntax            -xterm_save
+ex_extra          +mouse_netterm     +tag_binary        
+extra_search      +mouse_sgr         -tag_old_static    
   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/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -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-iU6mZD/vim-8.1.2269=. -fstack-protector-strong -Wformat -Werror=format-security -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
Linking: gcc   -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 -lharfbuzz -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.30/CORE -lperl -ldl -lm -lpthread -lcrypt  -L/usr/lib/python3.8/config-3.8-x86_64-linux-gnu -lpython3.8 -lcrypt -lpthread -ldl -lutil -lm -lm -L/usr/lib/x86_64-linux-gnu -ltcl8.6 -ldl -lz -lpthread -lm
  • OS: Ubuntu 20.04
  • Terminal: tmux

Additional context
Add any other context about the problem here.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Christian Brabandt

unread,
Jun 4, 2020, 5:11:59 AM6/4/20
to vim/vim, Subscribed

do you need to update the $DISPLAY variable?

link

unread,
Jun 4, 2020, 5:52:12 AM6/4/20
to vim/vim, Subscribed

No I don't need. I find a problem, after kill x server, old startplasma-x11
process is still exists and it's parent pid becomes 1. So there are two
this processes. Maybe it's the reason.

On Thu, Jun 4, 2020, 17:11 Christian Brabandt <notifi...@github.com>
wrote:


> do you need to update the $DISPLAY variable?
>
> —
> You are receiving this because you authored the thread.

> Reply to this email directly, view it on GitHub
> <https://github.com/vim/vim/issues/6199#issuecomment-638723945>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AC3HTAIPKI2236HBPCT3Q23RU5QMLANCNFSM4NSHLGBA>

link

unread,
Jun 4, 2020, 6:01:36 AM6/4/20
to vim/vim, Subscribed

Sorry, I try logout and login again, find that old startplasma-x11 process is killed normally, and there is only one new process existing. But vim still boots slowly with the same error info.

John Little

unread,
Jun 4, 2020, 11:30:54 PM6/4/20
to vim_dev
I just had a go at reproducing your problem, on a KDE session that had been running for several days, though with many suspensions.

After killing the X server with ctrl-alt-backspace, the kwin_x11 process went to 100% CPU (on one core), and KDE didn't shut down properly.  Trying to log back in, the display got stuck on the splash screen.

I conclude that in 20.04, killing an X server with KDE is buggy.

Regards, John Little

link

unread,
Apr 14, 2021, 5:39:06 AM4/14/21
to vim/vim, Subscribed

This is output of vim -u NONE --startuptime, and xsmp init takes 1 second.

1316.658  000.001: --- VIM STARTED ---


times in msec
 clock   self+sourced   self:  sourced script
 clock   elapsed:              other lines

000.007  000.007: --- VIM STARTING ---
000.164  000.157: Allocated generic buffers
000.233  000.069: locale set
000.251  000.018: GUI prepared
000.263  000.012: clipboard setup
000.268  000.005: window checked
001.118  000.850: inits 1
001.149  000.031: parsing arguments
001.150  000.001: expanding arguments
001.187  000.037: shell init
1001.710  1000.523: xsmp init
1002.609  000.899: Termcap init
1002.725  000.116: inits 2
1003.159  000.434: init highlight
1003.162  000.003: sourcing vimrc file(s)
1003.242  000.080: inits 3
1011.915  008.673: setup clipboard
1011.938  000.023: setting raw mode
1011.961  000.023: start termcap
1011.991  000.030: clearing screen
1013.491  001.500: opening buffers
1013.497  000.006: BufEnter autocommands
1013.500  000.003: editing files in windows
1013.522  000.022: VimEnter autocommands
1013.525  000.003: before starting main loop
1014.470  000.945: first screen update
1014.473  000.003: --- VIM STARTED ---

Dominique Pellé

unread,
Apr 14, 2021, 5:50:23 AM4/14/21
to vim/vim, Subscribed

I assume that running Vim as vim -u NONE -X makes it fast.
It's useful to confirm.
But of course, that's not really a solution if you e.g. need the x11 clipboard.

link

unread,
Apr 14, 2021, 6:07:31 AM4/14/21
to vim/vim, Subscribed

@dpelle You are right, -X flag makes it fast.
I just want to solve this problem. Why logout and login causes it...

link

unread,
Apr 14, 2021, 6:21:15 AM4/14/21
to vim/vim, Subscribed

I have find some new info and a solution.
After logout and login, loginctl list-sessions shows two sessions existing, state of one in them is closed. After killing this closed session, vim boots normally.
I don't know the root reason.

Christian Brabandt

unread,
Apr 14, 2021, 6:28:24 AM4/14/21
to vim/vim, Subscribed

can you make sure, that $DISPLAY does not change? Can you run with with -V so we get better messages? I suppose, Vim is trying to reconnect to the wrong session.

link

unread,
Apr 14, 2021, 6:28:49 AM4/14/21
to vim/vim, Subscribed

link

unread,
Apr 14, 2021, 6:36:39 AM4/14/21
to vim/vim, Subscribed

Closed #6199.

zhaoyunfeng

unread,
Nov 3, 2022, 4:05:17 AM11/3/22
to vim/vim, Subscribed

Reopened #6199.


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/6199/issue_event/7729705532@github.com>

zhaoyunfeng

unread,
Nov 3, 2022, 4:08:16 AM11/3/22
to vim/vim, Subscribed

This problem still be exist.
Now after logout and login, loginctl list-sessions doesn't show two sessions.
This is -V info

XSMP opening connection
XSMP SmcOpenConnection failed: Could not open network socket
chdir(/usr/share/vim/vim90)
fchdir() to previous dir
...
Opening the X display took 1 msecTesting the X display failed

This is startup-time log


times in msec
 clock   self+sourced   self:  sourced script
 clock   elapsed:              other lines

000.006  000.006: --- VIM STARTING ---
000.077  000.071: Allocated generic buffers
000.143  000.066: locale set
000.150  000.007: GUI prepared
000.151  000.001: clipboard setup
000.154  000.003: window checked
000.484  000.330: inits 1
000.508  000.024: parsing arguments
000.509  000.001: expanding arguments
000.521  000.012: shell init
1000.834  1000.313: xsmp init
1001.408  000.574: Termcap init
1001.460  000.052: inits 2
1001.689  000.229: init highlight
...


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/6199/1301759577@github.com>

Christian Brabandt

unread,
Nov 3, 2022, 4:24:00 AM11/3/22
to vim/vim, Subscribed

so can you verify that $DISPLAY is set correctly?


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/6199/1301773447@github.com>

zhaoyunfeng

unread,
Nov 3, 2022, 4:58:38 AM11/3/22
to vim/vim, Subscribed

so can you verify that $DISPLAY is set correctly?

After logout and login without reboot, I open terminal, and echo $DISPLAY which is always :0. And vim starts slowly in the same terminal.


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/6199/1301804219@github.com>

Christian Brabandt

unread,
Nov 3, 2022, 5:10:58 AM11/3/22
to vim/vim, Subscribed

hm, shouldn't that rather be :0.0 as default?


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/6199/1301817682@github.com>

zhaoyunfeng

unread,
Nov 3, 2022, 6:04:26 AM11/3/22
to vim/vim, Subscribed

I don't know where it is set, but it is :0 even if after reboot.


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/6199/1301872727@github.com>

Brandon Richardson

unread,
Nov 24, 2022, 1:55:42 PM11/24/22
to vim/vim, Subscribed

I just ran into this too. My environment got away from me and X restarted itself. After that, Vim startup is super slow. My $DISPLAY is also :0.

$ vim --clean -V
XSMP opening connection
XSMP SmcOpenConnection failed: Could not open network socket
...


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/6199/1326774610@github.com>

zhaoyunfeng

unread,
Nov 24, 2022, 10:05:01 PM11/24/22
to vim/vim, Subscribed

I cannot reproduce now. Don't know why.


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/6199/1326973677@github.com>

zhaoyunfeng

unread,
Dec 8, 2022, 9:23:43 PM12/8/22
to vim/vim, Subscribed

I cannot reproduce now. Don't know why.

I reproduce it. I use ctrl+shift+backspace to kill and restart X server, and this problem occurs.


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/6199/1343755225@github.com>

zhaoyunfeng

unread,
Dec 8, 2022, 10:30:32 PM12/8/22
to vim/vim, Subscribed

I find the cause finally from here https://superuser.com/a/1599473/759512.
After X server is replaced, I reuse the tmux server belonging to the last destroyed X server.So it it the tmux-server makes vim trying to connect last destroyed X server session via the XSMP.
Just kill old tmux-server by this way:

  1. list tmux sockets: lsof -U | grep '^tmux'
  2. kill server tmux -L specify-socket-name kill-server

I think nothing vim can do, it should not vim's problem.


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/6199/1343801537@github.com>

zhaoyunfeng

unread,
Dec 8, 2022, 10:30:35 PM12/8/22
to vim/vim, Subscribed

Closed #6199 as completed.


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/6199/issue_event/7995009392@github.com>

Reply all
Reply to author
Forward
0 new messages