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

x0tigervncserver crashes on user action under VNC desktop #869

Open
allefeld opened this issue Sep 13, 2019 · 43 comments
Open

x0tigervncserver crashes on user action under VNC desktop #869

allefeld opened this issue Sep 13, 2019 · 43 comments
Labels
notourbug This issue needs to be resolved elsewhere

Comments

@allefeld
Copy link

allefeld commented Sep 13, 2019

Describe the bug
I run x0tigervncserver on a Debian 10 (stable) computer remotely via ssh, in order to access the already running X session (with KDE, non-free nvidia-driver). I can connect to the VNC server using Remmina and the desktop gets displayed, I can open windows etc., but after a short while some action (e.g. clicking on the KDE menu, clicking on a window to change focus, etc.) lets the VNC server crash. Here is one example log, they look different in detail but always end with "fatal IO error 11":

$ x0tigervncserver -display :0 -rfbauth .vnc/passwd -Log='*:stderr:100'

Fri Sep 13 16:18:04 2019
 Geometry:    Desktop geometry is set to 2560x1440+0+0
 XDesktop:    Mask for 'Scroll Lock' is 0x4
 XDesktop:    Mask for 'Num Lock' is 0x2
 XDesktop:    Mask for 'Caps Lock' is 0x1
 XDesktop:    Using evdev codemap

 XDesktop:    XTest extension present - version 2.2
 XDesktop:    RANDR extension not present
 XDesktop:    Will not be able to handle session resize
 VNCServerST: creating single-threaded server x0vncserver
 Main:        Listening on port 5900

Fri Sep 13 16:18:11 2019
 Connections: accepted: 10.207.240.84::54370
 SConnection: reading protocol version
 SConnection: Client needs protocol version 3.8
 SConnection: processing security type message
 SConnection: Client requests security type VeNCrypt(19)
 SConnection: processing security message
 SConnection: processing security message
 SConnection: processing security message
 SConnection: processing security message
 SVeNCrypt:   Client requests security type TLSVnc (258)
 TLS:         Process security message (session (nil))
 TLS:         Anonymous session has been set
 TLS:         Deferring completion of TLS handshake: Resource temporarily
              unavailable, try again.
 SConnection: processing security message
 TLS:         Process security message (session 0x55787c9d5d60)
 TLS:         Deferring completion of TLS handshake: Resource temporarily
              unavailable, try again.

Fri Sep 13 16:18:12 2019
 SConnection: processing security message
 TLS:         Process security message (session 0x55787c9d5d60)
 TLS:         Handshake completed

Fri Sep 13 16:18:13 2019
 SConnection: processing security message
 SVncAuth:    reading password file
 VNCServerST: starting desktop
 XDesktop:    Enabling 8 buttons of X pointer device
 XDesktop:    Allocated shared memory image
 VNCSConnST:  Server default pixel format depth 24 (32bpp) little-endian rgb888
 SConnection: reading client initialisation
 VNCSConnST:  Client pixel format depth 24 (32bpp) little-endian rgb888

Fri Sep 13 16:18:33 2019
 VNCSConnST:  Key pressed: 0xffe9 / 0x0
 VNCSConnST:  Key released: 0xffe9 / 0x0
 VNCSConnST:  Key released: 0xffe9 / 0x0
 VNCSConnST:  Key released: 0xffbf / 0x0

Fri Sep 13 16:18:34 2019
 VNCSConnST:  Key pressed: 0xffe9 / 0x0
 VNCSConnST:  Key released: 0xffe9 / 0x0
 VNCSConnST:  Key pressed: 0xffe9 / 0x0
 VNCSConnST:  Key pressed: 0xffbf / 0x0
 VNCSConnST:  Key released: 0xffe9 / 0x0

Fri Sep 13 16:18:35 2019
 VNCSConnST:  Key released: 0xffbf / 0x0

Fri Sep 13 16:18:38 2019
 VNCSConnST:  Key pressed: 0x68 / 0x0
 VNCSConnST:  Key released: 0x68 / 0x0
 VNCSConnST:  Key pressed: 0x65 / 0x0
 VNCSConnST:  Key released: 0x65 / 0x0
 VNCSConnST:  Key pressed: 0x6c / 0x0
 VNCSConnST:  Key released: 0x6c / 0x0
 VNCSConnST:  Key pressed: 0x6c / 0x0
 VNCSConnST:  Key released: 0x6c / 0x0
 VNCSConnST:  Key pressed: 0x6f / 0x0
 VNCSConnST:  Key released: 0x6f / 0x0

Fri Sep 13 16:18:40 2019
 VNCSConnST:  Key pressed: 0xff0d / 0x0
 VNCSConnST:  Key released: 0xff0d / 0x0

Fri Sep 13 16:18:41 2019
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 VNCSConnST:  Key released: 0xff08 / 0x0

Fri Sep 13 16:18:42 2019
 VNCSConnST:  Key pressed: 0xff0d / 0x0
 VNCSConnST:  Key released: 0xff0d / 0x0
XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0"
      after 3061 requests (3061 known processed) with 0 events remaining.

To Reproduce
See above.

Expected behavior
The VNC server not to crash.

Client (please complete the following information):

  • OS: Debian 10 (stable)
  • VNC client: Remmina
  • VNC client version: 1.3.3
  • Client downloaded from: Debian 10 (stable)

Server (please complete the following information):

  • OS: Debian 10 (stable)
  • VNC server: x0tigervncserver
  • VNC server version: 1.9.0
  • Server downloaded from: Debian 10 (stable)
  • Server was started using: see above

Additional context
The VNC connection goes through a VPN based on SonicWALL's ConnectTunnel application. I do not have any connectivity problems with this connection, e.g. when the VNC server started under SSH crashes, the SSH connection itself is unaffected.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@CendioOssman
Copy link
Member

Hmm... very odd. The X server seems to be disconnecting us.

Could you test one of our nightly builds and see if it behaves the same?

@CendioOssman CendioOssman added the bug Something isn't working label Oct 4, 2019
@CendioOssman
Copy link
Member

That is the latest stable release. But it is helpful to know that it shows the same behaviour as Debian's build.

The nightly builds are available via a link on our homepage, pointing to http://tigervnc.bphinz.com/nightly/. Please test tigervnc-1.9.80-20191004gite71a426.x86_64.tar.gz there.

@allefeld
Copy link
Author

allefeld commented Oct 4, 2019

Here it is:

$ tigervnc-1.9.80-20191004gite71a426.x86_64/usr/bin/x0vncserver -display :0 -rfbauth .vnc/passwd -Log='*:stderr:100'          

Fri Oct  4 15:37:16 2019
 Geometry:    Desktop geometry is set to 2560x1440+0+0
 XDesktop:    Mask for 'Scroll Lock' is 0x4
 XDesktop:    Mask for 'Num Lock' is 0x2
 XDesktop:    Mask for 'Caps Lock' is 0x1
 XDesktop:    Using evdev codemap
 XDesktop:    
 XDesktop:    XTest extension present - version 2.2
 VNCServerST: creating single-threaded server x0vncserver
 Main:        Listening on port 5900

Fri Oct  4 15:37:21 2019
 Connections: accepted: 10.207.240.84::33250
 SConnection: reading protocol version
 SConnection: Client needs protocol version 3.8
 SConnection: processing security type message
 SConnection: Client requests security type VeNCrypt(19)
 SConnection: processing security message
 SConnection: processing security message
 SConnection: processing security message
 SConnection: processing security message
 SVeNCrypt:   Client requests security type TLSVnc (258)
 TLS:         Process security message (session (nil))
 TLS:         Anonymous session has been set
 TLS:         Deferring completion of TLS handshake: Resource temporarily
              unavailable, try again.
 SConnection: processing security message
 TLS:         Process security message (session 0x1851b20)
 TLS:         Deferring completion of TLS handshake: Resource temporarily
              unavailable, try again.

Fri Oct  4 15:37:22 2019
 SConnection: processing security message
 TLS:         Process security message (session 0x1851b20)
 TLS:         Deferring completion of TLS handshake: Resource temporarily
              unavailable, try again.
 SConnection: processing security message
 TLS:         Process security message (session 0x1851b20)
 TLS:         TLS handshake completed with
              (TLS1.2)-(ANON-DH-1024)-(AES-256-GCM)

Fri Oct  4 15:37:23 2019
 SConnection: processing security message
 SVncAuth:    reading password file
 VNCServerST: starting desktop
 XDesktop:    Enabling 8 buttons of X pointer device
 XDesktop:    Allocated shared memory image
 VNCSConnST:  Server default pixel format depth 24 (32bpp) little-endian rgb888
 SConnection: reading client initialisation
 VNCSConnST:  Client pixel format depth 24 (32bpp) little-endian rgb888

Fri Oct  4 15:37:28 2019
 VNCSConnST:  Key released: 0xffc9 / 0x0

Fri Oct  4 15:37:35 2019
 VNCSConnST:  Key released: 0x66 / 0x0

Fri Oct  4 15:37:36 2019
 VNCSConnST:  Key pressed: 0xffc9 / 0x0
 XDesktop:    96 down
 VNCSConnST:  Key released: 0xffc9 / 0x0
 XDesktop:    96 up

Fri Oct  4 15:37:39 2019
 VNCSConnST:  Key pressed: 0xffc9 / 0x0
 XDesktop:    96 down
 VNCSConnST:  Key released: 0xffc9 / 0x0
 XDesktop:    96 up

Fri Oct  4 15:38:14 2019
 VNCSConnST:  Key pressed: 0xffc9 / 0x0
 XDesktop:    96 down
 VNCSConnST:  Key released: 0xffc9 / 0x0
 XDesktop:    96 up

Fri Oct  4 15:38:15 2019
 VNCSConnST:  Key pressed: 0xff52 / 0x0
 XDesktop:    111 down
 VNCSConnST:  Key released: 0xff52 / 0x0
 XDesktop:    111 up

Fri Oct  4 15:38:16 2019
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down

Fri Oct  4 15:38:17 2019
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down

Fri Oct  4 15:38:18 2019
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down

Fri Oct  4 15:38:19 2019
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key released: 0xff08 / 0x0
 XDesktop:    22 up
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key released: 0xff08 / 0x0
 XDesktop:    22 up
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key released: 0xff08 / 0x0
 XDesktop:    22 up
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key released: 0xff08 / 0x0
 XDesktop:    22 up

Fri Oct  4 15:38:20 2019
 VNCSConnST:  Key pressed: 0xff08 / 0x0
 XDesktop:    22 down
 VNCSConnST:  Key released: 0xff08 / 0x0
 XDesktop:    22 up

Fri Oct  4 15:38:21 2019
 VNCSConnST:  Key pressed: 0x2d / 0x0
 XDesktop:    61 down
 VNCSConnST:  Key released: 0x2d / 0x0
 XDesktop:    61 up
 VNCSConnST:  Key pressed: 0x76 / 0x0
 XDesktop:    55 down
 VNCSConnST:  Key released: 0x76 / 0x0
 XDesktop:    55 up
 VNCSConnST:  Key pressed: 0x65 / 0x0
 XDesktop:    26 down
 VNCSConnST:  Key released: 0x65 / 0x0
 XDesktop:    26 up
 VNCSConnST:  Key pressed: 0x72 / 0x0
 XDesktop:    27 down
 VNCSConnST:  Key released: 0x72 / 0x0
 XDesktop:    27 up

Fri Oct  4 15:38:22 2019
 VNCSConnST:  Key pressed: 0x73 / 0x0
 XDesktop:    39 down
 VNCSConnST:  Key released: 0x73 / 0x0
 XDesktop:    39 up
 VNCSConnST:  Key pressed: 0x69 / 0x0
 XDesktop:    31 down
 VNCSConnST:  Key pressed: 0x6f / 0x0
 XDesktop:    32 down
 VNCSConnST:  Key released: 0x69 / 0x0
 XDesktop:    31 up
 VNCSConnST:  Key released: 0x6f / 0x0
 XDesktop:    32 up
 VNCSConnST:  Key pressed: 0x6e / 0x0
 XDesktop:    57 down
 VNCSConnST:  Key released: 0x6e / 0x0
 XDesktop:    57 up
 VNCSConnST:  Key pressed: 0xff0d / 0x0
 XDesktop:    36 down
 VNCSConnST:  Key released: 0xff0d / 0x0
 XDesktop:    36 up

Fri Oct  4 15:38:29 2019
 VNCSConnST:  Key released: 0x66 / 0x0
XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0"
      after 5856 requests (5856 known processed) with 0 events remaining.

@CendioOssman
Copy link
Member

Great, thanks. So it seems the issue is still there.

Not sure how to debug this. Could you try running it via xtruss and see if we can catch what happens just before it crashes?

@allefeld
Copy link
Author

There don't seem to be binary packages for xtruss in Debian or otherwise. I managed to compile it from 2018 sources. However, the output doesn't seem to be giving any more information. Please tell me specifically which options you want me to use.

$ xtruss-20181001.82973f5/xtruss -display :0 tigervnc-1.9.80-20191004gite71a426.x86_64/usr/bin/x0vncserver -display :0 -rfbauth ~/.vnc/passwd

Fri Oct 11 17:08:21 2019
 Geometry:    Desktop geometry is set to 2560x1440+0+0
 XDesktop:    Using evdev codemap
 XDesktop:    
 XDesktop:    XTest extension present - version 2.2
 Main:        Listening on port 5900

Fri Oct 11 17:08:27 2019
 Connections: accepted: 10.207.240.156::36378

Fri Oct 11 17:08:28 2019
 SConnection: Client needs protocol version 3.8
 SConnection: Client requests security type VeNCrypt(19)
 SVeNCrypt:   Client requests security type TLSVnc (258)

Fri Oct 11 17:08:36 2019
 XDesktop:    Enabling 8 buttons of X pointer device
 XDesktop:    Allocated shared memory image
 VNCSConnST:  Server default pixel format depth 24 (32bpp) little-endian rgb888
 VNCSConnST:  Client pixel format depth 24 (32bpp) little-endian rgb888
XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0"
      after 3400 requests (3400 known processed) with 0 events remaining.

@CendioOssman
Copy link
Member

You need to omit the -display argument to x0vncserver or it will bypass xtruss.

@allefeld
Copy link
Author

Ok, here is the result. I'm just posting the end, because the full log is very long:

GetImage(drawable=wp#0000023D, x=0, y=1394, width=2560, height=46, plane-mask=0xFFFFFFFF, format=ZPixmap) = <unfinished>
--- DAMAGE:UnknownEvent0
 ... GetImage(drawable=wp#0000023D, x=0, y=1394, width=2560, height=46, plane-mask=0xFFFFFFFF, format=ZPixmap) = {depth=24, visual=v#00000021, image-data=00696D71:00696D71:00696D71:00696D71:00696D71:00696D71:00696D71:00696D71:00696D71:00696D71:00696D71:00696D71:00696D71:00696D71:00696D71:00696D71:00696D71:00696D71:00696D71:00696D71:00696D71:00696D71:00696D71:00696D71:...}
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
XTEST:UnknownExtensionRequest2(bytes=36)
XTEST:UnknownExtensionRequest2(bytes=36)
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
XTEST:UnknownExtensionRequest2(bytes=36)
--- DAMAGE:UnknownEvent0
ShmGetImage(drawable=wp#0000023D, x=0, y=0, width=2560, height=1440, plane-mask=0xFFFFFFFF, format=ZPixmap, shmseg=0x06000007, offset=0x00000000) = <unfinished>
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
 ... ShmGetImage(drawable=wp#0000023D, x=0, y=0, width=2560, height=1440, plane-mask=0xFFFFFFFF, format=ZPixmap, shmseg=0x06000007, offset=0x00000000) = {depth=24, visual=v#00000021, size=14745600}
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
GetImage(drawable=wp#0000023D, x=0, y=0, width=2560, height=29, plane-mask=0xFFFFFFFF, format=ZPixmap) = {depth=24, visual=v#00000021, image-data=00475057:00475057:00475057:00475057:00475057:00475057:00475057:00475057:00475057:00475057:00475057:00475057:00475057:00475057:00475057:00475057:00475057:00475057:00475057:00475057:00475057:00475057:00475057:00475057:...}
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
GetImage(drawable=wp#0000023D, x=2, y=131, width=656, height=10, plane-mask=0xFFFFFFFF, format=ZPixmap) = {depth=24, visual=v#00000021, image-data=00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00C6C7C7:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:...}
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
GetImage(drawable=wp#0000023D, x=2, y=141, width=656, height=1185, plane-mask=0xFFFFFFFF, format=ZPixmap) = {depth=24, visual=v#00000021, image-data=00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00BDBEBE:004B4E4F:00BDBEBE:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:...}
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
ShmGetImage(drawable=wp#0000023D, x=0, y=0, width=2560, height=1440, plane-mask=0xFFFFFFFF, format=ZPixmap, shmseg=0x06000007, offset=0x00000000) = {depth=24, visual=v#00000021, size=14745600}
--- DAMAGE:UnknownEvent0
GetImage(drawable=wp#0000023D, x=2, y=1326, width=656, height=34, plane-mask=0xFFFFFFFF, format=ZPixmap) = {depth=24, visual=v#00000021, image-data=00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:00F3F4F4:...}
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- PropertyNotify(window=w#0000023D, atom=a#332, state=NewValue, time=0x4D2C3E4A)
--- PropertyNotify(window=w#0000023D, atom=a#332, state=Deleted, time=0x4D2C3E4B)
GetImage(drawable=wp#0000023D, x=0, y=1394, width=2560, height=46, plane-mask=0xFFFFFFFF, format=ZPixmap) = {depth=24, visual=v#00000021, image-data=0A07005B:0000023D:0600000A:4D2C3E5A:05720000:002E0A00:00000000:05A00A00:00696D71:00696D71:00696D71:00696D71:00696D71:00696D71:00696D71:00696D71:00696D71:00696D71:00696D71:00696D71:00696D71:00696D71:00696D71:00696D71:...}
--- UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
--- DAMAGE:UnknownEvent0
XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server "XXX:10"
      after 2569 requests (2569 known processed) with 14 events remaining.
XTEST:UnknownExtensionRequest2(bytes=36)
QueryPointer(window=w#0000023D) = {root=w#0000023D, child=w#01800897, same-screen=True, root-x=37, root-y=1064, win-x=37, win-y=1064, mask=0x0000}

I replaced the host name with XXX on the 4th last line.

I have the impression that the error occurs more often (but not exclusively) when a Java GUI application starts.

@CendioOssman
Copy link
Member

Unfortunately there is nothing obviously wrong there. :/

Could you check the X server log (the one on :0) and see what it says when this happens?

@allefeld
Copy link
Author

allefeld commented Nov 7, 2019

I again ran x0vncserver with xtruss and connected via VPN until a crash occurred – at 16:36.

After that, /var/log/Xorg.0.log has the file modification time 16:26:11, so it doesn't seem to have been updated during the crash. I don't know how to interpret the timestamps within the file. Here are the last lines:

[3261039.236] (II) NVIDIA(0): Setting mode "DP-2: nvidia-auto-select @2560x1440 +0+0 {ViewPortIn=2560x1440, ViewPortOut=2560x1440+0+0}"
[3268030.827] (--) NVIDIA(GPU-0): DFP-0: disconnected
[3268030.827] (--) NVIDIA(GPU-0): DFP-0: Internal DisplayPort
[3268030.827] (--) NVIDIA(GPU-0): DFP-0: 1440.0 MHz maximum pixel clock
[3268030.827] (--) NVIDIA(GPU-0): 
[3268030.827] (--) NVIDIA(GPU-0): DFP-1: disconnected
[3268030.827] (--) NVIDIA(GPU-0): DFP-1: Internal TMDS
[3268030.827] (--) NVIDIA(GPU-0): DFP-1: 165.0 MHz maximum pixel clock
[3268030.827] (--) NVIDIA(GPU-0): 
[3268030.828] (--) NVIDIA(GPU-0): HPN HP E273q (DFP-2): connected
[3268030.828] (--) NVIDIA(GPU-0): HPN HP E273q (DFP-2): Internal DisplayPort
[3268030.828] (--) NVIDIA(GPU-0): HPN HP E273q (DFP-2): 1440.0 MHz maximum pixel clock
[3268030.828] (--) NVIDIA(GPU-0): 
[3268030.829] (--) NVIDIA(GPU-0): DFP-3: disconnected
[3268030.829] (--) NVIDIA(GPU-0): DFP-3: Internal TMDS
[3268030.829] (--) NVIDIA(GPU-0): DFP-3: 165.0 MHz maximum pixel clock
[3268030.829] (--) NVIDIA(GPU-0): 
[3268030.829] (--) NVIDIA(GPU-0): DFP-4: disconnected
[3268030.829] (--) NVIDIA(GPU-0): DFP-4: Internal DisplayPort
[3268030.829] (--) NVIDIA(GPU-0): DFP-4: 1440.0 MHz maximum pixel clock
[3268030.829] (--) NVIDIA(GPU-0): 
[3268030.829] (--) NVIDIA(GPU-0): DFP-5: disconnected
[3268030.829] (--) NVIDIA(GPU-0): DFP-5: Internal TMDS
[3268030.829] (--) NVIDIA(GPU-0): DFP-5: 165.0 MHz maximum pixel clock
[3268030.829] (--) NVIDIA(GPU-0): 
[3268030.829] (--) NVIDIA(GPU-0): DFP-6: disconnected
[3268030.829] (--) NVIDIA(GPU-0): DFP-6: Internal DisplayPort
[3268030.829] (--) NVIDIA(GPU-0): DFP-6: 1440.0 MHz maximum pixel clock
[3268030.829] (--) NVIDIA(GPU-0): 
[3268030.829] (--) NVIDIA(GPU-0): DFP-7: disconnected
[3268030.830] (--) NVIDIA(GPU-0): DFP-7: Internal TMDS
[3268030.830] (--) NVIDIA(GPU-0): DFP-7: 165.0 MHz maximum pixel clock
[3268030.830] (--) NVIDIA(GPU-0): 
[3280372.422] (--) NVIDIA(GPU-0): DFP-2: disconnected
[3280372.422] (--) NVIDIA(GPU-0): DFP-2: Internal DisplayPort
[3280372.422] (--) NVIDIA(GPU-0): DFP-2: 1440.0 MHz maximum pixel clock
[3280372.422] (--) NVIDIA(GPU-0): 
[3280373.213] (II) NVIDIA(0): Setting mode "NULL"
[3361768.992] (--) NVIDIA(GPU-0): DFP-0: disconnected
[3361768.992] (--) NVIDIA(GPU-0): DFP-0: Internal DisplayPort
[3361768.992] (--) NVIDIA(GPU-0): DFP-0: 1440.0 MHz maximum pixel clock
[3361768.992] (--) NVIDIA(GPU-0): 
[3361768.993] (--) NVIDIA(GPU-0): DFP-1: disconnected
[3361768.993] (--) NVIDIA(GPU-0): DFP-1: Internal TMDS
[3361768.993] (--) NVIDIA(GPU-0): DFP-1: 165.0 MHz maximum pixel clock
[3361768.993] (--) NVIDIA(GPU-0): 
[3361768.993] (--) NVIDIA(GPU-0): DFP-2: disconnected
[3361768.993] (--) NVIDIA(GPU-0): DFP-2: Internal DisplayPort
[3361768.993] (--) NVIDIA(GPU-0): DFP-2: 1440.0 MHz maximum pixel clock
[3361768.993] (--) NVIDIA(GPU-0): 
[3361768.993] (--) NVIDIA(GPU-0): DFP-3: disconnected
[3361768.993] (--) NVIDIA(GPU-0): DFP-3: Internal TMDS
[3361768.993] (--) NVIDIA(GPU-0): DFP-3: 165.0 MHz maximum pixel clock
[3361768.993] (--) NVIDIA(GPU-0): 
[3361768.993] (--) NVIDIA(GPU-0): DFP-4: disconnected
[3361768.993] (--) NVIDIA(GPU-0): DFP-4: Internal DisplayPort
[3361768.993] (--) NVIDIA(GPU-0): DFP-4: 1440.0 MHz maximum pixel clock
[3361768.993] (--) NVIDIA(GPU-0): 
[3361768.993] (--) NVIDIA(GPU-0): DFP-5: disconnected
[3361768.993] (--) NVIDIA(GPU-0): DFP-5: Internal TMDS
[3361768.993] (--) NVIDIA(GPU-0): DFP-5: 165.0 MHz maximum pixel clock
[3361768.993] (--) NVIDIA(GPU-0): 
[3361768.994] (--) NVIDIA(GPU-0): DFP-6: disconnected
[3361768.994] (--) NVIDIA(GPU-0): DFP-6: Internal DisplayPort
[3361768.994] (--) NVIDIA(GPU-0): DFP-6: 1440.0 MHz maximum pixel clock
[3361768.994] (--) NVIDIA(GPU-0): 
[3361768.994] (--) NVIDIA(GPU-0): DFP-7: disconnected
[3361768.994] (--) NVIDIA(GPU-0): DFP-7: Internal TMDS
[3361768.994] (--) NVIDIA(GPU-0): DFP-7: 165.0 MHz maximum pixel clock
[3361768.994] (--) NVIDIA(GPU-0):

The card has many outputs of which I only use one (DFP-2), and at this time the attached monitor is switched off, so all outputs are reported as disconnected in the last message. I switched the monitor off yesterday evening at about 18:00, but X is continuing to run and I was able to connect via x0vncserver. So as far as I can tell, there is no information about the crash in the X server log.

@CendioOssman
Copy link
Member

The timestamps are seconds since launch I think, so they're a bit of a pain to work with.

Could the crash be when the local display decides to go in to standby? The driver might be doing something silly at that point.

On the same note; do you think you could test with a different graphics driver temporarily?

@allefeld
Copy link
Author

I don't think it is related to standby. I access the computer from home after having left work, so by the time I do it the computer should already be in standby. I can connect despite of that, and then the crash usually happens after a few minutes, well before standby should kick in again. Moreover, it happens while I use the computer remotely, so standby should be prevented by my continuous mouse and keyboard interaction.

Switching between nvidia and nouveau drivers is a bit of a hassle, but I'll see whether I can get around to doing it.

@SvenCarlberg
Copy link

SvenCarlberg commented Nov 28, 2019

I am also encountering this problem - here is a gdb backtrace from when the error is thrown:
Breakpoint 1, 0x00007f2181520640 in _XIOError ()
from /usr/lib/x86_64-linux-gnu/libX11.so.6
(gdb) bt
#0 0x00007f2181520640 in _XIOError () from /usr/lib/x86_64-linux-gnu/libX11.so.6
#1 0x00007f218151e80a in _XReply () from /usr/lib/x86_64-linux-gnu/libX11.so.6
#2 0x00007f21815048fd in XGetImage () from /usr/lib/x86_64-linux-gnu/libX11.so.6
#3 0x00007f2181504b91 in XGetSubImage () from /usr/lib/x86_64-linux-gnu/libX11.so.6
#4 0x000000000049c128 in ShmImage::get(unsigned long, int, int, int, int, int, int) ()
#5 0x000000000049ecbb in XPixelBuffer::grabRegion(rfb::Region const&) ()
#6 0x00000000004b3ade in rfb::VNCServerST::writeUpdate() ()
#7 0x00000000004b3c5f in rfb::VNCServerST::handleTimeout(rfb::Timer*) ()
#8 0x00000000004b04bd in rfb::Timer::checkTimeouts() ()
#9 0x0000000000499f25 in main ()

I was actually going to try to build a workaround for this to see if it's just a transient error that could be retried by changing this in Image.cxx:

void ShmImage::get(Window wnd, int x, int y, int w, int h,
                   int dst_x, int dst_y)
{
  int i ;
  // XShmGetImage is faster, but can only retrieve the entire
  // window. Use it for large reads.
  if (x == dst_x && y == dst_y && (long)w * h > (long)xim->width * xim->height / 4) {
    XShmGetImage(dpy, wnd, xim, 0, 0, AllPlanes);
  } else {
    for ( i = 0 ; i < 5 ; i++ ) {
      try {
        XGetSubImage(dpy, wnd, x, y, w, h, AllPlanes, ZPixmap, xim, dst_x, dst_y);
        break ;
      } catch (rdr::Exception &e) {
        vlog.error("XGetSubImage odd bug %s", e.str());
      }
    }
  }
}

(or perhaps skip the grabRegion portion of writeUpdate if this exception occurs and just try the next time)

However I have not yet been successful in getting a build environment setup to compile. Is there a docker image or a vm or something that is pre-configured for tigervnc builds?

@SvenCarlberg
Copy link

Followed build instructions on a clean 16.04 ubuntu vm, but ended up failing at the make for unix/xserver:
vncModule.c:40:23: fatal error: RandrGlue.h: No such file or directory

It would be tremendously helpful if someone could provide some steps to setup a tigervnc build environment from scratch that matches the environment used to build the official linux binaries. E.g. start with stock Centos #.##, yum install [pkgs], etc, etc (or debian, or ubuntu - whatever matches the official build server)
I'm keen on solving/patching the issue noted in this ticket (and can help do so), but I fear that even after I resolve the build quirks I'll end up with a binary that is not-quite-right in some other inscrutable way that will be difficult to diagnose.

@SvenCarlberg
Copy link

Managed to compile a new x0vncserver with the above code, but unfortunately there is no exception thrown - the XIOError simply calls "exit". I think this url is very pertinent to the issue at hand (at least based on the stack trace that I'm getting):

https://stackoverflow.com/questions/23871516/xreply-terminates-app-with-xioerror

@SvenCarlberg
Copy link

What's odd is that the libxcb being used on my system is 1.1.0 which is before the issue noted above. None of the libs being used by x0vncserver have changed. I've been using the same version of x0vncserver for a long time, but it started exhibiting this problem after a system update a few days ago. I've been reviewing the update logs to see which libs/programs were changed to find the root cause, but I don't see any overlap. Xvnc doesn't seem to exhibit this problem, so I might have to use that as a workaround if I can't figure out what's gone awry here.

For additional information, I can reliably make it crash if I open chrome and go to something like youtube and start playing a video. Sometimes just opening chrome and having it visit the homepage of www.google.com is enough to cause the crash, but playing a youtube video makes it crash in a few seconds.

@CendioOssman
Copy link
Member

Are you also on Debian 10, @SvenCarlberg?

@SvenCarlberg
Copy link

The system in question is ubuntu 14.04 which has been semi-updated to 16.04 (never went through full upgrade, but using 16.04 repos for many programss/libs)

I have at least got a workaround for my problem - I forced X11 to use the fbdev driver by creating /usr/share/X11/xorg.conf.d/20-fbdev.conf with this content:

Section "Device"
        Identifier      "Configured Video Device"
        Driver          "fbdev"
EndSection

No more weirdness, but I'm no longer using the official i915 Intel driver (for the CPU's onboard GPU). I still have some 3D acceleration (glx, etc) but I don't know what (if anything) I'm losing by using fbdev instead of the driver which would seem to be more specific for my GPU. I don't do anything graphics-intensive, so probably nothing lost. Maybe this will help the OP (i.e. try changing your X driver and see if that helps). Or perhaps they're hitting the libxcb issue noted earlier.

I think that the main culprit was actually chrome in my case. That was updated in the aforementioned system update and it seems that everything was working fine as long as I didn't try to use chrome. As soon as I opened chrome and started using it for anything substantial, I got that libxcb abort.

@CendioOssman
Copy link
Member

Very odd. But thanks for the extra info.

Someone will have to try to reproduce this and try to debug the code where it goes wrong. I'm afraid I don't think I have time anytime soon myself though. Hopefully someone else can have a look.

@Benik3
Copy link

Benik3 commented Dec 9, 2019

Hi @SvenCarlberg how did you solved the RandrGlue.h missing problem?
I'm trying to compile tigerVNC on CentOS7 and stuck on this error too. I see that the header file is in unix/common folder. Thanks!

@SvenCarlberg
Copy link

@Benik3 I hand-edited the Makefiles to add some absolute paths to the relevant include directories.

Also remember you need to pass in the src dir during make - e.g.:

make TIGERVNC_SRCDIR=../../../tigervnc-1.10.0

@Benik3
Copy link

Benik3 commented Dec 9, 2019

Thanks. I will try something (It's first time what I try build something :D )
yeah, make TIGERVNC_SRCDIR=../../../tigervnc-1.10.0 is exactly what I did
EDIT: I got it working by manually editing unix/xserver/hw/vnc/Makefile.am to static paths.

@stettberger
Copy link

I get a similar error here. I forward part of the screen with x0tigervncserver. And after some time, the server just crashes. However, I observed a few occations where this happens regulary:

  • Starting/Stopping a Video in Google Chrome
  • Closing a Tab in Chrome

What did not provoke a crash

  • OBS Streaming
  • Video in Firefox

I got the follwing error (including the Stacktrace):

[xcb] Unknown sequence number while processing queue
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
x0tigervncserver: ../../src/xcb_io.c:260: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.

Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff6e0a535 in __GI_abort () at abort.c:79
#2  0x00007ffff6e0a40f in __assert_fail_base (fmt=0x7ffff6f6c710 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x7ffff78e7808 "!xcb_xlib_threads_sequence_lost", 
    file=0x7ffff78e7673 "../../src/xcb_io.c", line=260, function=<optimized out>) at assert.c:92
#3  0x00007ffff6e17b92 in __GI___assert_fail (assertion=0x7ffff78e7808 "!xcb_xlib_threads_sequence_lost", file=0x7ffff78e7673 "../../src/xcb_io.c", line=260, 
    function=0x7ffff78e7ac0 "poll_for_event") at assert.c:101
#4  0x00007ffff78745c3 in ?? () from /usr/lib/x86_64-linux-gnu/libX11.so.6
#5  0x00007ffff787466d in ?? () from /usr/lib/x86_64-linux-gnu/libX11.so.6
#6  0x00007ffff7874962 in _XEventsQueued () from /usr/lib/x86_64-linux-gnu/libX11.so.6
#7  0x00007ffff7866511 in XPending () from /usr/lib/x86_64-linux-gnu/libX11.so.6
#8  0x00005555555917f8 in TXWindow::handleXEvents(_XDisplay*) ()
#9  0x00005555555849cf in main ()
(gdb) info threads
  Id   Target Id                                            Frame 
* 1    Thread 0x7ffff600c040 (LWP 366795) "x0tigervncserve" __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50

Perhaps, Chrome is using some X extension that the screen grabbing does not like/handle?

@cagnulein
Copy link

i solved using vnc4server!

@CendioOssman
Copy link
Member

Perhaps, Chrome is using some X extension that the screen grabbing does not like/handle?

That should not affect things as we're not monitoring things on such a low level. We're simply getting notifications when the screen changes and then try to get those changed pixels.

So far the reports have been on either Debian or Ubuntu. I wonder if they simply have a bug in their libX11 or X server that we are triggering.

@stettberger, what version of Debian/Ubuntu are you using?

@stettberger
Copy link

I'm using debian unstable on the VNC Server. Here are a few version numbers that could be of interest.

ii  libx11-dev:amd64                              2:1.6.8-1                                   amd64        X11 client-side library (development headers)
ii  tigervnc-scraping-server                      1.10.1+dfsg-3                               amd64        Virtual network computing server performing X screen scraping
ii  xserver-xorg                                  1:7.7+20                                    amd64        X.Org X server
ii  xserver-xorg-core                             2:1.20.7-3                                  amd64        Xorg X server - core server

@heeen
Copy link

heeen commented May 13, 2020

#869 (comment)
I am also seeing this error message very frequently

@heeen
Copy link

heeen commented May 13, 2020

It is very easy to trigger if you hover the mouse over the task switcher causing live previews to be shown

@stettberger are you running kwin? What rendering backend do you use?

@DanFulger
Copy link

I am also seeing this crash in x0vncserver:
#869 (comment)
Red Hat 7.8 Workstation with KDE, updated today.
Only happens when I use Google Chrome (81.0.4044.138, updated today) but then it happens all the time, not just related to video.
tigervnc-server 1.8.0-19.el7
On another machine with 7.7 I have no issues, tigervnc-server 1.8.0-17.el7. Same version of Chrome.
libxcb-1.13-1.el7 on both machines.
xorg-x11-server-Xorg-1.20.4-10.el7.x86_64 on the bad machine
xorg-x11-server-Xorg-1.20.4-7.el7.x86_64 on the good machine
Major difference between the two machines: the good machine has glamor disabled.

@MutableLoss
Copy link

I have also run into this issue with the 1.9.0 package of x0vncserver on Debian 10, while using the OSX screen sharing as a client. It seems a I use the X display as much as I want, but the moment I open a shell and attempt type, that's when the connection drops for me. Here is the server output:

Wed May 27 00:13:50 2020
 Connections: accepted: 127.0.0.1::50458
 SConnection: Client needs protocol version 3.3
 XDesktop:    Enabling 8 buttons of X pointer device
 XDesktop:    Allocated shared memory image
 VNCSConnST:  Server default pixel format depth 24 (32bpp) little-endian rgb888
 VNCSConnST:  Client pixel format depth 32 (32bpp) little-endian rgb max
              255,255,255 shift 16,8,0

Wed May 27 00:14:11 2020
 Connections: closed: 127.0.0.1::50458 (Clean disconnection)
 EncodeManager: Framebuffer updates: 13
 EncodeManager:   ZRLE:
 EncodeManager:     Solid: 2 rects, 156 pixels
 EncodeManager:            51 B (1:12.7059 ratio)
 EncodeManager:     Indexed RLE: 32 rects, 1.79266 Mpixels
 EncodeManager:                  230.427 KiB (1:30.3913 ratio)
 EncodeManager:     Full Colour: 11 rects, 290.304 kpixels
 EncodeManager:                  52.168 KiB (1:21.7399 ratio)
 EncodeManager:   Total: 45 rects, 2.08312 Mpixels
 EncodeManager:          282.645 KiB (1:28.7914 ratio)
 ComparingUpdateTracker: 2.2741 Mpixels in / 93.908 kpixels out
 ComparingUpdateTracker: (1:24.2163 ratio)

I also tried with Protocol3.3 enabled / disabled, and there was no change. I will try another client, and updated server later.

@akorn
Copy link

akorn commented Jun 10, 2020

I can reproduce this problem (or one very like it) easily and reliably, so if there is anything I should test or debug, I'm happy to help.

The end of xtruss output looks like this (running tigervnc-1.10.80-20200605gitda1ce97.x86_64.tar.gz):

--- DAMAGE:UnknownEvent0
GetImage(drawable=wp#00000386, x=311, y=1212, width=2249, height=192, plane-mask=0xFFFFFFFF, format=ZPixmap) = {depth=24, visual=v#00000021, image-data=01F5805B:00000386:05A0000A:05F4CA15:00190000:049D0A00:00000000:05A01180:01F5805B:00000386:05A0000A:05F4CA15:04B60000:00010028:00000000:05A01180:01F5805B:00000386:05A0000A:05F4CA15:04B60131:000108CF:00000000:05A01180:...}
--- MapRequest(parent=w#00141414, window=w#00141414)
--- MapRequest(parent=w#00141414, window=w#00141414)
--- MapRequest(parent=w#00141414, window=w#00141414)
--- MapRequest(parent=w#00141414, window=w#00141414)
--- MapRequest(parent=w#00141414, window=w#00141414)
--- MapRequest(parent=w#00141414, window=w#00141414)
--- MapRequest(parent=w#00141414, window=w#00141414)
--- MapRequest(parent=w#00141414, window=w#00141414)
--- MapRequest(parent=w#00141414, window=w#00141414)
--- MapRequest(parent=w#00141414, window=w#00141414)
--- MapRequest(parent=w#00141414, window=w#00141414)
--- MapRequest(parent=w#00141414, window=w#00141414)
--- MapRequest(parent=w#00141414, window=w#00141414)
--- MapRequest(parent=w#00141414, window=w#00141414)
--- MapRequest(parent=w#00141414, window=w#00141414)
--- MapRequest(parent=w#00141414, window=w#00141414)
--- MapRequest(parent=w#00141414, window=w#00141414)
--- MapRequest(parent=w#00141414, window=w#00141414)
--- MapRequest(parent=w#00141414, window=w#00141414)
--- MapRequest(parent=w#00141414, window=w#00141414)
--- MapRequest(parent=w#00141414, window=w#00141414)
--- MapRequest(parent=w#00141414, window=w#00141414)
--- MapRequest(parent=w#00141414, window=w#00141414)
X connection to censored-host-name:10 broken (explicit kill or server shutdown).
GetImage(drawable=wp#00000386, x=0, y=1404, width=35, height=2, plane-mask=0xFFFFFFFF, format=ZPixmap)[1]    19793 exit 1     ./xtruss /usr/local/bin/x0tigervncserver.nightly  -RawKeyboard -IdleTimeout 

@pdaliu
Copy link

pdaliu commented Jun 15, 2020

I have had a similar issue recently. I used to run x11vnc but autonomous key repeats began to appear after a system upgrade, which made VNC sessions unusable. After switching to x0vncserver, the crash problem also occurred to me. I can easily reproduce the crashes with KDE App Launcher. Here are a few excerpts from /var/log/syslog:

Jun 15 08:01:21 MacPro start_vncserver.sh[91001]: [xcb] Unknown sequence number while processing queue
Jun 15 08:01:21 MacPro start_vncserver.sh[91001]: [xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
Jun 15 08:01:21 MacPro start_vncserver.sh[91001]: [xcb] Aborting, sorry about that.
Jun 15 08:01:21 MacPro start_vncserver.sh[91001]: x0vncserver: ../../src/xcb_io.c:260: poll_for_event: Assertion !xcb_xlib_threads_sequence_lost' failed. Jun 15 08:01:21 MacPro start_vncserver.sh[90997]: Aborted (core dumped) ..... Jun 15 08:02:21 MacPro start_vncserver.sh[91165]: [xcb] Unknown sequence number while processing queue Jun 15 08:02:21 MacPro start_vncserver.sh[91165]: [xcb] Most likely this is a multi-threaded client and XInitThreads has not been called Jun 15 08:02:21 MacPro start_vncserver.sh[91165]: [xcb] Aborting, sorry about that. Jun 15 08:02:21 MacPro start_vncserver.sh[91165]: x0vncserver: ../../src/xcb_io.c:260: poll_for_event: Assertion !xcb_xlib_threads_sequence_lost' failed.
Jun 15 08:02:21 MacPro start_vncserver.sh[91163]: Aborted (core dumped)
.....
Jun 15 08:02:24 MacPro start_vncserver.sh[91207]: [xcb] Unknown sequence number while processing queue
Jun 15 08:02:24 MacPro start_vncserver.sh[91207]: [xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
Jun 15 08:02:24 MacPro start_vncserver.sh[91207]: [xcb] Aborting, sorry about that.
Jun 15 08:02:24 MacPro start_vncserver.sh[91207]: x0vncserver: ../../src/xcb_io.c:260: poll_for_event: Assertion !xcb_xlib_threads_sequence_lost' failed. Jun 15 08:02:25 MacPro start_vncserver.sh[91202]: Aborted (core dumped) ..... Jun 15 08:02:37 MacPro start_vncserver.sh[91238]: [xcb] Unknown sequence number while processing queue Jun 15 08:02:37 MacPro start_vncserver.sh[91238]: [xcb] Most likely this is a multi-threaded client and XInitThreads has not been called Jun 15 08:02:37 MacPro start_vncserver.sh[91238]: [xcb] Aborting, sorry about that. Jun 15 08:02:37 MacPro start_vncserver.sh[91238]: x0vncserver: ../../src/xcb_io.c:260: poll_for_event: Assertion !xcb_xlib_threads_sequence_lost' failed.
Jun 15 08:02:37 MacPro start_vncserver.sh[91235]: Aborted (core dumped)
.....
Jun 15 08:02:41 MacPro start_vncserver.sh[91248]: [xcb] Unknown sequence number while processing queue
Jun 15 08:02:41 MacPro start_vncserver.sh[91248]: [xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
Jun 15 08:02:41 MacPro start_vncserver.sh[91248]: [xcb] Aborting, sorry about that.
Jun 15 08:02:41 MacPro start_vncserver.sh[91248]: x0vncserver: ../../src/xcb_io.c:260: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.
Jun 15 08:02:41 MacPro start_vncserver.sh[91246]: Aborted (core dumped)
.....

After these repeated crashes, key strokes became unusable. I needed to use mouse to logout and login to reset. Sometimes I could see a similar autonomous key-repeating event on App Launcher after reestablishing a new VNC session.

It seemed to me the problem is related to how key strokes are handled among x0vncserver, X server, and X applications. Because x11vnc also has the strange key-repeating issue, probably a recent upgrade of X itself has something to do with these.

@CendioOssman
Copy link
Member

@DanFulger seems to be on to something here with Glamor. Could a few more of you guys also see if the problem goes away if Glamor is disabled?

@akorn
Copy link

akorn commented Jun 16, 2020

For me, glamor, although technically enabled, doesn't seem to actually work:

[    46.794] (II) NVIDIA(0): Virtual screen size determined to be 640 x 480
[    46.794] (++) NVIDIA(0): DPI set to (168, 168); computed from -dpi X commandline option
[    46.794] (==) modeset(G0): Depth 24, (==) framebuffer bpp 32
[    46.794] (==) modeset(G0): RGB weight 888
[    46.794] (==) modeset(G0): Default visual is TrueColor
[    46.794] (II) Loading sub module "glamoregl"
[    46.794] (II) LoadModule: "glamoregl"
[    46.795] (II) Loading /usr/lib/xorg/modules/libglamoregl.so
[    46.799] (II) Module glamoregl: vendor="X.Org Foundation"
[    46.799]    compiled for 1.20.8, module version = 1.0.1
[    46.799]    ABI class: X.Org ANSI C Emulation, version 0.4
[    46.817] (EE) modeset(G0): eglGetDisplay() failed
[    46.817] (EE) modeset(G0): glamor initialization failed
[    46.817] (II) modeset(G0): ShadowFB: preferred YES, enabled YES
[    46.817] (II) modeset(G0): Double-buffered shadow updates: off
[    46.818] (II) modeset(G0): Output eDP-1-1 has no monitor section
[    46.819] (II) modeset(G0): Output VGA-1-1 has no monitor section
[    46.853] (II) modeset(G0): Output DP-1-1 has no monitor section

I'll try disabling it completely, explicitly, and see if it makes a difference.

@akorn
Copy link

akorn commented Jun 16, 2020

Unfortunately it doesn't.

I disabled glamoregl by adding to xorg.conf

Section "Module"
    Disable "glamoregl"
EndSection

As well as Option "AccelMethod" "none" to my Device section. Glamor is disabled:

# grep -i5 glamor /var/log/Xorg.0.log
[360456.816] (II) xfree86: Adding drm device (/dev/dri/card1)
[360456.816] (II) xfree86: Adding drm device (/dev/dri/card0)
[360456.826] (**) OutputClass "nvidia" ModulePath extended to "/usr/lib/nvidia/nvidia,/usr/lib/xorg/modules,/usr/lib/xorg/modules"
[360456.826] (--) PCI:*(0@0:2:0) 8086:0416:17aa:221e rev 6, Mem @ 0xb1400000/4194304, 0xa0000000/268435456, I/O @ 0x00005000/64, BIOS @ 0x????????/131072
[360456.826] (--) PCI: (1@0:0:0) 10de:0ff6:17aa:221a rev 161, Mem @ 0xb0000000/16777216, 0x80000000/268435456, 0x90000000/33554432, I/O @ 0x00004000/128, BIOS @ 0x????????/524288
[360456.827] (WW) "glamoregl" will not be loaded unless you've specified it to be loaded elsewhere.
[360456.827] (II) "glx" will be loaded by default.
[360456.827] (II) LoadModule: "modesetting"
[360456.827] (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so
[360456.827] (II) Module modesetting: vendor="X.Org Foundation"
[360456.827]    compiled for 1.20.8, module version = 1.20.8
--
[360457.029] (==) modeset(G0): Depth 24, (==) framebuffer bpp 32
[360457.029] (II) Applying OutputClass "intel" options to /dev/dri/card0
[360457.029] (**) modeset(G0): Option "AccelMethod" "none"
[360457.029] (==) modeset(G0): RGB weight 888
[360457.029] (==) modeset(G0): Default visual is TrueColor
[360457.029] (**) modeset(G0): glamor disabled
[360457.029] (II) modeset(G0): ShadowFB: preferred YES, enabled YES
[360457.029] (II) modeset(G0): Double-buffered shadow updates: off
[360457.029] (II) modeset(G0): Output eDP-1-1 has no monitor section
[360457.031] (II) modeset(G0): Output VGA-1-1 has no monitor section
[360457.065] (II) modeset(G0): Output DP-1-1 has no monitor section

But the x0tigervncserver crashes persist, also with tigervnc-1.10.80-20200605gitda1ce97.x86_64.tar.gz, not just the version shipped by Devuan.

The end of strace output looks like this, fwiw:

recvfrom(4<UNIX:[5388101->5395002]>, "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"..., 47064, 0, NULL, NULL) = 47064
poll([{fd=4<UNIX:[5388101->5395002]>, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=4, revents=POLLOUT}])
writev(4<UNIX:[5388101->5395002]>, [{iov_base="I\2\5\0\206\3\0\0\0\0\356\4@\1\1\0\377\377\377\377", iov_len=20}, {iov_base=NULL, iov_len=0}, {iov_base="", iov_len=0}], 3) = 20
poll([{fd=4<UNIX:[5388101->5395002]>, events=POLLIN}], 1, -1) = 1 ([{fd=4, revents=POLLIN}])
recvmsg(4<UNIX:[5388101->5395002]>, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="\1\30\304\2@\1\0\0!\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", iov_len=4096}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 32
recvfrom(4<UNIX:[5388101->5395002]>, 0x29fe570, 1280, 0, NULL, NULL) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=4<UNIX:[5388101->5395002]>, events=POLLIN}], 1, -1) = 1 ([{fd=4, revents=POLLIN}])
recvfrom(4<UNIX:[5388101->5395002]>, "\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\37\33\27\0\0\0\0\0\33\33\33\0\33\33\33\0\33\33\33\0\33\33\33\0\33\33\33\0\33\33\33\0\33\33\33\0\33\33\33\0\33\33\33\0"..., 1280, 0, NULL, NULL) = 1280
poll([{fd=4<UNIX:[5388101->5395002]>, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=4, revents=POLLOUT}])
writev(4<UNIX:[5388101->5395002]>, [{iov_base="I\2\5\0\206\3\0\0\302\10\356\4>\1\1\0\377\377\377\377", iov_len=20}, {iov_base=NULL, iov_len=0}, {iov_base="", iov_len=0}], 3) = 20
poll([{fd=4<UNIX:[5388101->5395002]>, events=POLLIN}], 1, -1) = 1 ([{fd=4, revents=POLLIN}])
recvmsg(4<UNIX:[5388101->5395002]>, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="\1\30\305\2>\1\0\0!\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0[\200\305\2\206\3\0\0\n\0\240\3\32~\201\25\0\0\31\0\0\n\227\0\0\0\0\0\200\21\240\5[\200\305\2\206\3\0\0\n\0\240\3\32~\201\25\0\0\260\0@\1?\4\0\0\0\0\200\21\240\5[\200\305\2\206\3\0\0\n\0\240\3\32~\201\25\302\10\260\0>\1?\4\0\0\0\0\200\21\240\5[\0\305\2\206\3\0\0\n\0\240\3\32~\201\25\0\0\357\4\0\n\223\0\0\0\0\0\200\21\240\5", iov_len=4096}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 160
recvfrom(4<UNIX:[5388101->5395002]>, 0x29fe5f0, 1144, 0, NULL, NULL) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=4<UNIX:[5388101->5395002]>, events=POLLIN}], 1, -1) = 1 ([{fd=4, revents=POLLIN}])
recvfrom(4<UNIX:[5388101->5395002]>, "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"..., 1144, 0, NULL, NULL) = 1144
poll([{fd=4<UNIX:[5388101->5395002]>, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=4, revents=POLLIN|POLLOUT}])
recvmsg(4<UNIX:[5388101->5395002]>, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\361\361\361\0\361\361\361\0\361\361\361\0\361\361\361\0\361\361\361\0\361\361\361\0\361\361\361\0\361\361\361\0\361\361\361\0\361\361\361\0\361\361\361\0\361\361\361\0\361\361\361\0\361\361\361\0\361\361\361\0", iov_len=4096}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 128
writev(4<UNIX:[5388101->5395002]>, [{iov_base="I\2\5\0\206\3\0\0\0\0\357\4\0\n\223\0\377\377\377\377", iov_len=20}, {iov_base=NULL, iov_len=0}, {iov_base="", iov_len=0}], 3) = 20
ioctl(4<UNIX:[5388101->5395002]>, FIONREAD, [32]) = 0
write(2<pipe:[5394998]>, "XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server \":0\"\r\n", 77) = 77
write(2<pipe:[5394998]>, "      after 710 requests (710 known processed) with 4 events remaining.\r\n", 73) = 73
shmdt(0x7ff2cd555000)                   = 0
shmctl(7307295, IPC_RMID, NULL)         = 0
shmdt(0x7ff2cd550000)                   = 0
shmctl(7307296, IPC_RMID, NULL)         = 0
shmdt(0x7ff2cf91d000)                   = 0
shmctl(7307297, IPC_RMID, NULL)         = 0
exit_group(1)                           = ?
+++ exited with 1 +++

@akorn
Copy link

akorn commented Jun 17, 2020

Googling around to see if it would maybe be possible to just ignore the EAGAIN, I came across https://stackoverflow.com/questions/25790890/xio-fatal-io-error-11-caused-by-32-bit-libxcb and tried the reproducer (which can also be found at https://bugs.freedesktop.org/show_bug.cgi?id=71338).

I wasn't able to make the reproducer crash, so this is apparently not the "32 bit counter widening bug" in libxcb.

For me, the x0tigervncserver crashes occur very frequently when a "hovering" window is displayed or disappears: windows such as tooltips in Opera, context menus, or window previous in the task switcher.

My workaround, for now, is using a shell loop to keep restarting x0tigervncserver, like this:

while :; do ssh otherbox fuser -k -n tcp 5900; ssh otherbox env DISPLAY=:0 x0tigervncserver PasswordFile=/home/myhome/.vnc/passwd -RawKeyboard -Log "'*:stderr:100'" -AlwaysShared -AcceptSetDesktopSize=0; done

as well as the client, like this:

while :; do chpst -0 nc otherbox 5900 || sleep 5; xtigervncviewer -passwd ~/.vnc/otherbox -RemoteResize=0 -FullScreen=1 -FullScreenAllMonitors=1 -FullscreenSystemKeys -Shared -AlertOnFatalError=0 -Log '*:stderr:2' otherbox; done

This is still very inconvenient due to the frequent crashes. I'm also hitting another problem with this where x0tigervncserver would apparently lock up (the window doesn't update and no new messages are logged) without exiting; I'll file a separate issue about that if/when I get some useful debug info related to it.

@DanFulger
Copy link

Followup on my two month old comment:

I am also seeing this crash in x0vncserver:
Only happens when I use Google Chrome, but then it happens all the time, not just related to video.

I have not tried with glamor disabled, but I when I start chrome --disable-gpu the crash no longer occurs, even during video playback. With GPU enabled the crash instantly reproduces, on both old and the most recent version of Chome. The GPU is the one inside the Intel processor.

It could also be related to latency; the client and server are both connected to fixed Internet service from the same provider and located on the same street.
I tried to reproduce with glamor and Chrome GPU enabled in another setup, with client and server in the same apartment but the client connecting via mobile phone tethering. The crash did not reproduce.

@ghost
Copy link

ghost commented Aug 9, 2020

Hi, I just ran into this problem too when I connected to one of my machines running x0vncserver and KDE under Debian. I solved the problem temporarily by switching the compositor output module from OpenGL to XRender. Maybe this workaround will help some of you until this bug is fixed.

@flancian
Copy link

flancian commented Jun 5, 2021

Ahoy! I believe I am hitting this bug as well, can reproduce using nightly: TigerVNC Server version 1.11.80, built Jun 1 2021 02:45:07.

OS is Ubuntu 20.04.2 LTS (Linux nostromo 5.8.0-50-generic #56~20.04.1-Ubuntu SMP Mon Apr 12 21:46:35 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux). X Server is 1.20.9.

Attaching output of strace x0tigervncserver -Log *:stderr:100 -RawKeyboard -passwordfile ~/.vnc/passwd:

strace.log

And bare x0tigervncserver log:

x0tigervncserver.log

I'm not using Chrome, but rather Firefox. This happens with clients remmina on desktop and vnc connect by RealVNC on mobile (Android).

Thank you for your attention! Please let me know how I can help troubleshoot this further.

@CendioOssman
Copy link
Member

Has anyone reported this to your respective distributions? Or to the Xorg folks? The crash is in a system library so this isn't necessarily a bug in TigerVNC. They may be in a better position to figure out what is going on.

@hdk1983
Copy link

hdk1983 commented Nov 3, 2021

I hit this issue too, using tigervnc-scraping-server package on Debian 11 with Nvidia proprietary driver. Window manager is Window Maker. A VNC client is x2vnc on Ubuntu 20.04. Moving a window can easily reproduce the issue.

I could not find the root cause of the issue but I found a workaround. A x0vncserver binary compiled without HAVE_XDAMAGE definition seems to work properly.

@grandrew
Copy link

grandrew commented Jan 10, 2023

enabling compositor fixed this issue for me

EDIT: I have a theory of what' happening: if you have a look at https://cgit.freedesktop.org/xorg/proto/damageproto/tree/damageproto.txt - it says that XDAMAGE is taking special care handling multiple pixel storage areas used by compositing extension. But in case when compositing window manager is disabled - something confuses this part of generating rects from designated areas (maybe the regions are improperly mutexed on accelerated hardware, likely on proprietary AMD GPUs) so some rects get generated improperly and accessing them causes abort in XLib's XIO

My hypothesis is that by analyzing the rects stream generated by XDAMAGE we can detect and skip the dangerous part of the stream - e.g. by looking at the rate or amount of rects generated

The reason for thoughts is that disabling compositor crucially accelerates everything on my setup (tethered AMDGPU + VNC streaming of desktop to monitors rendered in a VR headset) so I would prefer using whatever workaround is available to cut down any milliseconds of lag

@bernhardu
Copy link

I reported a few month ago at least the xcb_xlib_threads_sequence_lost part to libx11 in issue.
And added today some thoughts after some debugging,
specifically at X-server side a DamageExtNotify reply takes place between the 4 writes of a DoGetImage reply,
which seem at the X-client side in libxcb to get read in the wrong order.
This sounds also related to the previous XDAMAGE findings above.

@CendioOssman
Copy link
Member

Nice find!

Let's hope this is it, and that we get some attention from the libX11 developers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notourbug This issue needs to be resolved elsewhere
Projects
None yet
Development

No branches or pull requests