Bug 1031254

Summary: Every reboot, locales in bash are reset to C, need yum reinstall -y glibc-common to get it working again
Product: [Fedora] Fedora Reporter: Rudd-O DragonFear <rudd-o>
Component: glibcAssignee: Carlos O'Donell <codonell>
Status: CLOSED WORKSFORME QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: codonell, fweimer, jakub, law, pfrankli, rudd-o, schwab, spoyarek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-10 04:25:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Rudd-O DragonFear 2013-11-16 08:12:13 UTC
Description of problem:

Every time I log into X:

set | grep LANG                                                                                               
GDM_LANG=C
LANG=C

Every time I login to the console, I get a bunch of error messages about setlocale cannot change locale.

Yum reinstall glibc-common fixes it... until next reboot

Both the latest glibc and the previous version have this problem.


Version-Release number of selected component (if applicable):

glibc-2.17-4.fc19.x86_64



How reproducible:

always

Steps to Reproduce:
1. upgrade to latest fedora 19
2. reboot
3. bam

Actual results:

locale is not set in any program


Expected results:


Additional info:

Comment 1 Rudd-O DragonFear 2013-11-16 09:38:22 UTC
happens in fedora 20 as well

in X11 (KDE):

locale
LANG=C
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"                                                                                              
LC_MEASUREMENT="C"                                                                                            
LC_IDENTIFICATION="C"                                                                                         
LC_ALL= 

in the console:

locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8

Comment 2 Rudd-O DragonFear 2013-11-16 09:55:08 UTC
cat /proc/`pidof startkde`/environ | nul2newline | grep LANG
LANG=C
GDM_LANG=C

but

cat /proc/`pidof gdm`/environ | nul2newline
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
LANG=en_US.utf8

wat

Comment 3 Rudd-O DragonFear 2013-11-16 09:59:24 UTC
~@karen.dragonfear:
locale
LANG=C
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=

0 <- locale
~@karen.dragonfear:
su - rudd-o -c locale
Password: 
/etc/profile.d/lang.sh: line 19: warning: setlocale: LC_CTYPE: cannot change locale (en_US.UTF-8): No such file or directory
/etc/profile.d/lang.sh: line 20: warning: setlocale: LC_COLLATE: cannot change locale (en_US.UTF-8): No such file or directory
/etc/profile.d/lang.sh: line 23: warning: setlocale: LC_MESSAGES: cannot change locale (en_US.UTF-8): No such file or directory
/etc/profile.d/lang.sh: line 26: warning: setlocale: LC_NUMERIC: cannot change locale (en_US.UTF-8): No such file or directory
/etc/profile.d/lang.sh: line 29: warning: setlocale: LC_TIME: cannot change locale (en_US.UTF-8): No such file or directory
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
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=

Comment 4 Rudd-O DragonFear 2013-11-16 10:00:51 UTC
su - rudd-o -c 'strace -efile -ff locale'
Password: 
/etc/profile.d/lang.sh: line 19: warning: setlocale: LC_CTYPE: cannot change locale (en_US.UTF-8): No such file or directory
/etc/profile.d/lang.sh: line 20: warning: setlocale: LC_COLLATE: cannot change locale (en_US.UTF-8): No such file or directory
/etc/profile.d/lang.sh: line 23: warning: setlocale: LC_MESSAGES: cannot change locale (en_US.UTF-8): No such file or directory
/etc/profile.d/lang.sh: line 26: warning: setlocale: LC_NUMERIC: cannot change locale (en_US.UTF-8): No such file or directory
/etc/profile.d/lang.sh: line 29: warning: setlocale: LC_TIME: cannot change locale (en_US.UTF-8): No such file or directory
execve("/bin/locale", ["locale"], [/* 44 vars */]) = 0
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/locale/en_US.UTF-8/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/en_US.utf8/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/en_US/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/en.UTF-8/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/en.utf8/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/en/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
locale: Cannot set LC_CTYPE to default locale: No such file or directory
open("/usr/lib/locale/en_US.UTF-8/LC_MESSAGES", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/en_US.utf8/LC_MESSAGES", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/en_US/LC_MESSAGES", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/en.UTF-8/LC_MESSAGES", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/en.utf8/LC_MESSAGES", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/en/LC_MESSAGES", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

Comment 5 Rudd-O DragonFear 2013-11-16 10:29:27 UTC
localedef -i en_US -c -f UTF-8 en_US.UTF-8

fixes the problems temporarily

the only file it touches is /usr/lib/locale/locale-archive

Comment 6 Carlos O'Donell 2013-11-16 19:55:31 UTC
This is really not normal. When you reinstall glibc-common it will install the entire set of locale archives, so you'll get things working. However, it appears that something else in your system is either corrupting or overwriting locale-archive.

Try this:
* Reboot.
* Run `localedef --list-archive'

What does the last step print?

Comment 7 Rudd-O DragonFear 2013-11-16 20:32:33 UTC
Nothing. It's empty output.  But the locale-archive file has NOT been corrupted.  It hasn't even been touched since yesterday, when I recreated it with localedef  -i en_US -c -f UTF-8 en_US.UTF-8.

Comment 8 Rudd-O DragonFear 2013-11-16 21:14:34 UTC
OK, I have rolled back to my previous upgrade (F19, before I upgraded F19 packages for the last time, and before I upgraded to F20).  I will try to reproduce with a vanilla Fedora 20 and Fedora 19 generated with zfs-fedora-installer.

Comment 9 Carlos O'Donell 2013-11-17 14:13:42 UTC
(In reply to Rudd-O DragonFear from comment #8)
> OK, I have rolled back to my previous upgrade (F19, before I upgraded F19
> packages for the last time, and before I upgraded to F20).  I will try to
> reproduce with a vanilla Fedora 20 and Fedora 19 generated with
> zfs-fedora-installer.

The glibc-common install has over 100MB of locale data that it installs by default. Do you have at least 200MB free when you install glibc-common? Without that much free space the locale-archive file might not get created, nor might the other locales be installed, in which case you have only POSIX and C default builtin locales.

Comment 10 Rudd-O DragonFear 2013-11-28 10:36:12 UTC
No lack of disk space.

I will try to repro on a vanilla instance.  Otherwise I must assume I have been ruined by an exploit or something similar.

Comment 11 Carlos O'Donell 2013-11-28 19:23:57 UTC
(In reply to Rudd-O DragonFear from comment #10)
> No lack of disk space.
> 
> I will try to repro on a vanilla instance.  Otherwise I must assume I have
> been ruined by an exploit or something similar.

It's truly an odd situation. I look forward to hearing if you can reproduce it in a vanilla instance.

Comment 12 Rudd-O DragonFear 2013-12-10 03:59:35 UTC
I re-updated.  Same problem.  No lack of disk space.

Anyone else experiencing the same problem?

Comment 13 Rudd-O DragonFear 2013-12-10 04:25:58 UTC
I cannot reproduce after running the yum reinstall glibc-common and rebooting.  I added an audit rule, that seems to have stopped the file from being screwed with.  Will reboot after removing the rule, see if that makes a difference.

Comment 14 Carlos O'Donell 2013-12-10 04:29:59 UTC
(In reply to Rudd-O DragonFear from comment #12)
> I re-updated.  Same problem.  No lack of disk space.
> 
> Anyone else experiencing the same problem?

This is the first report of such a problem. Your configuration is unique in this respect so far. I can't see anything on our end that would cause this to happen. My best guess would be something in your startup which deletes locales from /usr/lib/locale/locale-archive to save disk space?

Is this a vanilla Fedora 20 install? VM? Real hardware?

Comment 15 Rudd-O DragonFear 2013-12-19 05:07:33 UTC
Physical hardware.