After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 167234 - [PATCH] Keyboard control-centre applet crashes when adding layouts
[PATCH] Keyboard control-centre applet crashes when adding layouts
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Keyboard
2.11.x
Other Linux
: High critical
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
: 308397 311405 312727 312876 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-02-13 05:04 UTC by Allison Karlitskaya (desrt)
Modified: 2006-04-09 18:25 UTC
See Also:
GNOME target: ---
GNOME version: 2.11/2.12


Attachments
control-center-2.10.0-kbdraw.patch (1.04 KB, patch)
2005-04-08 00:24 UTC, Ed Catmur
none Details | Review
control-center-2.11.90-kbdraw.patch (788 bytes, patch)
2005-08-10 17:40 UTC, Ed Catmur
none Details | Review

Description Allison Karlitskaya (desrt) 2005-02-13 05:04:51 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

Thread 1 (Thread 16384 (LWP 23985))

  • #0 waitpid
    from /lib/libpthread.so.0
  • #1 ??
    from /usr/lib/libgnomeui-2.so.0
  • #2 libgnomeui_segv_handle
    at gnome-ui-init.c line 741
  • #3 __pthread_sighandler
    from /lib/libpthread.so.0
  • #4 <signal handler called>
  • #5 XkbGetNames
    at XKBNames.c line 244
  • #6 keyboard_drawing_init
    at keyboard-drawing.c line 1556
  • #7 IA__g_type_create_instance
    at gtype.c line 1596
  • #8 g_object_constructor
    at gobject.c line 1045
  • #9 IA__g_object_newv
    at gobject.c line 942
  • #10 IA__g_object_new_valist
    at gobject.c line 985
  • #11 IA__g_object_new
    at gobject.c line 823
  • #12 keyboard_drawing_new
    at keyboard-drawing.c line 1618
  • #13 xkb_layout_preview_create_widget
    at gnome-keyboard-properties-xkbpv.c line 56
  • #14 xkb_layout_choose
    at gnome-keyboard-properties-xkblt.c line 566
  • #15 IA__g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #16 IA__g_closure_invoke
    at gclosure.c line 437
  • #17 signal_emit_unlocked_R
    at gsignal.c line 2485
  • #18 IA__g_signal_emit_valist
    at gsignal.c line 2244
  • #19 IA__g_signal_emit
    at gsignal.c line 2288
  • #20 IA__gtk_button_clicked
    at gtkbutton.c line 782
  • #21 gtk_real_button_released
    at gtkbutton.c line 1294
  • #22 IA__g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #23 g_type_class_meta_marshal
    at gclosure.c line 514
  • #24 IA__g_closure_invoke
    at gclosure.c line 437
  • #25 signal_emit_unlocked_R
    at gsignal.c line 2415
  • #26 IA__g_signal_emit_valist
    at gsignal.c line 2244
  • #27 IA__g_signal_emit
    at gsignal.c line 2288
  • #28 IA__gtk_button_released
    at gtkbutton.c line 774
  • #29 gtk_button_button_release
    at gtkbutton.c line 1210
  • #30 _gtk_marshal_BOOLEAN__BOXED
    at gtkmarshalers.c line 83
  • #31 g_type_class_meta_marshal
    at gclosure.c line 514
  • #32 IA__g_closure_invoke
    at gclosure.c line 437
  • #33 signal_emit_unlocked_R
    at gsignal.c line 2523
  • #34 IA__g_signal_emit_valist
    at gsignal.c line 2254
  • #35 IA__g_signal_emit
    at gsignal.c line 2288
  • #36 gtk_widget_event_internal
    at gtkwidget.c line 3626
  • #37 IA__gtk_propagate_event
    at gtkmain.c line 2145
  • #38 IA__gtk_main_do_event
    at gtkmain.c line 1383
  • #39 gdk_event_dispatch
    at gdkevents-x11.c line 2220
  • #40 g_main_dispatch
    at gmain.c line 1947
  • #41 IA__g_main_context_dispatch
    at gmain.c line 2497
  • #42 g_main_context_iterate
    at gmain.c line 2578
  • #43 IA__g_main_loop_run
    at gmain.c line 2782
  • #44 IA__gtk_main
    at gtkmain.c line 963
  • #45 main
    at gnome-keyboard-properties.c line 258
  • #0 waitpid
    from /lib/libpthread.so.0

Comment 1 Allison Karlitskaya (desrt) 2005-02-13 05:06:43 UTC
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.
Comment 2 Ed Catmur 2005-04-07 08:59:50 UTC
Got the same crash with control-center 10.0.0. 
X server is the freenx nxserver.
Comment 3 Ed Catmur 2005-04-08 00:24:56 UTC
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.
Comment 4 Allison Karlitskaya (desrt) 2005-07-21 04:31:48 UTC
*** Bug 308397 has been marked as a duplicate of this bug. ***
Comment 5 Sergey V. Udaltsov 2005-07-21 23:59:09 UTC
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
Comment 6 Sergey V. Udaltsov 2005-07-22 00:04:44 UTC
So, the $64K question is why XkbGetKeyboard fails so miserably... What is the
configuration which causes it to fail?
Comment 7 Allison Karlitskaya (desrt) 2005-07-22 00:06:30 UTC
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. :)
Comment 8 Sergey V. Udaltsov 2005-07-22 00:25:20 UTC
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
Comment 9 Allison Karlitskaya (desrt) 2005-08-06 00:12:11 UTC
*** Bug 312727 has been marked as a duplicate of this bug. ***
Comment 10 Sergey V. Udaltsov 2005-08-06 00:25:29 UTC
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?
Comment 11 Allison Karlitskaya (desrt) 2005-08-06 00:45:09 UTC
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?)
Comment 12 Sergey V. Udaltsov 2005-08-06 00:54:56 UTC
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..
Comment 13 Sebastien Bacher 2005-08-08 12:26:41 UTC
*** Bug 311405 has been marked as a duplicate of this bug. ***
Comment 14 Thierry Moisan 2005-08-09 22:51:00 UTC
Still happens with version 2.11 (breezy badger) so I'm changing it to 2.11 .
Comment 15 Christian Kirbach 2005-08-10 08:14:04 UTC
*** Bug 312876 has been marked as a duplicate of this bug. ***
Comment 16 Ed Catmur 2005-08-10 17:32:32 UTC
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.
Comment 17 Ed Catmur 2005-08-10 17:40:55 UTC
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).
Comment 18 Sergey V. Udaltsov 2005-08-10 18:20:09 UTC
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...
Comment 19 Sergey V. Udaltsov 2005-08-10 21:54:49 UTC
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?
Comment 20 Sebastien Bacher 2005-12-30 14:49:14 UTC
anybody still getting that issue with the current code?
Comment 21 Allison Karlitskaya (desrt) 2006-04-09 18:25:39 UTC
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.