Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 560088 - x11-misc/slim with =sys-auth/consolekit-1.0.0 fails to launch desktop environment
Summary: x11-misc/slim with =sys-auth/consolekit-1.0.0 fails to launch desktop environ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Ian Stakenvicius
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-10 06:42 UTC by Sam Jorna (wraeth)
Modified: 2015-11-03 08:41 UTC (History)
10 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Jorna (wraeth) gentoo-dev 2015-09-10 06:42:44 UTC
After consolekit-1.0.0 was installed, SLiM was unable to launch desktop environment (known so far: enlightenment and xfce). Non-root user was able to startx successfully, but once DE loaded, polkit-gnome-authentication-agent-1 also failed to start.

Downgrading to =sys-auth/consolekit-0.4.6 allowed SLiM to correctly launch DE and PolKit agent to start successfully.

Apologies for such a vague report: unable to locate any log files showing specific errors. This was found by myself on two machines and reported by at least one user on IRC (with downgrade to consolekit resolving it).

Reproducible: Always

Steps to Reproduce:
1. Upgrade to =sys-auth/consolekit-1.0.0
2. Set SLiM as DISPLAYMANAGER
3. Attempt to log in through SLiM
Actual Results:  
SLiM is unable to launch desktop environment.

Expected Results:  
Successful login.
Comment 1 tka 2015-09-10 07:34:41 UTC
I just upgraded consolekit and got the same hang with slim and xfce on my ~amd64 system. It hangs whether I set the useflag cgroups or not.

I upgraded my old ~x86 system yesterday, and there are no problems (neither with cgroups nor without).


This is the ~amd64 system:

# emerge --info consolekit slim
Portage 2.2.20.1 (python 3.4.3-final-0, hardened/linux/amd64/no-multilib, gcc-4.9.3, glibc-2.21-r1, 4.2.0 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.2.0-x86_64-Intel-R-_Core-TM-_i7-3720QM_CPU_@_2.60GHz-with-gentoo-2.2
KiB Mem:    16400252 total,  14396396 free
KiB Swap:   17825788 total,  17825788 free
Timestamp of repository gentoo: Thu, 10 Sep 2015 07:00:01 +0000
sh bash 4.3_p42
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p42::gentoo
dev-java/java-config:     2.2.0::gentoo
dev-lang/perl:            5.22.0::gentoo
dev-lang/python:          2.7.10::gentoo, 3.4.3::gentoo
dev-util/cmake:           3.3.1-r1::gentoo
dev-util/pkgconfig:       0.28-r3::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.17::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r1::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.7.4::gentoo, 4.8.5::gentoo, 4.9.3::gentoo
sys-devel/gcc-config:     1.8::gentoo
sys-devel/libtool:        2.4.6-r1::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.2::gentoo (virtual/os-headers)
sys-libs/glibc:           2.21-r1::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

local
    location: /var/lib/portage-local/local
    masters: gentoo
    priority: 0

testing
    location: /var/lib/portage-local/testing
    masters: gentoo
    priority: 1

science
    location: /var/lib/layman/science
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -mtune=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -mtune=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=y"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs cgroup collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync network-sandbox news parallel-fetch preserve-libs protect-owned sandbox sfperms strict test unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
MAKEOPTS="-j8"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 acl acpi alsa amd64 avx berkdb bzip2 cairo caps cdda cddb cdparanoia cli cracklib crypt cups cxx dbus dri dts dvd fam ffmpeg fftw flac fontconfig foomaticdb gdbm gif gimp gmp gnutls gtk hardened iconv icu idn ipv6 jpeg justify lame lcms libnotify lzma mad matroska mmap mmx mmxext modules mp3 mpeg ncurses networkmanager nptl ogg opengl openmp pam pcre pie png policykit ppds readline sasl sdl seccomp session sse sse2 sse3 sse4 sse4_1 sse4_2 ssl ssp ssse3 startup-notification svg tcpd theora threads tiff truetype udev udisks unicode upower vaapi vorbis wayland x264 xattr xcb xml xtpax xv xvid zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="i965 intel nouveau" XFCE_PLUGINS="battery brightness logout menu power trash" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

sys-auth/consolekit-1.0.0::gentoo was built with the following:
USE="acl pam policykit test -cgroups -debug -doc (-selinux)"


x11-misc/slim-1.3.6-r4::gentoo was built with the following:
USE="consolekit pam -branding"
Comment 2 Sam Jorna (wraeth) gentoo-dev 2015-09-11 01:43:00 UTC
Installing x11-misc/slim[pam,-consolekit] (while also having consolekit-1.0.0 installed and running) allows the login to proceed normally instead of hanging, indicating that the issue is with SLiM's call to consolekit.
Comment 3 Sam Jorna (wraeth) gentoo-dev 2015-09-11 01:46:02 UTC
(In reply to wraeth from comment #2)
> Installing x11-misc/slim[pam,-consolekit] (while also having
> consolekit-1.0.0 installed and running) allows the login to proceed normally
> instead of hanging, indicating that the issue is with SLiM's call to
> consolekit.

Sorry, meant to include that using this (slim[pam,-consolekit] with consolekit-1.0.0 installed) does allow the session to still be registered with consolekit via the pam_ck_connector in pam.d.
Comment 4 Jason Zaman gentoo-dev 2015-09-12 03:27:11 UTC
Thanks for debugging so far, I have masked it for now so more people don't run into the problem. 

commit 346d28b698bc27aaed9511c51ab44766fb07a464
Author: Jason Zaman <perfinion@gentoo.org>
Date:   Sat Sep 12 11:18:18 2015 +0800

    profiles: Temporarily mask x11-misc/slim[consolekit]
    
    Login fails with consolekit-1.0.0. the session is initialized with
    the pam module anyway. Mask until properly debugged.
    
    Gentoo-Bug: https://bugs.gentoo.org/560088
Comment 5 Jason Zaman gentoo-dev 2015-09-12 13:50:14 UTC
The hang is somewhere in this block of code from app.cpp in slim.

This is after all the pam and consolekit stuff has happened tho. From a quick look at the code I don't see why this is even affected by consolekit at all.

I put print statements in and cfg->getOption("login_cmd"); runs fine but the sessionstart_cmd one hangs. I added in some code to dump the entire options map into slim.log and it works fine so I am not sure why getting sessionstart_cmd fails. Re-ordering them still fails at the same place (ie moving the getOption(sessionstart_cmd) to right after login_cmd and it will fail there instead).

630 		/* Login process starts here */
631 		SwitchUser Su(pw, cfg, DisplayName, child_env);
632 		string session = LoginPanel->getSession();
633 		string loginCommand = cfg->getOption("login_cmd");
634 		replaceVariables(loginCommand, SESSION_VAR, session);
635 		replaceVariables(loginCommand, THEME_VAR, themeName);
636 		string sessStart = cfg->getOption("sessionstart_cmd");

Never reaches here.

637 		if (sessStart != "") {
638 			replaceVariables(sessStart, USER_VAR, pw->pw_name);
639 			system(sessStart.c_str());
640 		}
641 		Su.Login(loginCommand.c_str(), mcookie.c_str());
642 		_exit(OK_EXIT);
Comment 6 Ian Stakenvicius gentoo-dev 2015-09-12 23:09:07 UTC
I haven't switched to consolekit-1 , as soon a I have the chance to I'll look into this and patch accordingly.

Has this affected other lighter DM's (lightdm, Xdm, etc) that have direct consolekit support built in?
Comment 7 Jason Zaman gentoo-dev 2015-09-13 05:16:40 UTC
(In reply to Ian Stakenvicius from comment #6)
> Has this affected other lighter DM's (lightdm, Xdm, etc) that have direct
> consolekit support built in?

It does not affect lightdm, I have not tried any others. And from a quick look over the code the things that both slim and lightdm do relating to consolekit looks fairly similar so I dont know why slim fails.
Comment 8 George Tarasov 2015-09-14 05:24:41 UTC
Dear,

Please, consider more soft approach to mask slim[consolekit] package.
Hard masking in profile of all versions of slim regardless of consolekit installed version results in wrong behaviour in slim + xfce configuration (may be other configurations are influenced too).

For example, greyed buttons appeared in system actions menu (Power Off, Restart, etc...), and normal user can't do these actions. This is caused by absence of consolekit session during login (because slim was built with no consolekit support).

Before this masking all these buttons were active and configuration of the libactions plugin is confirmed with documentation and don't require any configuration in consolekit as it was in early versions.

For stable x11-misc/slim-1.3.6-r3 and sys-auth/consolekit-0.4.6 I was forced to comment hard masking of slim[consolekit] in package.use.mask, rebuild slim, and all things stay fine (as it was before my @world update last night ;)

Thanks
Comment 9 Barnoid 2015-09-14 06:02:32 UTC
Agreed, hard masking seems to go too far.

Slim, xfce & consolekit are working fine on all of our systems (~15). Hard masking consolekit for slim removes the capability to suspend/shutdown the machine from xfce's menu.
Comment 10 sphakka 2015-09-14 08:29:18 UTC
Please, remove hard masking and give out a proper news item. I spent two hours tracking down this issue with greyed out buttons in SLiM/XFCE power management :-/
Comment 11 Fab 2015-09-14 08:53:41 UTC
+1

Please remove the consolekit mask.

> I have masked it for now so more people don't run into the problem.
If someone goes into this problem, then he should mask consolekit-1.0, or don't use the ~arch tree.
Comment 12 Ian Stakenvicius gentoo-dev 2015-09-14 15:45:36 UTC
(In reply to Fab from comment #11)
> +1
> 
> Please remove the consolekit mask.

I've dropped the mask for stable; ~arch users will need to mask consolekit-1.0 and add a "x11-misc/slim -consolekit" entry to /etc/portage/profiles/package.use.mask if they want to continue using consolekit with slim until I get this bug fixed.
Comment 13 Ian Stakenvicius gentoo-dev 2015-09-14 21:17:34 UTC
OK, seems that the problem has been caused by some bad pointer arithmetic, which should likely have been segfaulting slim for years.  I've committed slim-1.3.6-r5 to the tree and removed the masks.

Will close this bug after confirmation everything is working as expected.
Comment 14 Sam Jorna (wraeth) gentoo-dev 2015-09-14 23:17:39 UTC
This is working for me - rebuilt slim-1.3.6-r5 with USE="consolekit" and consolekit-1.0.0 and I am able to log in normally.
Comment 15 Søren Dalby Larsen 2015-09-15 06:08:42 UTC
This works for me as well. Thank you.
Comment 16 Ian Stakenvicius gentoo-dev 2015-09-15 15:47:39 UTC
Thanks all!