Lastest xserver segfault with inputInfo.keyboard->key being NULL

Peter Hutterer peter.hutterer at
Wed Jul 15 16:08:24 PDT 2009

On Wed, Jul 15, 2009 at 05:45:45PM +0200, Jerome Glisse wrote:
> I installed lastest everythings using jhbuild and i got segfault
> in xserver  QueryMinMaxKeyCodes called from CreateConnectionBlock
> Segfault because inputInfo.keyboard->key is NULL, this variable
> is initialized to NULL by InitCoreDevices and never seems to
> be modified latter on (according to gdb watch).
> All this with usb keyboard & mouse. Any idea on what is causing
> this ? I have no xorg.conf, so it's likely using evdev driver.
inputInfo.keyboard is the hardcoded core pointer, and the key field is added
through InitCoreDevices -> ActivateDevice -> CoreKeyboardProc ->

There's no conditionals in that path, no configuration checks, nothing.
The only possible error can be a missing xkeyboard-config setup problem in
which case the server should FatalError out with an appropriate message.

Please check again with gdb that at the end of InitCoreDevices
inputInfo.keyboard->key is not NULL.

There's one additional condition where it may be set NULL later, in
DeepCopyKeyboardClasses. This would require you to have a quite interesting
device (in which case I'd like to get the evtest output for it).
If this is the case, try adding Option "AutoAddDevices" "off" to your
ServerFlags and restart. The keyboard driver doesn't do the fancy tricks so
it cannot trigger this condition.


PS: I tried reproducing it here, on 32 and 64 bit, with master and with
xorg-x11-server-Xorg-1.6.901-2. No success.

More information about the xorg mailing list