ValveSoftware / SteamOS

SteamOS community tracker
1.61k stars 70 forks source link

Locales error causing text irregularities - glibc related #1129

Open sweetbbak opened 1 year ago

sweetbbak commented 1 year ago

Your system information

Please describe your issue in as much detail as possible:

Describe what you expected should happen and what did happen.

Errors with Locales system wide. After the recent update I kept getting Locales errors like:

/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) steam deck

when running apps via the terminal, running terminal applications and just basic overall use. I also noticed that my Zsh prompt that uses nerd fonts symbols was all messed up. I kept getting locale errors from multiple applications. Rofi for example would not run and spit out "Could not set Locale."

from pacman log in /var/log/pacman.log

[2023-09-03T18:40:09-0800] [ALPM-SCRIPTLET] /bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)

and:

[2023-09-03T20:32:50-0800] [PACMAN] Running 'pacman -S glibc'
[2023-09-03T20:32:52-0800] [ALPM] transaction started
[2023-09-03T20:32:52-0800] [ALPM] warning: directory permissions differ on /var/db/
filesystem: 711  package: 755
[2023-09-03T20:32:52-0800] [ALPM] reinstalled glibc (2.36-6)
[2023-09-03T20:32:52-0800] [ALPM-SCRIPTLET] /usr/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf-8)
[2023-09-03T20:32:52-0800] [ALPM-SCRIPTLET] /bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.utf-8)
[2023-09-03T20:32:52-0800] [ALPM-SCRIPTLET] Generating locales...
[2023-09-03T20:32:54-0800] [ALPM-SCRIPTLET]   en_US.UTF-8... done
[2023-09-03T20:32:54-0800] [ALPM-SCRIPTLET] Generation complete.

I had to disable read only file system and reinstall Glibc to fix the issue. Everything in KDE system settings pointed to the correct locale (en_US.UTF-8)

Steps for reproducing this issue:

  1. Update to newest beta release
  2. test for locale errors related to glibc
  3. profit (just kidding, I really have no idea how to reproduce this error)
bertogg commented 1 year ago

What happens if you open a terminal and run these commands?

$ locale
$ locale -a

If you see errors, can you attach the complete output of this?

$ strace -e file locale
sweetbbak commented 1 year ago
LANG=en_US.utf-8
LC_CTYPE="en_US.utf-8"
LC_NUMERIC="en_US.utf-8"
LC_TIME="en_US.utf-8"
LC_COLLATE="en_US.utf-8"
LC_MONETARY="en_US.utf-8"
LC_MESSAGES="en_US.utf-8"
LC_PAPER="en_US.utf-8"
LC_NAME="en_US.utf-8"
LC_ADDRESS="en_US.utf-8"
LC_TELEPHONE="en_US.utf-8"
LC_MEASUREMENT="en_US.utf-8"
LC_IDENTIFICATION="en_US.utf-8"
LC_ALL=en_US.utf-8

locale -a

C
C.UTF-8
en_US.utf8
POSIX

strace -e file locale

execve("/usr/bin/locale", ["locale"], 0x7ffc1be94ee0 /* 38 vars */) = 0
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=121491, ...}, AT_EMPTY_PATH) = 0
openat(AT_FDCWD, "/usr/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0755, st_size=1953472, ...}, AT_EMPTY_PATH) = 0
openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=3048928, ...}, AT_EMPTY_PATH) = 0
newfstatat(1, "", {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0x1), ...}, AT_EMPTY_PATH) = 0
LANG=en_US.utf-8
LC_CTYPE="en_US.utf-8"
LC_NUMERIC="en_US.utf-8"
LC_TIME="en_US.utf-8"
LC_COLLATE="en_US.utf-8"
LC_MONETARY="en_US.utf-8"
LC_MESSAGES="en_US.utf-8"
LC_PAPER="en_US.utf-8"
LC_NAME="en_US.utf-8"
LC_ADDRESS="en_US.utf-8"
LC_TELEPHONE="en_US.utf-8"
LC_MEASUREMENT="en_US.utf-8"
LC_IDENTIFICATION="en_US.utf-8"
LC_ALL=en_US.utf-8
+++ exited with 0 +++

and I'm still getting errors like

/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf-8)
bertogg commented 1 year ago

Ok, that output seems correct, I suppose that's after you reinstalled glibc.

Were you making changes to the root filesystem before you saw that error for the first time? en_US.utf-8 is the default locale and it should always be available, but those that the errors that you get when it's not installed.