GNOME Bugzilla – Bug 721089
Only dbus policy prevents gdm from deadlocking
Last modified: 2014-01-06 19:03:34 UTC
The bus protocol spoken between the gdm display object the gdm slave works like this: after start-up the slave will synchronously call back into the display with the SetSlaveBusName() call. The display will then create a proxy object for some object on the slave and immediately invoke the org.freedesktop.DBus.Properties.GetAll() call on it by doing that (gdbus think's that the right thing to do) -- also synchronously! The slave hence waits for the display to respond which makes the display wait on the slave to wait, which however won't reply since it's still synchronously waiting for the display to respond. Deadlock! Or so one would think. Turns out that on most machines the dbus policy avoids this deadlock, since the GetAll() will actually be denied by the bus and return quickly with an error code, and gdbus ignores these errors. Yikes! We have now made the Fedora userspace work on kdbus, which means that the old dbus-daemon is not around anymore, but instead a dbus compatbility proxy that forwards old traffic into kdbus. THis is pretty much complete, however lacks one thing still: the enforcement of the legacy XML policy. Instead all traffic is allowed curerntly. This works fine for the entire system of curse (even though being quite insecure), with the exception of one thing: if gdm runs without policy, then the GetAll() will make gdm hang. Of course, this is also a bug on dbus1, if people decide to losen the XML policy a bit. Anyway, this design is really broken in gdm I am pretty sure. One shalt not be synchronous client and server to the same other services. gdm breaks that rule. gdm bad! Bah, guys, I just lost two days of my life on debugging this. :-(
*** This bug has been marked as a duplicate of bug 701758 ***
sorry !