GNOME Bugzilla – Bug 167234
[PATCH] Keyboard control-centre applet crashes when adding layouts
Last modified: 2006-04-09 18:25:39 UTC
Distribution: Gentoo Base System version 1.4.16 Package: control-center Severity: normal Version: GNOME2.9.91 unspecified Gnome-Distributor: BreakMyGentoo.net Synopsis: Keyboard control-centre applet crashes when adding layouts Bugzilla-Product: control-center Bugzilla-Component: keyboard Bugzilla-Version: unspecified BugBuddy-GnomeVersion: 2.0 (2.9.1) Description: Go into the keyboard preferences and click "Add" under the Layouts tab. Debugging Information: Backtrace was generated from '/usr/bin/gnome-keyboard-properties' Using host libthread_db library "/lib/libthread_db.so.1". [Thread debugging using libthread_db enabled] [New Thread 16384 (LWP 23985)] 0x40d3c658 in waitpid () from /lib/libpthread.so.0
+ Trace 55646
Thread 1 (Thread 16384 (LWP 23985))
Probably worth noting that I get this on the console: ** (gnome-keyboard-properties:24046): CRITICAL **: XkbGetKeyboard failed to get keyboard from the server! and that I'm using Xorg 6.8.2.
Got the same crash with control-center 10.0.0. X server is the freenx nxserver.
Created attachment 39822 [details] [review] control-center-2.10.0-kbdraw.patch The problem is that libkbdraw does not behave responsibly when it fails to get the requisite data to draw the keyboard layout. This patch should help make it more usable - it will complain loudly to stderr and will fail to draw a keyboard layout for the current geometry but the user will be able to add new layouts OK.
*** Bug 308397 has been marked as a duplicate of this bug. ***
I will have a look at this patch. For a second, it looks ok. But why on Earth the geometry information is not there?... Are you sure we really fix the problem, not mask it? Could you please set XKL_DEBUG=500, run g-k-p till it crashes and attach the log here? Thanks
So, the $64K question is why XkbGetKeyboard fails so miserably... What is the configuration which causes it to fail?
For the record, I originally got this problem when my root filesystem was mounted read-only. As a result the various inner-workings of X were not able to store the temporary/compiled/whatever keymap file. I fixed it by symlinking the xkb temp directory to a location on a tmpfs. Hope that helps with reproducing it. :)
Ryan: Oh, yeah! This is a matter of problem! /usr/X11R6/lib/X11/xkb/compiled should be writeable! Otherwise your X installation is simply broken! It is a well-known problem of XFree/Xorg
*** Bug 312727 has been marked as a duplicate of this bug. ***
I am not sure it is good to accept this patch - it looks like a hack. The REAL problem is that xorg installation is broken - the 'compiled' directory should be writeable. Or is it crashing even with writeable 'compiled' subdirectory?
Software should never ever crash -- even if something else is broken. It should detect the error condition and handle it more gracefully (perhaps a helpful message?)
I agree, it should not crash. Instead, it should give the proper error message (or, at the very least, show nothing in the preview widget). What I don't like about this patch - it is trying to workaround the problem. Hide it under the carpet. That's what makes me disagree. I don't really like when high level components hide serious problems arising several levels below..
*** Bug 311405 has been marked as a duplicate of this bug. ***
Still happens with version 2.11 (breezy badger) so I'm changing it to 2.11 .
*** Bug 312876 has been marked as a duplicate of this bug. ***
re comment 12: Well, currently we have: if (drawing->xkb == NULL) g_critical ("XkbGetKeyboard failed to get keyboard from the server!"); XkbGetNames (drawing->display, XkbAllNamesMask, drawing->xkb); svu: you think that libkbdraw should not attempt to recover from this error: OK, but then we need to bail out, not pass a NULL pointer to XkbGetNames.
Created attachment 50532 [details] [review] control-center-2.11.90-kbdraw.patch Bail out straight away. Could possibly add an error dialog but I'm not too sure what it should say (and don't want to hit string freeze).
Ed: your patch makes sense, indeed. I will most probably apply it. Actually, I tried to make the directory 'compiled' read-only - and still cannot reproduce the problem (FC4, xorg 6.8.2). Would be grateful for any hints on how to crash...
I cleaned kbdraw a bit - hopefully it is going to be better now (in CVS). It should now crash - just show some empty place in the dialog. But it does NOT explain why your keyboard could not be obtained. Still, the actual matter of problem needs to be investigated, I think. Could anyone confirm about craches please - are they still there?
anybody still getting that issue with the current code?
I just changed the compiled directory to read-only and tried to trigger the bug as I originally reported it. It no longer crashes. Going to close this.