Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#584491: gnome-session opens ICE socket named using PID; doesn't cope with socket existing

253 views
Skip to first unread message

Josh Triplett

unread,
Jun 3, 2010, 6:10:02 PM6/3/10
to
Package: gnome-session
Version: 2.30.0-1
Severity: important

gnome-session opens its ICE listening socket in /tmp/.ICE-unix/ and
names the socket using its PID. If the path it wants to create already
exists (for instance, from a previous run of gnome-session), it fails,
with a message saying "Could not create ICE listening socket: Cannot
establish any listening sockets", and then many parts of the session
subtly (or less than subtly) break.

A few things compound this problem:

- PID collisions become rather more likely due to the relatively
consistent number of processes run as part of the boot process.

- I turn off cleaning of /tmp on boot. (Started doing so a long time
ago after one too many times losing useful files I happened to stash
in /tmp.)

- A guess: gdm3 actually runs gnome-session, and does so as a different
user than the gnome-session run later as part of a user session, so
even if gnome-session handles removing an existing socket, it won't
have permission to do so.


gnome-session should name its sockets in a way far less predictable and
less likely to collide, and it should probably retry if it has a
collision, at least a few times.

gnome-session should also clean up its socket when it exits (whether
normally or via SIGTERM).

Also, as far as I can tell nothing relies on the ICE socket living in
/tmp/.ICE-unix, so perhaps it could move to /var/run, which *should*
always get cleaned on boot (or just mounted as a tmpfs).

- Josh Triplett

-- System Information:
Debian Release: squeeze/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.34-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages gnome-session depends on:
ii gnome-panel 2.30.0-2 launcher and docking facility for
ii gnome-session-bin 2.30.0-1 The GNOME Session Manager - Minima
ii gnome-session-common 2.30.0-1 Common files for the GNOME session
ii gnome-settings-daemon 2.30.1-1 daemon handling the GNOME session
ii metacity 1:2.30.1-1 lightweight GTK+ window manager
ii nautilus 2.30.1-1 file manager and graphical shell f
ii policykit-1-gnome 0.96-2 GNOME authentication agent for Pol

Versions of packages gnome-session recommends:
ii gnome-power-manager 2.30.1-1 power management tool for the GNOM

Versions of packages gnome-session suggests:
ii desktop-base 5.0.5 common files for the Debian Deskto
ii gnome-keyring 2.30.1-2 GNOME keyring services (daemon and
ii gnome-user-guide 2.30.1-1 GNOME user's guide

-- no debconf information

--
To UNSUBSCRIBE, email to debian-bugs-...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Josselin Mouette

unread,
Jun 26, 2010, 5:00:02 AM6/26/10
to
reassign 584491 xtrans-dev
affects 584491 gnome-session
thanks

Le jeudi 03 juin 2010 à 15:02 -0700, Josh Triplett a écrit :
> Package: gnome-session
> Version: 2.30.0-1
> Severity: important
>
> gnome-session opens its ICE listening socket in /tmp/.ICE-unix/ and
> names the socket using its PID. If the path it wants to create already
> exists (for instance, from a previous run of gnome-session), it fails,
> with a message saying "Could not create ICE listening socket: Cannot
> establish any listening sockets", and then many parts of the session
> subtly (or less than subtly) break.

This is created by libICE. The relevant code is in Xtranssock.c:

if (!(port && *port)) {
snprintf (tmpport, sizeof(tmpport), "%s%ld", UNIX_PATH, (long)getpid());
port = tmpport;
}
with UNIX_PATH being /tmp/.ICE-unix/ (hardcoded).

Looks like Xtrans is missing a few bits of code to obtain unique
pathnames.

Cheers,
--
.''`. Josselin Mouette
: :' :
`. `' “If you behave this way because you are blackmailed by someone,
`- […] I will see what I can do for you.” -- Jörg Schilling

signature.asc
0 new messages