Bug 9023 - [PATCH] Input device detection Crash on 7.2 RC{1,2}
Summary: [PATCH] Input device detection Crash on 7.2 RC{1,2}
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: 7.2 (2007.02)
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Xorg Project Team
QA Contact:
URL: http://gerte.nietbelangrijk.nl/xorg-s...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-14 05:05 UTC by Gerte Hoogewerf
Modified: 2006-11-14 06:33 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Gerte Hoogewerf 2006-11-14 05:05:15 UTC
Newer xorg-servers have some kind of automatic input device detection
on server startup. I discovered a configuration that makes the server
crash during initialisation. I'm talking about crashes on
xorg-server-1.1.99.901 and xorg-server-1.1.99.902.

This ServerLayout works:
Section "ServerLayout"
       Identifier      "normal"
       Screen          "Screen0"
       Inputdevice     "Mouse0" "Corepointer"
       Inputdevice     "Keyboard0"
EndSection

This ServerLayout also works (autodetection):
Section "ServerLayout"
       Identifier      "normal"
       Screen          "Screen0"
EndSection

This one crashes (say: semi-automatic):
Section "ServerLayout"
       Identifier      "normal"
       Screen          "Screen0"
       Inputdevice     "Mouse0" "Corepointer"
EndSection

The crash only happens when using anything but "mouse" or "void" (for example:
"evdev") in the Inputdevice section of Mouse0.

I looked into this problem further and found this:
xorg-server-1.1.1 is OK
xorg-server-1.1.99.901 is CRASHING
xorg-server-1.1.99.902 is CRASHING

The code causing the crash is this (hw/xfree86/common/xf86Config.c):
1616     for (i = servlayoutp->inputs; i->driver; i++) {
1617         if (!strcmp(i->driver, "void") || !strcmp(i->driver, "mouse")) {
1618             found = 1; break;
1619         }
1620     }

If this code wants to iterate over the inputs, then i->diver must be set to NULL
at the end of the array or the code crashes. Use i->identifier instead OR the
patch I put on my webspace:
http://gerte.nietbelangrijk.nl/xorg-server-segpatch.txt

Thank you,
Gerte
Comment 1 Matthias Hopf 2006-11-14 06:33:22 UTC
Using i->identifier seems to be more reasonable, as I've seen (without much
looking) three additional places that would have to be patched to NULL ->driver
as well.

Other than that, trivially correct. Commiting. Adding as a potential 7.2 commit
candidate as well.


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.