[Pkg-utopia-maintainers] Bug#562026: [PATCH] Re: Bug#562026: kdm cannot open ConsoleKit session on first login attempt

George Kiagiadakis kiagiadakis.george at gmail.com
Wed Dec 30 15:52:03 UTC 2009


reassign 562026 consolekit 0.4.1-2
tags 562026 + patch
thanks

After some hours of debugging, I finally found the cause of this bug. It is a 
race condition, so no wonder why it is only reproducable on some systems.

What happens is:
1) kdm (or whatever else, I can even reproduce the bug with dbus-send) tries 
to call a method from the /org/freedesktop/ConsoleKit/Manager object, using 
the org.freedesktop.ConsoleKit.Manager interface.
2) ConsoleKit is not running, so dbus-daemon activates it.
3) console-kit-daemon starts and registers the service.
4) dbus-daemon recognizes the service registration, tries to find the Manager 
object, fails, returns error.
5) console-kit-daemon registers the Manager object at the same time that dbus-
daemon returns the error.

Second call to the same method obviously succeeds.
Now if you are lucky the kernel scheduler gives some more time to console-kit-
daemon before it switches back to executing dbus-daemon code, it will succeed. 
I guess there was a change in the scheduler of linux 2.6.32 that made this bug 
more easy to spot.

So, I have modified console-kit-daemon a bit, so that it registers Manager 
before it registers the service name and it works fine. Patch attached.

Regards,
George


PS: This patch of course requires 04-defer_daemonizing.patch from the 
consolekit packaging to be applied as well.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 05-create_manager_before_service_registration.patch
Type: text/x-patch
Size: 1208 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-utopia-maintainers/attachments/20091230/b46f2035/attachment-0001.bin>


More information about the Pkg-utopia-maintainers mailing list