Tuesday, August 8, 2023

Apps terminating in Wayland on Linux with error "Gdk-Message: 07:27:13.932: Error flushing display: Resource temporarily unavailable"

Recently I came across a problem where virt-viewer a program which provides a viewer for virtual machines would suddenly crash.

 I was able to reproduce this a couple of times so I looked into it trying to research the root cause problem. 

 

In the terminal I noticed the below:

(virt-viewer:8795): virt-viewer-WARNING **: 07:26:13.285: (virt-viewer-app.c:840):viewer_window_focus_out_cb: runtime check failed: (self->priv->focused >= 0)

Gdk-Message: 07:27:13.932: Error flushing display: Resource temporarily unavailable

 On further research I noticed that other apps also had the error. It appears that Wayland causes this crash.

Heres a workaround:

run the app in terminal with:

env GDK_BACKEND=x11
  <app-name>

e.g.

 env GDK_BACKEND=x11 virt-viewer 

or 

env GDK_BACKEND=x11 xterm

Sunday, February 26, 2023

Finding processes using a port

On and off you may find that you cannot launch a process which needs a port when another process is using the same port. But it is difficult to identify this conflicting process. Here's a tip you can try: lsof -i: e.g. to see which process is using the port 1040 use lsof -i:1040