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 678100 - g-s-d keyboard plugin segfaults for LANG=C (or unset language)
g-s-d keyboard plugin segfaults for LANG=C (or unset language)
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: keyboard
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2012-06-14 13:53 UTC by Colin Walters
Modified: 2012-06-14 14:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
backtrace (1.96 KB, text/plain)
2012-06-14 13:53 UTC, Colin Walters
Details

Description Colin Walters 2012-06-14 13:53:49 UTC
Created attachment 216412 [details]
backtrace

This is a relatively recent regression; I haven't looked at bisecting, but I think it happened in the last few weeks.
Comment 1 Colin Walters 2012-06-14 13:58:46 UTC
This is due to no LANG environment variable.  We should avoid crashing in this scenario (assume "C"?)
Comment 2 Colin Walters 2012-06-14 14:10:27 UTC
So the language_code_from_locale() will return NULL even for LANG=C, and we should clearly handle that.  But I don't ye understand the mapping between locales and XKB layouts, so I'm not sure what the Right Thing here is.
Comment 3 Bastien Nocera 2012-06-14 14:13:18 UTC


Thread 1 (LWP 730)

  • #0 g_str_hash
    at ../../glib/ghash.c line 1730
  • #1 g_hash_table_lookup_node
    at ../../glib/ghash.c line 401
  • #2 g_hash_table_lookup_extended
    at ../../glib/ghash.c line 1110
  • #3 gnome_xkb_info_get_layout_info_for_language
    at ../../libgnome-desktop/gnome-xkb-info.c line 644
  • #4 replace_layout_and_variant
    at ../../../plugins/keyboard/gsd-keyboard-manager.c line 324
  • #5 apply_xkb_layout
    at ../../../plugins/keyboard/gsd-keyboard-manager.c line 373
  • #6 apply_input_sources_settings
    at ../../../plugins/keyboard/gsd-keyboard-manager.c line 440
  • #7 start_keyboard_idle_cb
    at ../../../plugins/keyboard/gsd-keyboard-manager.c line 575
  • #8 g_idle_dispatch
    at ../../glib/gmain.c line 4657
  • #9 g_main_dispatch
    at ../../glib/gmain.c line 2539
  • #10 g_main_context_dispatch
    at ../../glib/gmain.c line 3075
  • #11 g_main_context_iterate
    at ../../glib/gmain.c line 3146
  • #12 g_main_context_iterate
    at ../../glib/gmain.c line 3083
  • #13 g_main_loop_run
    at ../../glib/gmain.c line 3340
  • #14 gtk_main
    at ../../gtk/gtkmain.c line 1162
  • #15 main
    at ../../gnome-settings-daemon/main.c line 452

Comment 4 Bastien Nocera 2012-06-14 14:22:05 UTC
commit 76e527cfb81544773e21eeb746e0a01325692c14
Author: Bastien Nocera <hadess@hadess.net>
Date:   Thu Jun 14 15:19:01 2012 +0100

    keyboard: Don't crash if LANG is empty
    
    Use en_US as the fallback locale if LANG isn't set.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=678100