Xpra-org / xpra

Persistent remote applications for X11; screen sharing for X11, MacOS and MSWindows.
https://xpra.org/
GNU General Public License v2.0
1.92k stars 165 forks source link

dbus at-spi splatter #4317

Closed totaam closed 1 month ago

totaam commented 1 month ago

We already try our best to silence this stuff: https://github.com/Xpra-org/xpra/blob/c6a040f7b6bee296e9576c7b2e8b20dbe153ee8e/xpra/platform/posix/features.py#L14-L16 But unfortunately, it seems to be happening somewhere else now:

** (Xpra:636376): WARNING **: 11:50:42.677: AT-SPI: Could not obtain desktop path or name

** (Xpra:636376): WARNING **: 11:50:42.679: atk-bridge: GetRegisteredEvents returned message with unknown signature

** (Xpra:636376): WARNING **: 11:50:42.679: atk-bridge: get_device_events_reply: unknown signature

This happens with:

xpra start --minimal --dbus=yes --dbus-launch="dbus-launch --sh-syntax --close-stderr"

But not with:

xpra start --minimal --dbus=yes --dbus-launch="no"

So something dbus-launch does triggers it. It seems to create a bunch of /usr/bin/dbus-broker-launch --config-file=/usr/share/defaults/at-spi2/accessibility.conf --scope user processes we never asked for. And looking at this config file is not pleasant - basically anyone is allowed to do anything!?:

<policy context="default">
    <!-- Allow root to connect -->
    <allow user="root"/>
    <!-- Allow everything to be sent -->
    <allow send_destination="*" eavesdrop="true"/>
    <!-- Allow everything to be received -->
    <allow eavesdrop="true"/>
    <!-- Allow anyone to own anything -->
    <allow own="*"/>
  </policy>

Is this what does it?

$ cat /lib/systemd/user/at-spi-dbus-bus.service
[Unit]
Description=Accessibility services bus
PartOf=graphical-session.target

[Service]
Type=dbus
BusName=org.a11y.Bus
ExecStart=/usr/libexec/at-spi-bus-launcher
Slice=session.slice
TimeoutStopSec=5

Who knows.

RedHat bug AT-SPI: Could not obtain desktop path or name Gnome bug atk-bridge: get_device_events_reply: unknown signature

totaam commented 1 month ago

Does not occur with xpra 5.x! So this is a regression. git bisect landed on the wrong commits, twice! Perhaps I was not cleaning the source tree well enough before rebuilding. So I did by hand..

e3b595a231a01d41ec139bbb79fe6eb994c26e53 bad 72b4f11d0e2ad1ed4bfb0ade3c129f215d20d3a0 good ef665e2c2cab018778eec746d2330c0a9dbb56b9 good 4831c639c6ff2a11944100a9560562150e203931 good c7b12a61d8aa9b9fa9900c9fce13183d21e293fd bad a5ac22abb49cf738eefd7e2b6f65516cca84640a good

So c7b12a61d8aa9b9fa9900c9fce13183d21e293fd is to blame!? How!?

totaam commented 1 month ago

What a very strange bug! It took a lot of effort to narrow it down, moving files around in both directions, and rebuilding fully every time to prevent cythonized files from squeezing in the way, I found that this one line introduces the bug:

toggle_packages(gtk_x11_ENABLED, "xpra.x11.gtk")

Importing Gtk and Gdk from the module init file causes the bug!? What on earth does this have to do with dbus and ATK!?