gnome-language-selector crashed with dbus.exceptions.DBusException in call_blocking(): org.freedesktop.Accounts.Error.Failed: 'C.UTF-8' is not a valid locale name

Bug #1873678 reported by Robert Sack on 2020-04-19
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
accountsservice (Ubuntu)
Medium
Gunnar Hjalmarsson
Focal
Medium
Gunnar Hjalmarsson

Bug Description

[Impact]

accountsservice includes a function for checking the validity of locales, and it incorrectly considers "C.UTF-8" to be invalid. It leads to incorrect behavior under certain conditions and also a crash if the function was triggered from language-selector-gnome.

Even if this only makes a difference in special corner cases, it happens often enough to justify this SRU:

https://errors.ubuntu.com/?release=Ubuntu%2020.04&package=language-selector&period=year

(It's the top ranked crash type in the list.)

The version in focal-proposed fixes the issue.

[Test case]

Make a fresh install of Ubuntu 20.04 (a VM works fine)

Once logged in:

* Install accountsservice, gir1.2-accountsservice-1.0 and
  libaccountsservice0 from focal-proposed

* Open /etc/default/locale for editing, replace its contents with
  the single line:

  LANG=C.UTF-8

  and reboot.

Open Language Support and change language (drag any language above
the "English" item)

Open ~/.pam_environment and find that e.g. LANG is now the locale representing the language you selected, while e.g. LC_TIME is set to "C.UTF-8".

[Regression risk]

This is a oneliner which white list "C.UTF-8" as a valid locale name. I can't think of a case where this would cause unexpected behavior.

[Original description]

USB live disk (20.04 beta)

ProblemType: Crash
DistroRelease: Ubuntu 20.04
Package: language-selector-gnome 0.203
ProcVersionSignature: Ubuntu 5.4.0-21.25-generic 5.4.27
Uname: Linux 5.4.0-21-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.11-0ubuntu22
Architecture: amd64
CasperVersion: 1.442
CurrentDesktop: MATE
Date: Sun Apr 19 17:07:26 2020
ExecutablePath: /usr/bin/gnome-language-selector
InterpreterPath: /usr/bin/python3.8
LiveMediaBuild: Ubuntu-MATE 20.04 LTS "Focal Fossa" - Beta amd64 (20200402)
PackageArchitecture: all
ProcCmdline: /usr/bin/python3 /usr/bin/gnome-language-selector
ProcEnviron:
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=C.UTF-8
 SHELL=/bin/bash
Python3Details: /usr/bin/python3.8, Python 3.8.2, python3-minimal, 3.8.2-0ubuntu1
PythonArgs: ['/usr/bin/gnome-language-selector']
PythonDetails: N/A
SourcePackage: language-selector
Title: gnome-language-selector crashed with dbus.exceptions.DBusException in call_blocking(): org.freedesktop.Accounts.Error.Failed: 'C.UTF-8' is not a valid locale name
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin lxd plugdev sambashare sudo

Robert Sack (stadtschamane) wrote :
tags: removed: need-duplicate-check
Changed in language-selector (Ubuntu):
importance: Undecided → Medium
Gunnar Hjalmarsson (gunnarhj) wrote :

Thanks for your report!

I could reproduce the problem and have uploaded a fix.

information type: Private → Public
affects: language-selector (Ubuntu) → accountsservice (Ubuntu)
Changed in accountsservice (Ubuntu):
assignee: nobody → Gunnar Hjalmarsson (gunnarhj)
status: New → Fix Committed
description: updated
Changed in accountsservice (Ubuntu Focal):
assignee: nobody → Gunnar Hjalmarsson (gunnarhj)
importance: Undecided → Medium
status: New → In Progress
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package accountsservice - 0.6.55-0ubuntu13

---------------
accountsservice (0.6.55-0ubuntu13) groovy; urgency=medium

  * debian/patches/0010-set-language.patch:
    - Don't dismiss C.UTF-8 as an invalid locale name (LP: #1873678)

 -- Gunnar Hjalmarsson <email address hidden> Fri, 09 Oct 2020 15:08:15 +0200

Changed in accountsservice (Ubuntu):
status: Fix Committed → Fix Released

Hello Robert, or anyone else affected,

Accepted accountsservice into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/accountsservice/0.6.55-0ubuntu12~20.04.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in accountsservice (Ubuntu Focal):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-focal
Gunnar Hjalmarsson (gunnarhj) wrote :

I verified the test case using version 0.6.55-0ubuntu12~20.04.2 of accountsservice, gir1.2-accountsservice-1.0 and libaccountsservice0 from focal-proposed.

tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers