Bug 260841 - circular symbolic links in /usr/share/locale
Summary: circular symbolic links in /usr/share/locale
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 14.0-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: Yuri Pankov
URL:
Keywords:
: 275384 (view as bug list)
Depends on:
Blocks: 276235
  Show dependency treegraph
 
Reported: 2021-12-31 11:32 UTC by Martin Birgmeier
Modified: 2024-07-07 12:21 UTC (History)
12 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Birgmeier 2021-12-31 11:32:54 UTC
Scenario:
- FreeBSD main (but also in previous releases)
- Building in /usr/src using "make buildworld buildkernel"
- Installing using "make installkernel installworld"

Result:
- There are circular symbolic links in /usr/local/share
- See the following output:

[0]# diff -r /usr/share/locale /usr/share/locale > /dev/null
diff: /usr/share/locale/nn_NO.ISO8859-1/LC_MESSAGES: Too many levels of symbolic links
diff: /usr/share/locale/nn_NO.ISO8859-15/LC_MESSAGES: Too many levels of symbolic links
diff: /usr/share/locale/sl_SI.ISO8859-2/LC_MESSAGES: No such file or directory
[0]# 

Expected result:
- The links should point to reasonable targets
Comment 1 Ed Maste freebsd_committer freebsd_triage 2022-01-02 21:12:48 UTC
Does not appear to be reproducible on my ~13.0 laptop.

$ diff -r /usr/share/locale /usr/share/locale > /dev/null
$
Comment 2 Ed Maste freebsd_committer freebsd_triage 2022-01-02 21:16:59 UTC
Oh, but:

share/msgdef/Makefile
...
SAME+=          sr_RS.ISO8859-2 sl_SI.ISO8859-2
...
SAME+=          nn_NO.ISO8859-15 nn_NO.ISO8859-15
...
Comment 3 Martin Birgmeier 2022-01-02 21:18:30 UTC
Hmmm... maybe it is really just in main (this is where the output is from).

-- Martin
Comment 4 Yuri Pankov freebsd_committer freebsd_triage 2023-09-17 23:54:17 UTC
The issue is there, introduced in base 0a36787e4c1fa0cf77dcf83be0867178476e372b.
Comment 5 commit-hook freebsd_committer freebsd_triage 2023-09-21 10:55:51 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=159599c4a2bbd8fcc4bb7f845afe3e0ea232ab9e

commit 159599c4a2bbd8fcc4bb7f845afe3e0ea232ab9e
Author:     Yuri Pankov <yuripv@FreeBSD.org>
AuthorDate: 2023-09-21 10:45:54 +0000
Commit:     Yuri Pankov <yuripv@FreeBSD.org>
CommitDate: 2023-09-21 10:54:21 +0000

    msgdef: fix NO and SI locales

    Fix circular symlinks by providing separate source for nn_NO.ISO8859-1,
    nn_NO.ISO8859-15, and sl_SI.ISO8859-2 (re)generated from CLDR.

    PR:             260841
    Reviewed by:    imp (previous version)
    Fixes:  0a36787e4c1f ("locales: separate unicode from other locales")
    Differential Revision:  https://reviews.freebsd.org/D41899

 share/msgdef/Makefile                   | 5 ++---
 share/msgdef/nn_NO.ISO8859-15.src (new) | 8 ++++++++
 share/msgdef/sl_SI.ISO8859-2.src (new)  | 8 ++++++++
 3 files changed, 18 insertions(+), 3 deletions(-)
Comment 6 Yasuhito FUTATSUKI 2023-11-24 17:59:51 UTC
On Fresh install of FreeBSD/amd64 14.0-RELEASE environment:

$ ls -l /usr/share/locale/nn_NO.ISO8859-1/LC_MESSAGES /usr/share/locale/nn_NO.ISO8859-15/LC_MESSAGES 
lrwxr-xr-x  1 root wheel 31 Nov 10 17:37 /usr/share/locale/nn_NO.ISO8859-1/LC_MESSAGES@ -> ../nn_NO.ISO8859-15/LC_MESSAGES
lrwxr-xr-x  1 root wheel 31 Nov 10 17:37 /usr/share/locale/nn_NO.ISO8859-15/LC_MESSAGES@ -> ../nn_NO.ISO8859-15/LC_MESSAGES
Comment 7 Wolfram Schneider freebsd_committer freebsd_triage 2023-11-25 15:34:24 UTC
The fix should be merge to 14.0-STABLE
Comment 8 johannes.kunde 2023-11-27 20:14:15 UTC
Seems to affect the GitLab port www/gitlab-ce (Rake crashes).

A database migration for example results in:

# su -l git -c "cd /usr/local/www/gitlab-ce && rake db:migrate RAILS_ENV=production"
rake aborted!
Errno::ELOOP: Too many levels of symbolic links - /usr/share/locale/nn_NO.ISO8859-1/LC_MESSAGES
<internal:dir>:220:in `glob'
<internal:/usr/local/lib/ruby/site_ruby/3.1/rubygems/core_ext/kernel_require.rb>:38:in `require'
<internal:/usr/local/lib/ruby/site_ruby/3.1/rubygems/core_ext/kernel_require.rb>:38:in `require'
/usr/local/www/gitlab-ce/config/application.rb:17:in `<top (required)>'
<internal:/usr/local/lib/ruby/site_ruby/3.1/rubygems/core_ext/kernel_require.rb>:86:in `require'
<internal:/usr/local/lib/ruby/site_ruby/3.1/rubygems/core_ext/kernel_require.rb>:86:in `require'
/usr/local/www/gitlab-ce/Rakefile:9:in `<top (required)>'
(See full trace by running task with --trace)
Comment 9 Yuri Pankov freebsd_committer freebsd_triage 2023-11-28 07:17:05 UTC
*** Bug 275384 has been marked as a duplicate of this bug. ***
Comment 10 commit-hook freebsd_committer freebsd_triage 2023-11-28 08:06:13 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=5b4b93e6074c4a928c6a452790ed8a43e1c4a039

commit 5b4b93e6074c4a928c6a452790ed8a43e1c4a039
Author:     Yuri Pankov <yuripv@FreeBSD.org>
AuthorDate: 2023-09-21 10:45:54 +0000
Commit:     Yuri Pankov <yuripv@FreeBSD.org>
CommitDate: 2023-11-28 07:12:11 +0000

    msgdef: fix NO and SI locales

    Fix circular symlinks by providing separate source for nn_NO.ISO8859-1,
    nn_NO.ISO8859-15, and sl_SI.ISO8859-2 (re)generated from CLDR.

    PR:             260841
    Reviewed by:    imp (previous version)
    Fixes:  0a36787e4c1f ("locales: separate unicode from other locales")
    Differential Revision:  https://reviews.freebsd.org/D41899

    (cherry picked from commit 159599c4a2bbd8fcc4bb7f845afe3e0ea232ab9e)

 share/msgdef/Makefile                   | 5 ++---
 share/msgdef/nn_NO.ISO8859-15.src (new) | 8 ++++++++
 share/msgdef/sl_SI.ISO8859-2.src (new)  | 8 ++++++++
 3 files changed, 18 insertions(+), 3 deletions(-)
Comment 11 Yuri Pankov freebsd_committer freebsd_triage 2023-11-28 08:07:11 UTC
Should be fixed now, sorry the fix didn't make it to 14.0-RELEASE.
Comment 12 Yasuhito FUTATSUKI 2023-12-06 01:14:42 UTC
Won't it be fixed on releng/14.0?
Comment 13 Mikael Urankar freebsd_committer freebsd_triage 2024-01-09 07:54:51 UTC
(In reply to Yuri Pankov from comment #11)
Will you issue an EN for 14.0?
Comment 14 Marko Cupać 2024-01-10 12:20:48 UTC
(In reply to Mikael Urankar from comment #13)

Yes, please release this as errata for 14.0. I am sure I am not the only one to run gitlab-ce on FreeBSD. Not being to able to run it on 14.0-RELEASE patched with freebsd-update, but requiring 14-STABLE for it, maintained by building kernel and userland from sources, would be quite a problem.
Comment 15 Yasuhito FUTATSUKI 2024-01-10 14:51:30 UTC
(In reply to Marko Cupać from comment #14)
Actually I met this problem during DB migration after upgrading gitlab-ce, like comment #8. 

I manually rewrote symlinks like 13.2-RELEASE, for I wanted to run gitlab-ce again, immediately.

$ ls -l /usr/share/locale/nn_NO.ISO8859-1/LC_MESSAGES /usr/share/locale/nn_NO.ISO8859-15/LC_MESSAGES 
lrwxr-xr-x  1 root wheel 31 Nov 25 01:43 /usr/share/locale/nn_NO.ISO8859-1/LC_MESSAGES@ -> ../nn_NO.ISO8859-15/LC_MESSAGES
lrwxr-xr-x  1 root wheel 26 Nov 25 02:45 /usr/share/locale/nn_NO.ISO8859-15/LC_MESSAGES@ -> ../nn_NO.UTF-8/LC_MESSAGES
Comment 16 Ed Maste freebsd_committer freebsd_triage 2024-01-10 15:11:40 UTC
The errata template is available at https://www.freebsd.org/security/errata-template.txt

If someone's willing to provide content for sections I through IV (Background, Problem Description, Impact, Workaround) it will be a significant help in preparing an erratum update.
Comment 17 Yuri Pankov freebsd_committer freebsd_triage 2024-01-10 18:13:15 UTC
(In reply to Ed Maste from comment #16)
Working on it.
Comment 18 Marko Cupać 2024-02-12 09:09:11 UTC
(In reply to Yuri Pankov from comment #17)

Any news? I'm holding off upgrading my gitlab instances.
Comment 19 Matthias Fechner freebsd_committer freebsd_triage 2024-04-21 04:34:38 UTC
I upgraded now all my environments to FreeBSD 14 and see exactly the same problem.
Any updates?
Comment 20 Torsten Zuehlsdorff freebsd_committer freebsd_triage 2024-07-07 10:45:59 UTC
> I upgraded now all my environments to FreeBSD 14 and see exactly the same problem.
Any updates?

The bug was already fixed a while ago. I don't see any issues since than :)
Comment 21 Yasuhito FUTATSUKI 2024-07-07 12:00:28 UTC
(In reply to Torsten Zuehlsdorff from comment #20)
Althouht it was fixed before 14.1 in stable/14, I can't see any commit to fix this in releng/14.0 branch, which is still supported version (and the Version: field of this bug pointed).

(Yes, I don't see any problem for me, because I already upgraded my 14.0 environment affected by this bug to 14.1, but ....)
Comment 22 Wolfram Schneider freebsd_committer freebsd_triage 2024-07-07 12:21:23 UTC
(In reply to Torsten Zuehlsdorff from comment #20)

The bug is fixed in FreeBSD 14.1-RELEASE and 14.1-STABLE, but not in FreeBSD 14.0-RELEASE (patched) which is still in support.

$ freebsd-version -u
14.0-RELEASE-p8


$ stale-symlink-buildworld.sh
stale symlink detected: lrwxr-xr-x  1 root wheel 31 Nov 10  2023 /usr/share/locale/nn_NO.ISO8859-1/LC_MESSAGES -> ../nn_NO.ISO8859-15/LC_MESSAGES
stale symlink detected: lrwxr-xr-x  1 root wheel 31 Nov 10  2023 /usr/share/locale/nn_NO.ISO8859-15/LC_MESSAGES -> ../nn_NO.ISO8859-15/LC_MESSAGES
stale symlink detected: lrwxr-xr-x  1 root wheel 30 Nov 10  2023 /usr/share/locale/sl_SI.ISO8859-2/LC_MESSAGES -> ../sr_RS.ISO8859-2/LC_MESSAGES