Bug 7137

Summary: XkbGetKeyboard() is broken since server/lib xkb split
Product: xorg Reporter: Dan Winship <danw>
Component: Server/Input/CoreAssignee: Daniel Stone <daniel>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: high CC: kem, mat, reveman, simos.bugzilla
Version: 7.1 (2006.05)   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
xkm file that xkbcomp is unable to load for kbGetKbdByName response none

Description Dan Winship 2006-06-06 13:44:11 UTC
In xorg 7.1, if you run gnome-keyboard-properties (the "Keyboard" capplet from
gnome-control-center), click on the "Layouts" tab, and click "Add", you'll get
a window with a list of keyboard layouts, but no actual keyboard picture, and
it spews an error message about XkbGetKeyboard failing.

Reverting xkb/xkbfmisc.c, xkb/xkbout.c and xkb/xkbtext.c to their pre-March
27 state fixes the bug.

Turning on server xkb debugging shows:

The XKEYBOARD keymap compiler (xkbcomp) reports:
> Error:            Missing Types section in a Keymap file
> Error:            Missing KeyNames section in a Keymap file
>                   Description of Keymap not compiled
Errors from xkbcomp are not fatal to the X server
xkb executes: "/usr/X11R6/bin/xkbcomp" -w 10 "-R/etc/X11/xkb" -xkm "-" -em1 "The
XKEYBOARD keymap compiler (xkbcomp) reports:" -emp "> " -eml "Errors from
xkbcomp are not fatal to the X server" "/etc/X11/xkb/compiled/server-0.xkm"
xkbcomp input:
xkb_keymap "default" {
    xkb_compatibility        { include "%" };
    xkb_symbols              { include "%" };
    xkb_geometry             { include "%" };
};
end xkbcomp input
(EE) Error loading keymap /etc/X11/xkb/compiled/server-0.xkm


(Disclaimer: I actually tested this against Xgl, not straight Xorg, but Xgl
makes no changes to the xkb implementation.)
Comment 1 Daniel Stone 2006-06-06 21:10:39 UTC
if you only revert the change to XkbWriteXKBKeymapForNames in xkbfmisc.c, does
it improve?  obviously, it works fine for me on Xorg; what you're seeing is a
failure to build the keymap at all.
Comment 2 Dan Winship 2006-06-07 09:49:46 UTC
> if you only revert the change to XkbWriteXKBKeymapForNames in xkbfmisc.c, does
> it improve?

No, reverting just rev 1.9 doesn't help, I have to revert both 1.9 and 1.8.

> obviously, it works fine for me on Xorg;

really? Hm... David, are there any xkb-related changes from Xorg to Xgl?
Comment 3 Sylvain BERTRAND 2006-06-07 11:35:57 UTC
I have the same issue, with plain(err... gentoo) X.org 7.1 with gnome 2.14.x.
server-0.xkm is corrupted then fails to be reloaded when generating the response
to xkGetKbdByName request.
Comment 4 Sylvain BERTRAND 2006-06-07 11:43:39 UTC
Created attachment 5836 [details]
xkm file that xkbcomp is unable to load for kbGetKbdByName response
Comment 5 David Reveman 2006-06-07 16:57:27 UTC
(In reply to comment #2)
> really? Hm... David, are there any xkb-related changes from Xorg to Xgl?
> 

Initialization code in ddx is probably a bit different but other than that it
should be the same xkb code.
Comment 6 Daniel Stone 2006-06-30 03:47:43 UTC
(In reply to comment #2)
> > if you only revert the change to XkbWriteXKBKeymapForNames in xkbfmisc.c, does
> > it improve?
> 
> No, reverting just rev 1.9 doesn't help, I have to revert both 1.9 and 1.8.

okay, so it's just XkbWriteXKBKeymapForNames?  this could be fun.  i'll have to
get an Xgl setup going, but this won't happen until after the weekend, probably
(travel hilarity).
Comment 7 Matthias Clasen 2006-07-07 07:06:24 UTC
FWIW, I'm seeing the same issue

** (gnome-keyboard-properties:3166): CRITICAL **: XkbGetKeyboard failed to get
keyboard from the server!

on the rawhide X server, no Xgl involved.
Comment 8 Simos Xenitellis 2006-07-07 08:16:27 UTC
(In reply to comment #7)
> FWIW, I'm seeing the same issue
> 
> ** (gnome-keyboard-properties:3166): CRITICAL **: XkbGetKeyboard failed to get
> keyboard from the server!
> 
> on the rawhide X server, no Xgl involved.

AFAIK, noone maintains the xkbdata package which is the default in Xorg.

You would need to upgrade to xkeyboard-config, 
http://www.freedesktop.org/wiki/Software_2fXKeyboardConfig
Comment 9 Dan Winship 2006-07-10 05:59:17 UTC
We're using xkeyboard-config 0.7 in SUSE. It doesn't look like there were any
changes in 0.8 that would affect this...
Comment 10 Ben Mesman 2006-07-11 03:47:32 UTC
I am seeing a similar issue here. I have a trimmend down compile of Xorg 7.1,
which reports this at startup:
    xkb_keycodes             { include "xfree86+aliases(qwerty)" };
    xkb_types                { include "complete" };
    xkb_compatibility        { include "complete" };
    xkb_symbols              { include "pc/pc(pc104)+pc/us" };
    xkb_geometry             { include "pc(pc104)" };

But when I use numlockx to turn on NumLock, I get:
    xkb_types                { include "%" };
    xkb_compatibility        { include "%" };
    xkb_symbols              { include "%" };
    xkb_geometry             { include "%" };
(EE) Error loading keymap /usr/share/X11/xkb/compiled/server-0.xkm

numlockx uses XkbLockModifiers() to turn NumLock on or off.

I am not completely sure this is the same bug, but am reluctant to file a new
bug that might be marked as a duplicate of this bug.
Comment 11 Kevin E. Martin 2006-07-28 11:24:03 UTC
We are seeing the same issue in FC6, and I've tracked down the problem to the
0e88cefbfecbff0c7dd606ce0caca840f45cbc0d and
7c44bb8c49656133eae675377edea55322d254ca commits.

I've got a fix for this locally, but my patch needs a bit of cleanup.  I'll
check it in once I finish my testing.  FYI, what I did was to revert those two
commits but keep the parts that removed the unused !XKB_IN_SERVER and
HAVE_CONFIG_H code paths.
Comment 12 Kevin E. Martin 2006-07-28 15:10:05 UTC
Should be fixed in git now.  If you still see problems with the latest code,
please reopen the bug.

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.