[vim/vim] Gvim process becomes stray with 100% CPU usage after Xorg dies (Issue #11221)

102 views
Skip to first unread message

nteodosio

unread,
Sep 25, 2022, 11:53:55 AM9/25/22
to vim/vim, Subscribed

Steps to reproduce

  1. Launch Tmux.
  2. Launch Gvim (Motif version) in it.
  3. Kill Xorg.

Expected behaviour

Either Gvim dies or at least stays idle (not consuming 100% CPU, as reported by top).

Version of Vim

9.0 (included patches: 1-242)

Environment

OS: Ubuntu 22.10.
Shell: Bash.

Logs and stack traces

No response


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/11221@github.com>

Bram Moolenaar

unread,
Sep 25, 2022, 2:27:30 PM9/25/22
to vim/vim, Subscribed


> ### Steps to reproduce
>
> 1. Launch Tmux.
> 2. Launch Gvim (Motif version) in it.
> 3. Kill Xorg.
>
> ### Expected behaviour
>
> Either Gvim dies or at least stays idle (not consuming 100% CPU, as reported by `top`).
>
> ### Version of Vim
>
> 9.0 (included patches: 1-242)
>
> ### Environment

>
> OS: Ubuntu 22.10.
> Shell: Bash.

Killing the X server is generally a bad idea...

Can you see where Vim is busy-looping?
Perhaps it never got a signal to exit. Or tmux is somehow keeping it
alive until the X server comes back.

--
hundred-and-one symptoms of being an internet addict:
171. You invent another person and chat with yourself in empty chat rooms.

/// Bram Moolenaar -- ***@***.*** -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///


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/11221/1257250769@github.com>

Christian Brabandt

unread,
Sep 26, 2022, 7:46:10 AM9/26/22
to vim/vim, Subscribed

Make sure that $DISPLAY is correct and then use the :xrestore command to re-initialize the X11 connection. Does that work?


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/11221/1257907783@github.com>

nteodosio

unread,
Sep 26, 2022, 8:05:40 AM9/26/22
to vim/vim, Subscribed

Can you see where Vim is busy-looping?

I'll do that and report back.

Make sure that $DISPLAY is correct and then use the :xrestore command to re-initialize the X11 connection. Does that work?

Nope.


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/11221/1257930184@github.com>

nteodosio

unread,
Sep 27, 2022, 6:59:42 AM9/27/22
to vim/vim, Subscribed

If I try gvim --nofork in Gdb in Tmux, Gvim does die when the server is killed. Any idea how to proceed?


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/11221/1259334559@github.com>

nteodosio

unread,
Sep 27, 2022, 7:03:02 AM9/27/22
to vim/vim, Subscribed

Perhaps it never got a signal to exit. Or tmux is somehow keeping it
alive until the X server comes back.

It certainly looks like that by keeping the calling shell alive, Gvim also survives.

But I just tested and this doesn't happen with GTK Gvim, which does die.


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/11221/1259337711@github.com>

delvh

unread,
Oct 29, 2023, 5:52:14 PM10/29/23
to vim/vim, Subscribed

Well… I've also encountered something similar with terminal Vim:
Sometimes, when I look into htop, I find an abandoned vim process whose shell should already be closed.
I at least cannot find the shell anymore.
However, this vim process idles with 100% CPU usage on one core, and is even quite resilient to dying:
A normal SIGTERM does not do anything, even with root permissions.
Only a SIGKILL helps.

To me, it sounds a bit as if Vim is trapped inside an endless busy-waiting loop whenever this happens.
However, I have no idea how I even manage to produce such a zombie-Vim (but it is probably not killing the x server as described above as I encounter this problem far more often than the amount of times I kill my x server).


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

errael

unread,
Oct 29, 2023, 8:59:14 PM10/29/23
to vim/vim, Subscribed

it sounds a bit as if Vim is trapped inside an endless busy-waiting loop whenever this happens.

and is ignoring signals!?

I wonder if you could attach the process with gdb and get a stack trace or some other useful info?


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/11221/1784318060@github.com>

errael

unread,
Oct 29, 2023, 9:09:16 PM10/29/23
to vim/vim, Subscribed

Oh, I just looked, neither of the signals you mention produces a Core. I wonder if SIGSEGV, SIGBUS, SIGQUIT, or who knows what, might produce a core file? The system may need to be configured to produce a core (I vaguely recall having to do that when I finally moved to linux).


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/11221/1784324207@github.com>

delvh

unread,
Oct 30, 2023, 3:39:15 AM10/30/23
to vim/vim, Subscribed

I'll try to create a core file the next time I encounter this problem.
After all, it only occurs stochastically maybe once a week (for me, and I use vim already regularly)


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/11221/1784634667@github.com>

Reply all
Reply to author
Forward
0 new messages