RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1392855 - build-locale-archive: build-locale-archive.c:301: fill_archive: Assertion `used < head->namehash_used' failed.
Summary: build-locale-archive: build-locale-archive.c:301: fill_archive: Assertion `us...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: glibc
Version: 7.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: glibc team
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
Depends On:
Blocks: 1420851 1473718
TreeView+ depends on / blocked
 
Reported: 2016-11-08 11:20 UTC by Mark Chappell
Modified: 2020-09-10 09:55 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-07-28 11:00:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1398825 0 unspecified CLOSED Updating glibc in docker container causes locales to be unusable 2021-02-22 00:41:40 UTC

Internal Links: 1398825

Description Mark Chappell 2016-11-08 11:20:03 UTC
Description of problem:

We're running a docker container and recently upgraded to the base RHEL7.3 image, which includes glibc-common-2.17-157.el7.x86_64

We have a customer facing application which needs makes use of the locales, and needs to be able to support a large list of languages.

Previously we were able to re-install glib-common to pull in all the additional locales.

Since glibc-common-2.17-157.el7.x86_64, reinstalls no-longer seem to regenerate 
/usr/lib/locale/locale-archive and locale -a only lists C POSIX en_US en_US.iso88591 en_US.iso885915 en_US.utf8

I updated /etc/rpm/macros.image-language-conf to use vi:fr:pl:zh_TW:en_GB:hr:eo:lt:da:id:nb:nl:rw:ja:hu:en_CA:tr:be:en_US:cs:sk:bg:ca:en:fi:ru:sv:el:gl:ko:de:zh_CN:es:it:pt_BR

However locale archive still isn't regenerated because /usr/lib/locale/locale-archive.tmpl is empty

After copying /usr/lib/locale/locale-archive to /usr/lib/locale/locale-archive.tmpl at the suggestion of fweimer

[root@464c7644827a /]# cp /usr/lib/locale/locale-archive /usr/lib/locale/locale-archive.tmpl
cp: overwrite '/usr/lib/locale/locale-archive.tmpl'? y

I consistently get an assertion:

[root@464c7644827a /]# /usr/sbin/build-locale-archive --install-langs vi:fr:pl:zh_TW:en_GB:hr:eo:lt:da:id:nb:nl:rw:ja:hu:en_CA:tr:be:en_US:cs:sk:bg:ca:en:fi:ru:sv:el:gl:ko:de:zh_CN:es:it:pt_BR
build-locale-archive: build-locale-archive.c:301: fill_archive: Assertion `used < head->namehash_used' failed.
Aborted (core dumped)

Version-Release number of selected component (if applicable):
glibc-common-2.17-157.el7.x86_64


How reproducible:
every time

Steps to Reproduce:
1. launch registry.access.redhat.com/rhel7 (id 91c58d6c27c4)
2. reinstall glibc-common 
  yum -y reinstall glibc-common --disablerepo=* --enablerepo=rhel-7-server-rpms
3. (optional) attempt to bulid the locale archive
  /usr/sbin/build-locale-archive --install-langs vi:fr:pl:zh_TW:en_GB:hr:eo:lt:da:id:nb:nl:rw:ja:hu:en_CA:tr:be:en_US:cs:sk:bg:ca:en:fi:ru:sv:el:gl:ko:de:zh_CN:es:it:pt_BR
4. replace empty archive template with current locale-archive
  cp /usr/lib/locale/locale-archive /usr/lib/locale/locale-archive.tmpl
5. Attempt to regenerate archive (minimal list to generate error)
  /usr/sbin/build-locale-archive --install-langs en_US:en


Actual results:
(archive generation)
build-locale-archive: build-locale-archive.c:301: fill_archive: Assertion `used < head->namehash_used' failed.
Aborted (core dumped)

Expected results:
Successful rebuild of archive


Additional info:

Comment 1 Florian Weimer 2016-11-08 12:24:00 UTC
This seems to reproduce outside of the image as well:

# cp /usr/lib/locale/locale-archive /usr/lib/locale/locale-archive.tmpl
cp: overwrite ‘/usr/lib/locale/locale-archive.tmpl’? y
# /usr/sbin/build-locale-archive --install-langs en_US:en
# cp /usr/lib/locale/locale-archive /usr/lib/locale/locale-archive.tmpl
cp: overwrite ‘/usr/lib/locale/locale-archive.tmpl’? y
# /usr/sbin/build-locale-archive --install-langs en_US:en
build-locale-archive: build-locale-archive.c:301: fill_archive: Assertion `used < head->namehash_used' failed.
Aborted

Based on that, the cause is that it's not possible to feed a stripped archive back into build-locale-archive.

Comment 3 Florian Weimer 2016-11-08 13:08:47 UTC
This is mostly a documentation issue with the container images.  In order to broaden the set of installed locales, you need to reinstall glibc-common *after* removing the file /etc/rpm/macros.image-language-conf and removing the override_install_langs=en_US line from /etc/yum.conf.  Otherwise, reinstalling glibc-common will just redo the locale stripping, and the desired locales will never be there after installation (even if we fixed this assertion failure, they are just gone from the file system, which is the entire point of locale stripping).

So to recap, this should get you going:

rm -f /etc/rpm/macros.image-language-conf
sed -i '/^override_install_langs=/d' /etc/yum.conf
yum reinstall glibc-common

After that, you'll have a full complement of locales.  Further steps are needed only if you want to reduce image size.


Note You need to log in before you can comment on or make changes to this bug.