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 658551 - gnome-control-center crashed with SIGSEGV in count_languages_and_territories()
gnome-control-center crashed with SIGSEGV in count_languages_and_territories()
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Region & Language
3.1.x
Other Linux
: Normal critical
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
: 661866 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-09-08 12:55 UTC by Pedro Villavicencio
Modified: 2012-03-01 18:05 UTC
See Also:
GNOME target: ---
GNOME version: 3.1/3.2


Attachments
Proposed patch (2.15 KB, patch)
2011-09-28 07:21 UTC, Jürg Billeter
none Details | Review

Description Pedro Villavicencio 2011-09-08 12:55:39 UTC
this report has been filed here:

https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/841280

"this is repeatable if going to System Settings ... -> User Accounts"

g-c-c version is 3.1.91

line 1668 : "if (is_unique_language (language_code)) {"

backtrace:

".

Thread 1 (Thread 0xb7832840 (LWP 2225))

  • #0 g_str_hash
    at /build/buildd/glib2.0-2.29.18/./glib/gstring.c line 142
  • #1 g_hash_table_lookup_node
    at /build/buildd/glib2.0-2.29.18/./glib/ghash.c line 360
  • #2 g_hash_table_lookup
    at /build/buildd/glib2.0-2.29.18/./glib/ghash.c line 1022
  • #3 count_languages_and_territories
    at gdm-languages.c line 638
  • #4 collect_locales
    at gdm-languages.c line 663
  • #5 get_language_count
    at gdm-languages.c line 670
  • #6 is_unique_language
    at gdm-languages.c line 679
  • #7 gdm_get_language_from_name
    at gdm-languages.c line 1168
  • #8 cc_common_language_get_initial_languages
    at cc-common-language.c line 555
  • #9 cc_add_user_languages
    at cc-language-chooser.c line 103
  • #10 show_user
    at um-user-panel.c line 591
  • #11 selected_user_changed
    at um-user-panel.c line 625
  • #12 g_cclosure_marshal_VOID__VOID
    at /build/buildd/glib2.0-2.29.18/./gobject/gmarshal.c line 85
  • #13 g_closure_invoke
    at /build/buildd/glib2.0-2.29.18/./gobject/gclosure.c line 774
  • #14 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.29.18/./gobject/gsignal.c line 3272
  • #15 g_signal_emit_valist
    at /build/buildd/glib2.0-2.29.18/./gobject/gsignal.c line 3003
  • #16 g_signal_emit
    at /build/buildd/glib2.0-2.29.18/./gobject/gsignal.c line 3060
  • #17 _gtk_tree_selection_internal_select_node
    at /build/buildd/gtk+3.0-3.1.12/./gtk/gtktreeselection.c line 1620
  • #18 gtk_tree_selection_select_path
    at /build/buildd/gtk+3.0-3.1.12/./gtk/gtktreeselection.c line 921
  • #19 gtk_tree_selection_select_iter
    at /build/buildd/gtk+3.0-3.1.12/./gtk/gtktreeselection.c line 999
  • #20 user_added
    at um-user-panel.c line 172
  • #21 users_loaded
    at um-user-panel.c line 864
  • #22 g_cclosure_marshal_VOID__VOID
    at /build/buildd/glib2.0-2.29.18/./gobject/gmarshal.c line 85
  • #23 g_closure_invoke
    at /build/buildd/glib2.0-2.29.18/./gobject/gclosure.c line 774
  • #24 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.29.18/./gobject/gsignal.c line 3272
  • #25 g_signal_emit_valist
    at /build/buildd/glib2.0-2.29.18/./gobject/gsignal.c line 3003
  • #26 g_signal_emit
    at /build/buildd/glib2.0-2.29.18/./gobject/gsignal.c line 3060
  • #27 got_users
    at um-user-manager.c line 289
  • #28 d_pending_call_notify
    at dbus-gproxy.c line 1823
  • #29 _dbus_pending_call_complete
    at ../../dbus/dbus-pending-call.c line 199
  • #30 complete_pending_call_and_unlock
    at ../../dbus/dbus-connection.c line 2303
  • #31 dbus_connection_dispatch
    at ../../dbus/dbus-connection.c line 4552
  • #32 message_queue_dispatch
    at dbus-gmain.c line 90
  • #33 g_main_dispatch
    at /build/buildd/glib2.0-2.29.18/./glib/gmain.c line 2442
  • #34 g_main_context_dispatch
    at /build/buildd/glib2.0-2.29.18/./glib/gmain.c line 3011
  • #35 g_main_context_iterate
    at /build/buildd/glib2.0-2.29.18/./glib/gmain.c line 3089
  • #36 g_main_loop_run
    at /build/buildd/glib2.0-2.29.18/./glib/gmain.c line 3297
  • #37 gtk_main
    at /build/buildd/gtk+3.0-3.1.12/./gtk/gtkmain.c line 1367
  • #38 gtk_application_run_mainloop
    at /build/buildd/gtk+3.0-3.1.12/./gtk/gtkapplication.c line 112
  • #39 g_application_run
    at /build/buildd/glib2.0-2.29.18/./gio/gapplication.c line 1325
  • #40 main
    at control-center.c line 196

Comment 1 Bastien Nocera 2011-09-08 13:30:25 UTC
We're missing some debug. I'm guessing that it's a bizarre locale that's causing the problem (we haven't seen that problem on any other system).

We'd need to know the value of all the members of the GdmLocale variable in count_languages_and_territories().
Comment 2 Matthias Clasen 2011-09-09 11:11:33 UTC
We should probably make the code in count_languages_and_territories() robust against locale->language_code or locale->territory_code being NULL.
Comment 3 Bastien Nocera 2011-09-09 11:13:30 UTC
(In reply to comment #2)
> We should probably make the code in count_languages_and_territories() robust
> against locale->language_code or locale->territory_code being NULL.

Yes, but that's after understanding why ->territory_code is NULL...
Comment 4 Jürg Billeter 2011-09-28 06:13:20 UTC
I see this happening if the system has a territory-independent locale such as en.UTF-8. While this may be uncommon, it is perfectly valid according to the format described by POSIX¹

    language[_territory][.codeset]

¹ http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html

(In reply to comment #1)
> We're missing some debug. I'm guessing that it's a bizarre locale that's
> causing the problem (we haven't seen that problem on any other system).
> 
> We'd need to know the value of all the members of the GdmLocale variable in
> count_languages_and_territories().

  • #3 count_languages_and_territories
    at gdm-languages.c line 638
$4 = {id = 0xa0a820 "en", name = 0xa0aa60 "en.utf8", language_code = 0xa0a990 "en", territory_code = 0x0, codeset = 0xa0a9d0 "utf8", modifier = 0x0}
Comment 5 Jürg Billeter 2011-09-28 07:21:03 UTC
Created attachment 197635 [details] [review]
Proposed patch

The attached patch fixes the issue for me. I'm not sure whether "Neutral ($LANGUAGE)" is a good choice as region name. An alternative would be to use "International $LANGUAGE".
Comment 6 Rodrigo Moya 2011-10-03 11:56:44 UTC
What about just showing the language if there's no region?
Comment 7 Bastien Nocera 2011-10-03 13:44:04 UTC
(In reply to comment #6)
> What about just showing the language if there's no region?

Because we already use those for common languages (eg, French is shown as "French", not "French (France)").

I don't think that "International $LANGUAGE" is something that translators can work with. "Neutral" also doesn't sound great.

Anyway, the problem is in copy/paste code from GDM, so best solved there.
Comment 8 Jürg Billeter 2011-10-03 13:49:16 UTC
(In reply to comment #7)
> Anyway, the problem is in copy/paste code from GDM, so best solved there.

Is this really still the case? As far as I can tell, the code was removed from GDM.

commit 23aa2ee0fdb884eaaf23f93fb8f51a01f118995a
Author: Ray Strode <rstrode@redhat.com>
Date:   Wed Jun 15 10:13:31 2011 -0400

    greeter: drop dead code (language related files)

 gui/simple-greeter/Makefile.am                   |   55 -
 gui/simple-greeter/gdm-language-chooser-dialog.c |  258 -----
 gui/simple-greeter/gdm-language-chooser-dialog.h |   59 --
 gui/simple-greeter/gdm-language-chooser-widget.c |  281 ------
 gui/simple-greeter/gdm-language-chooser-widget.h |   58 --
 gui/simple-greeter/gdm-language-option-widget.c  |  311 ------
 gui/simple-greeter/gdm-language-option-widget.h  |   62 --
 gui/simple-greeter/gdm-languages.c               | 1159 ----------------------
 gui/simple-greeter/gdm-languages.h               |   41 -
 gui/simple-greeter/locarchive.h                  |   97 --
 gui/simple-greeter/test-language-chooser.c       |   61 --
 11 files changed, 0 insertions(+), 2442 deletions(-)
Comment 9 Matthias Clasen 2011-10-03 13:55:20 UTC
I don't think Juerg's theory makes too much sense, tbh.

While there are translations installed under e.g. /usr/share/locale/en, there is no such thing as a en.utf-8 locale. Viz:

LANG=en.UTF-8 gnome-control-center

(process:16954): Gtk-WARNING **: Locale not supported by C library.
	Using the fallback 'C' locale.

What you _can_ do is set LANGUAGE=en, but that is just a usability enhancement to make picking a locale easier. You will end up with en_US.utf-8 as your locale, in that case.
Comment 10 Bastien Nocera 2011-10-03 14:33:29 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > Anyway, the problem is in copy/paste code from GDM, so best solved there.
> 
> Is this really still the case? As far as I can tell, the code was removed from
> GDM.

It is indeed.
Comment 11 Jürg Billeter 2011-10-03 14:37:21 UTC
I never claimed that glibc is shipping territory-independent locales. However, it's simple to create such locales and they are valid according to POSIX naming conventions. It's easy to fix the crash as my patch shows, and I think we should apply something along those lines even if such locales are not in wide-spread use.
Comment 12 Ray Strode [halfline] 2011-10-05 14:27:23 UTC
right, the list of libc supported locales can be seen by doing 

locale -a -v

"swedish" is an example of a valid locale without a territory, but "en" isn't
Comment 13 Ray Strode [halfline] 2011-10-05 14:29:57 UTC
(i posted comment 12 before reading comment 10 and comment 11 because my browser tab was 2 days old)


I don't think we want to support locales that aren't supported by libc.  That's going to cause all sorts of warnings and problems for the user.  imo, that's just a misconfiguration of the system.
Comment 14 Bastien Nocera 2012-03-01 18:05:06 UTC
Please reopen if this is still a problem.

commit 7e4d39c93e50755c77c1dfd1b3fe00372d2de8f5
Author: Bastien Nocera <hadess@hadess.net>
Date:   Thu Mar 1 17:54:13 2012 +0000

    common: Fix crashes for incomplete locales
    
    By ignoring locales without language codes, or territory.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=658551
Comment 15 Bastien Nocera 2012-03-01 18:05:56 UTC
*** Bug 661866 has been marked as a duplicate of this bug. ***