DeviceIntRec changes cause segfaults
Peter Hutterer
mailinglists at who-t.net
Thu Nov 16 00:50:36 PST 2006
Hey guys,
I just found out the following:
Adding a field to the struct _DeviceIntRec in xserver/include/
inputstr.h will cause the sever to segfault upon initialisation of
the keyboard.
<snippet>
typedef struct _DeviceIntRec {
DeviceRec public;
DeviceIntPtr next;
TimeStamp grabTime;
Bool startup; /* true if needs to be turned on at
server intialization time */
DeviceProc deviceProc; /* proc(DevicePtr, DEVICE_xx). It is
used to initialize, turn on, or
turn off the device */
Bool inited; /* TRUE if INIT returns Success */
Bool enabled; /* TRUE if ON returns
Success */
Bool coreEvents; /* TRUE if device also sends
core */
#ifdef MPX
Bool isMPDev; /* TRUE if multipointer
device */
#endif
GrabPtr grab; /* the grabber - used by DIX */
</snippet>
etc.
MPX is defined. Putting the very same line in comments will not
segfault the server and everything works well. isMPDev is never
accessed anywhere.
The exact location of the segfault is InitKBD at kbd.c:437
switch(*map)
map is invalid but also KeyClassRec* keyc looks very strange.
Moving the isMPDev field within the struct will also change when the
segfault happens.
This should not happen. I recompiled both xserver and driver/xf86-
input-keyboard multiple times from scratch using the autogen scripts.
The same problem does not happen with the mouse driver.
Am I missing something here?
Cheers,
Peter
--
Multi-Pointer X Server
http://wearables.unisa.edu.au/mpx
More information about the xorg
mailing list