Bug 13961

Summary: xkbLEDs causes segfault on login
Product: xorg Reporter: Justin Dugger <jldugger>
Component: Server/GeneralAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: critical    
Priority: medium CC: peter.hutterer
Version: gitKeywords: have-backtrace
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
configuration for my Toshiba Tecra M7 tablet none

Description Justin Dugger 2008-01-07 23:25:28 UTC
Logging into GNOME from GDM with my user causes X.org to segfault. This doesn't happen with a new user, just the old one. I've narrowed it down to a null pointer deref in xkbLEDs.c:67, but I'm not sure how to best fix it.

I've also reported with Ubuntu hardy, and a stack trace is available: https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/180884

Please let me know if any more information is needed to solve this.
Comment 1 Peter Hutterer 2008-01-15 16:46:21 UTC
can you please post your configuration file? the input devices are of interest here.

the other thing that'd be interesting is if you can reproduce the crash in gdb, print out dev->name. this way we know which device causes the problem.
Comment 2 Justin Dugger 2008-01-18 22:04:55 UTC
Created attachment 13786 [details]
configuration for my Toshiba Tecra M7 tablet

The wacom devices are present and working, and are the only nonstandard device I can think of.
Comment 3 Justin Dugger 2008-01-18 23:36:03 UTC
After a bit of wrestling, I got xorg to debug again. The device is "eraser". Naturally, eraser has no LEDs, as it's part of a passive pen device!
Comment 4 Peter Hutterer 2008-01-20 23:25:26 UTC
(In reply to comment #3)
> After a bit of wrestling, I got xorg to debug again. The device is "eraser".
> Naturally, eraser has no LEDs, as it's part of a passive pen device!
> 

please try the simple patch below. i think the correct fix would be in the caller but i don't know enough about XKB for that.


diff --git a/xkb/xkbLEDs.c b/xkb/xkbLEDs.c
index 2877af0..55ce12a 100644
--- a/xkb/xkbLEDs.c
+++ b/xkb/xkbLEDs.c
@@ -63,6 +63,9 @@ XkbSrvLedInfoPtr	sli;
 
     sli= XkbFindSrvLedInfo(dev,XkbDfltXIClass,XkbDfltXIId,0);
 
+    if (!sli)
+        return update;
+
     if (state_changes&(XkbModifierStateMask|XkbGroupStateMask))
 	update|= sli->usesEffective;
     if (state_changes&(XkbModifierBaseMask|XkbGroupBaseMask))

Comment 5 Peter Hutterer 2008-01-28 15:48:13 UTC
ping?
Comment 6 Justin Dugger 2008-01-28 21:45:53 UTC
After doing a bit more research, I've discovered reports in Debian's BugTracker that the latest wacom-tools doesn't trigger this. I'm now contemplating how to best go with this. It seems like there are cases where NULL can be received, so your patch is at least a step in the right direction for xkb. I'll see about perhaps building with the patch for Ubuntu (my testing system), but it'll probably take some time. If wacom-tools genuinely fixes the bug, then it's probably a good idea to lower the priority of this bug.
Comment 7 Peter Hutterer 2008-01-29 16:22:58 UTC
actually tracking down this problem is more of a nightmare than fixing the symptom. 

pushed as d954f9c80348de294602d931d387e5cd1ef4b9a5
Comment 8 Justin Dugger 2008-01-30 11:51:26 UTC
Any chance that this patch can also be pushed into the 1.4-branch?

Comment 9 Peter Hutterer 2008-01-30 18:32:17 UTC
(In reply to comment #8)
> Any chance that this patch can also be pushed into the 1.4-branch?
> 

done. daniels pushed it as bc72ef3a159efd67067322c043bba444869dc356

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.