Package: x11-session-utils Version: 7.3+1 Severity: important Tags: patch
xsm segfaults occasionally when SmsGenerateClientID library function returns NULL (I catched in twice on debugger). The default UUID generator for this function has been replaced with libuuid in newer versions, which suggests that the problem is known and there is actually a defect in implementation (I bet on Linux gethostname() behavior). The patch attached makes xsm retry if SmsGenerateClientID fails, so segfault is replaced with potential infinite loop (that depends on actual SmsGenerateClientID behavior, very unlikely IMO). -- System Information: Debian Release: 5.0.5 APT prefers stable APT policy: (500, 'stable') Architecture: amd64 (x86_64) Kernel: Linux 2.6.26-2-amd64 (SMP w/2 CPU cores) Locale: LANG=pl_PL.ISO-8859-2, LC_CTYPE=pl_PL.ISO-8859-2 (charmap=ISO-8859-2) (ignored: LC_ALL set to pl_PL.ISO-8859-2) Shell: /bin/sh linked to /bin/bash Versions of packages x11-session-utils depends on: ii cpp 4:4.3.2-2 The GNU C preprocessor (cpp) ii libc6 2.7-18lenny4 GNU C Library: Shared libraries ii libice6 2:1.0.4-1 X11 Inter-Client Exchange library ii libsm6 2:1.0.3-2 X11 Session Management library ii libx11-6 2:1.1.5-2 X11 client-side library ii libxaw7 2:1.0.4-2 X11 Athena Widget library ii libxmu6 2:1.0.4-1 X11 miscellaneous utility library ii libxt6 1:1.0.5-3 X11 toolkit intrinsics library ii x11-common 1:7.3+20 X Window System (X.Org) infrastruc x11-session-utils recommends no packages. x11-session-utils suggests no packages. -- no debconf information
diff -ru x11-session-utils-7.3+1/xsm/xsm.c x11-session-utils-7.3+1.new/xsm/xsm.c --- x11-session-utils-7.3+1/xsm/xsm.c 2007-09-14 23:33:53.000000000 +0200 +++ x11-session-utils-7.3+1.new/xsm/xsm.c 2010-08-21 11:52:55.000000000 +0200 @@ -530,8 +530,11 @@ if (!sm_id) { - sm_id = SmsGenerateClientID (NULL); - if (!sm_id) return (0); + do + { + sm_id = SmsGenerateClientID (NULL); + } + while (! sm_id); } XChangeProperty (XtDisplay (topLevel), XtWindow (topLevel), XInternAtom (XtDisplay (topLevel), "SM_CLIENT_ID", False), @@ -693,7 +696,12 @@ if (!previousId) { - id = SmsGenerateClientID (smsConn); + do + { + id = SmsGenerateClientID (NULL); + } + while (! id); + send_save = 1; } else