Xpra: Ticket #1389: unhandled X11 client message causes server exit

do_xpra_client_message_event(<X11:ClientMessage \
    {'delivered_to': '0x60000d', 'send_event': 1, 'format': 32, 'data': (2, 0, 0, 0, 0), \
    'window': '0x60000d', 'type': 33, 'serial': '0x3fc', 'message_type': '_NET_ACTIVE_WINDOW', 'display': ':99'}
    >) not handled

and the server exits

Sat, 24 Dec 2016 06:27:00 GMT - Antoine Martin: owner, description, summary changed

The unhandled message should not cause a server exit. What exact version are you running? What DE? What OS? etc..

Sat, 24 Dec 2016 06:28:22 GMT - L29Ah:

‰ xpra --version
xpra v2.0

It's supposed to be trunk. Fetching it now. No DE. xmonad WM. Gentoo Linux.

Sat, 24 Dec 2016 06:29:43 GMT - L29Ah:

It's the last message i see in

‰ cat /home/skype/.xpra/:99.log
X.Org X Server 1.18.3
Release Date: 2016-04-04
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.4.2-grsec+ x86_64 Gentoo
Current Operating System: Linux l29ah-x201 4.8.7-grsec+ #65 SMP PREEMPT Thu Nov 17 06:58:08 MSK 2016 x86_64
Kernel command line: BOOT_IMAGE=Gentoo_AA_S ro root=801 ec_intr=0 acpi_sleep=s4_nohwsig elevator=noop pcie_aspm=force i915.i915_enable_fbc=1 i915.lvds_downclock=1 security=apparmor resume=/dev/sda2 processor.ignore_ppc=1
Build Date: 24 April 2016  01:52:51PM
Current version of pixman: 0.34.0
	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(++) Log file: "/home/skype/.xpra/Xorg.:99.log", Time: Sat Dec 24 09:19:55 2016
(++) Using config file: "/etc/xpra/xorg.conf"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
2016-12-24 09:19:55,367 created unix domain socket: /home/skype/.xpra/l29ah-x201-99
2016-12-24 09:19:55,458 Warning: all the compressors are disabled,
2016-12-24 09:19:55,458  unless you have a gigabit connection or better, performance will suffer
2016-12-24 09:19:56,099 Error importing ffmpeg encoder (enc_ffmpeg)
2016-12-24 09:19:56,099  No module named libav_common.av_log
2016-12-24 09:19:59,004 Warning: webcam forwarding is disabled
2016-12-24 09:19:59,005  the virtual video directory '/sys/devices/virtual/video4linux' was not found
2016-12-24 09:19:59,005  make sure that the 'v4l2loopback' kernel module is installed and loaded
2016-12-24 09:19:59,005 found 0 virtual video devices for webcam forwarding
2016-12-24 09:19:59,013 D-Bus notification forwarding is available
2016-12-24 09:19:59,068 started command '/opt/bin/skype' with pid 24167
2016-12-24 09:19:59,069 xpra X11 version 2.0 64-bit
2016-12-24 09:19:59,069  uid=1004 (skype), gid=1004 (skype)
2016-12-24 09:19:59,069  running with pid 23775 on Linux Gentoo 2.3 n/a
2016-12-24 09:19:59,070  connected to X11 display :99
2016-12-24 09:19:59,132 xpra is ready.
2016-12-24 09:19:59,159 5.6GB of system memory
2016-12-24 09:19:59,356 do_xpra_client_message_event(<X11:ClientMessage {'delivered_to': '0x60000d', 'send_event': 1, 'format': 32, 'data': (2, 0, 0, 0, 0), 'window': '0x60000d', 'type': 33, 'serial': '0x3fc', 'message_type': '_NET_ACTIVE_WINDOW', 'display': ':99'}>) not handled

Sat, 24 Dec 2016 06:32:23 GMT - L29Ah:

Oh, it didn't exit, but it doesn't accept new connections right after the socket is spawned. How do i wait for the server to become ready properly?

Sat, 24 Dec 2016 06:35:19 GMT - Antoine Martin:

Right, so it's probably not caused by that _NET_ACTIVE_WINDOW client message at all.

You may want to run the latest trunk since a server crash has been fixed recently (yesterday?), and run the server with "-d all" to find exactly where it crashes.

As for knowing when the server is truly ready and you can connect to it. You can add a start command that touches a file (ie: --start="touch ready", or you can run "xpra version :DISPLAY" until it exits without error, etc..

Sat, 24 Dec 2016 06:42:04 GMT - L29Ah:

--start thing is sad as it doesn't seem to allow shell stuff like ';'.

Sat, 24 Dec 2016 10:56:10 GMT - Antoine Martin:

If you want shell syntax then use a shell: --start="bash -c 'sleep 10;touch hello;xterm'" --start="xterm -bg black -fg white"

Note: there are no guarantees that the socket is ready when we execute the start commands, but it always is. (listening on the socket comes after but this takes no time at all to enable)

Alternatively, as of r14593 you can now use a dbus signal, see browser/xpra/trunk/src/tests/xpra/server/test_dbus_signal_receiver.py for the trivial example code. Note: you must start xpra with dbus-launch=no, otherwise xpra will use its own dbus server and you won't be able to start the signal receiver in that context.

This all really belongs in a different ticket, can we close this one? Can you still reproduce the crashes with the latest trunk?

Sat, 24 Dec 2016 16:39:51 GMT - L29Ah: status changed; resolution set

It doesn't crash after all, so yeah.

Sat, 23 Jan 2021 05:22:54 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1389