GNOME Bugzilla – Bug 658551
gnome-control-center crashed with SIGSEGV in count_languages_and_territories()
Last modified: 2012-03-01 18:05:56 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: ".
+ Trace 228380
Thread 1 (Thread 0xb7832840 (LWP 2225))
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().
We should probably make the code in count_languages_and_territories() robust against locale->language_code or locale->territory_code being NULL.
(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...
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().
+ Trace 228615
$4 = {id = 0xa0a820 "en", name = 0xa0aa60 "en.utf8", language_code = 0xa0a990 "en", territory_code = 0x0, codeset = 0xa0a9d0 "utf8", modifier = 0x0}
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".
What about just showing the language if there's no region?
(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.
(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(-)
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.
(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.
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.
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
(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.
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
*** Bug 661866 has been marked as a duplicate of this bug. ***