Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 486532

Summary: sys-libs/timezone-data-2013f-r1: /usr/share/zoneinfo/posix -> . symlink causes some applications into an infinite loop
Product: Gentoo Linux Reporter: Patrick Lauer <patrick>
Component: New packagesAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED WORKSFORME    
Severity: normal CC: alexander, arfrever.fta, gmturner007, julien.sanchez, kripton, qa, whissi
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 486556, 489998, 491176    
Bug Blocks: 538484    

Description Patrick Lauer gentoo-dev 2013-09-30 03:18:10 UTC
$ stat /usr/share/zoneinfo/posix
  File: ‘/usr/share/zoneinfo/posix’ -> ‘.’
  Size: 1               Blocks: 0          IO Block: 4096   symbolic link
Device: fd00h/64768d    Inode: 812905      Links: 1
Access: (0777/lrwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)

This symlink to the parent directory breaks some applications (reports of mysql/mariadb and postgresql in #gentoo) 

By traversing depth-first they run into an infinite loop, this is an unwarranted change in behaviour compared to previous versions.
Comment 1 SpanKY gentoo-dev 2013-09-30 04:46:54 UTC
(In reply to Patrick Lauer from comment #0)
> By traversing depth-first they run into an infinite loop, this is an
> unwarranted change in behaviour compared to previous versions.

you might want to avoid editorializing when you don't understand the system.  deleting 2MB of duplicate data is not "unwarranted".

we might consider temporarily disabling the symlink (and keeping the duplicate data), but mariadb/etc... should be fixed.
Comment 2 Thomas Deutschmann (RETIRED) gentoo-dev 2013-11-20 20:30:24 UTC
Hi,

sys-libs/timezone-data-2013g and sys-libs/timezone-data-2013h is failing with:

>>> Failed to install sys-libs/timezone-data-2013h, Log file:
>>>  '/var/log/portage/build/sys-libs/timezone-data-2013h:20131120-202543.log'
>>> Jobs: 0 of 1 complete, 1 failed                 Load avg: 0.31, 0.94, 1.37
 * Package:    sys-libs/timezone-data-2013h
 * Repository: gentoo
 * Maintainer: djc@gentoo.org toolchain@gentoo.org
 * USE:        abi_x86_64 amd64 elibc_glibc kernel_linux multilib nls userland_GNU
 * FEATURES:   preserve-libs sandbox userpriv usersandbox
>>> Unpacking source...
>>> Unpacking tzdata2013h.tar.gz to /var/tmp/portage/sys-libs/timezone-data-2013h/work
>>> Unpacking tzcode2013h.tar.gz to /var/tmp/portage/sys-libs/timezone-data-2013h/work
>>> Source unpacked in /var/tmp/portage/sys-libs/timezone-data-2013h/work
>>> Preparing source in /var/tmp/portage/sys-libs/timezone-data-2013h/work ...
 * Applying timezone-data-2013h-makefile.patch ...
 [ ok ]
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/sys-libs/timezone-data-2013h/work ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/sys-libs/timezone-data-2013h/work ...
make -j8 TOPDIR=/usr 'CFLAGS= -O2 -pipe -march=bdver1 -mno-movbe -mno-fma -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rtm -mno-hle -mno-rdseed -mno-adx -mno-xsaveopt --param l1-cache-size=16 --param l1-cache-line-size=64 --param l2-cache-size=2048 -mtune=generic -std=gnu99' 'LDFLAGS=-Wl,-O1 -Wl,--as-needed' LDLIBS=
sed \
                -e 's|#!/bin/bash|#!/bin/bash|g' \
                -e 's|AWK=[^}]*|AWK=awk|g' \
                -e 's|\(PKGVERSION\)=.*|\1='\''(tzcode) '\''|' \
                -e 's|\(REPORT_BUGS_TO\)=.*|\1=tz@iana.org|' \
                -e 's|TZDIR=[^}]*|TZDIR=/usr/share/zoneinfo|' \
                -e 's|\(TZVERSION\)=.*|\1=2013h|' \
                <tzselect.ksh >tzselect
(echo 'static char const PKGVERSION[]="(tzcode) ";' && \
         echo 'static char const TZVERSION[]="2013h";' && \
         echo 'static char const REPORT_BUGS_TO[]="tz@iana.org";') >version.h
x86_64-pc-linux-gnu-gcc -DTZDIR=\"/usr/share/zoneinfo\" -DHAVE_GETTEXT=1 -DTZ_DOMAIN=\"libc\" -O2 -pipe -march=bdver1 -mno-movbe -mno-fma -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rtm -mno-hle -mno-rdseed -mno-adx -mno-xsaveopt --param l1-cache-size=16 --param l1-cache-line-size=64 --param l2-cache-size=2048 -mtune=generic -std=gnu99   -c -o localtime.o localtime.c
x86_64-pc-linux-gnu-gcc -DTZDIR=\"/usr/share/zoneinfo\" -DHAVE_GETTEXT=1 -DTZ_DOMAIN=\"libc\" -O2 -pipe -march=bdver1 -mno-movbe -mno-fma -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rtm -mno-hle -mno-rdseed -mno-adx -mno-xsaveopt --param l1-cache-size=16 --param l1-cache-line-size=64 --param l2-cache-size=2048 -mtune=generic -std=gnu99   -c -o asctime.o asctime.c
x86_64-pc-linux-gnu-gcc -DTZDIR=\"/usr/share/zoneinfo\" -DHAVE_GETTEXT=1 -DTZ_DOMAIN=\"libc\" -O2 -pipe -march=bdver1 -mno-movbe -mno-fma -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rtm -mno-hle -mno-rdseed -mno-adx -mno-xsaveopt --param l1-cache-size=16 --param l1-cache-line-size=64 --param l2-cache-size=2048 -mtune=generic -std=gnu99   -c -o scheck.o scheck.c
x86_64-pc-linux-gnu-gcc -DTZDIR=\"/usr/share/zoneinfo\" -DHAVE_GETTEXT=1 -DTZ_DOMAIN=\"libc\" -O2 -pipe -march=bdver1 -mno-movbe -mno-fma -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rtm -mno-hle -mno-rdseed -mno-adx -mno-xsaveopt --param l1-cache-size=16 --param l1-cache-line-size=64 --param l2-cache-size=2048 -mtune=generic -std=gnu99   -c -o ialloc.o ialloc.c
cp yearistype.sh yearistype
x86_64-pc-linux-gnu-gcc -DTZDIR=\"/usr/share/zoneinfo\" -DHAVE_GETTEXT=1 -DTZ_DOMAIN=\"libc\" -O2 -pipe -march=bdver1 -mno-movbe -mno-fma -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rtm -mno-hle -mno-rdseed -mno-adx -mno-xsaveopt --param l1-cache-size=16 --param l1-cache-line-size=64 --param l2-cache-size=2048 -mtune=generic -std=gnu99   -c -o difftime.o difftime.c
chmod +x yearistype
x86_64-pc-linux-gnu-gcc -DTZDIR=\"/usr/share/zoneinfo\" -DHAVE_GETTEXT=1 -DTZ_DOMAIN=\"libc\" -O2 -pipe -march=bdver1 -mno-movbe -mno-fma -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rtm -mno-hle -mno-rdseed -mno-adx -mno-xsaveopt --param l1-cache-size=16 --param l1-cache-line-size=64 --param l2-cache-size=2048 -mtune=generic -std=gnu99   -c -o zic.o zic.c
chmod +x tzselect
x86_64-pc-linux-gnu-gcc -DTZDIR=\"/usr/share/zoneinfo\" -DHAVE_GETTEXT=1 -DTZ_DOMAIN=\"libc\" -O2 -pipe -march=bdver1 -mno-movbe -mno-fma -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rtm -mno-hle -mno-rdseed -mno-adx -mno-xsaveopt --param l1-cache-size=16 --param l1-cache-line-size=64 --param l2-cache-size=2048 -mtune=generic -std=gnu99   -c -o zdump.o zdump.c
x86_64-pc-linux-gnu-gcc -DTZDIR=\"/usr/share/zoneinfo\" -DHAVE_GETTEXT=1 -DTZ_DOMAIN=\"libc\" -o zdump -O2 -pipe -march=bdver1 -mno-movbe -mno-fma -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rtm -mno-hle -mno-rdseed -mno-adx -mno-xsaveopt --param l1-cache-size=16 --param l1-cache-line-size=64 --param l2-cache-size=2048 -mtune=generic -std=gnu99 -Wl,-O1 -Wl,--as-needed zdump.o localtime.o ialloc.o asctime.o
ar ru libtz.a localtime.o asctime.o difftime.o
ar: creating libtz.a
: libtz.a
x86_64-pc-linux-gnu-gcc -DTZDIR=\"/usr/share/zoneinfo\" -DHAVE_GETTEXT=1 -DTZ_DOMAIN=\"libc\" -o zic -O2 -pipe -march=bdver1 -mno-movbe -mno-fma -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rtm -mno-hle -mno-rdseed -mno-adx -mno-xsaveopt --param l1-cache-size=16 --param l1-cache-line-size=64 --param l2-cache-size=2048 -mtune=generic -std=gnu99 -Wl,-O1 -Wl,--as-needed zic.o localtime.o asctime.o scheck.o ialloc.o
>>> Source compiled.
>>> Test phase [not enabled]: sys-libs/timezone-data-2013h

>>> Install timezone-data-2013h into /var/tmp/portage/sys-libs/timezone-data-2013h/image/ category sys-libs
make -j8 install DESTDIR=/var/tmp/portage/sys-libs/timezone-data-2013h/image/
./zic  -y ./yearistype -d /var/tmp/portage/sys-libs/timezone-data-2013h/image//usr/share/zoneinfo \
                -L /dev/null africa antarctica asia australasia europe northamerica southamerica pacificnew etcetera backward systemv factory solar87 solar88 solar89
rm -fr /var/tmp/portage/sys-libs/timezone-data-2013h/image//usr/share/zoneinfo-posix
ln -s . /var/tmp/portage/sys-libs/timezone-data-2013h/image//usr/share/zoneinfo/posix || \
          ./zic  -y ./yearistype -d /var/tmp/portage/sys-libs/timezone-data-2013h/image//usr/share/zoneinfo/posix \
                -L /dev/null africa antarctica asia australasia europe northamerica southamerica pacificnew etcetera backward systemv factory solar87 solar88 solar89
./zic  -y ./yearistype -d /var/tmp/portage/sys-libs/timezone-data-2013h/image//usr/share/zoneinfo/right \
                -L leapseconds africa antarctica asia australasia europe northamerica southamerica pacificnew etcetera backward systemv factory solar87 solar88 solar89
mkdir -p /var/tmp/portage/sys-libs/timezone-data-2013h/image/ /var/tmp/portage/sys-libs/timezone-data-2013h/image//usr/share/zoneinfo \
                /var/tmp/portage/sys-libs/timezone-data-2013h/image//usr/sbin /var/tmp/portage/sys-libs/timezone-data-2013h/image//usr/bin \
                /var/tmp/portage/sys-libs/timezone-data-2013h/image//usr/share/man/man3 /var/tmp/portage/sys-libs/timezone-data-2013h/image//usr/share/man/man5 \
                /var/tmp/portage/sys-libs/timezone-data-2013h/image//usr/share/man/man8
./zic  -y ./yearistype \
                -d /var/tmp/portage/sys-libs/timezone-data-2013h/image//usr/share/zoneinfo -l GMT -p America/New_York
cp -f iso3166.tab zone.tab /var/tmp/portage/sys-libs/timezone-data-2013h/image//usr/share/zoneinfo/.
cp zic zdump /var/tmp/portage/sys-libs/timezone-data-2013h/image//usr/sbin/.
cp tzselect /var/tmp/portage/sys-libs/timezone-data-2013h/image//usr/bin/.
cp -f newctime.3 newtzset.3 /var/tmp/portage/sys-libs/timezone-data-2013h/image//usr/share/man/man3/.
>>> Completed installing timezone-data-2013h into /var/tmp/portage/sys-libs/timezone-data-2013h/image/

strip: x86_64-pc-linux-gnu-strip --strip-unneeded -R .comment -R .GCC.command.line -R .note.gnu.gold-version
   usr/sbin/zic
   usr/sbin/zdump
ecompressdir: bzip2 -9 /usr/share/man
>>> Done.
Traceback (most recent call last):
  File "/usr/lib64/portage/pym/portage/dbapi/_MergeProcess.py", line 234, in _spawn
    prev_mtimes=self.prev_mtimes, counter=counter)
  File "/usr/lib64/portage/pym/portage/dbapi/vartree.py", line 4839, in merge
    counter=counter)
  File "/usr/lib64/portage/pym/portage/dbapi/vartree.py", line 3647, in treewalk
    retval = self._security_check(others_in_slot)
  File "/usr/lib64/portage/pym/portage/dbapi/vartree.py", line 3403, in _security_check
    s = os.lstat(path)
  File "/usr/lib64/portage/pym/portage/__init__.py", line 259, in __call__
    rval = self._func(*wrapped_args, **wrapped_kwargs)
OSError: [Errno 40] Too many levels of symbolic links: '/usr/share/zoneinfo/posix/Africa/Conakry'


Is this bug report about this problem or should I create a new one?
Comment 3 Arfrever Frehtes Taifersar Arahesis 2013-11-20 20:41:53 UTC
(In reply to Thomas D. from comment #2)
> OSError: [Errno 40] Too many levels of symbolic links: ...

Which version of Python and Portage?
Comment 4 Thomas Deutschmann (RETIRED) gentoo-dev 2013-11-20 20:46:56 UTC
 # emerge --info
Portage 2.2.7 (default/linux/amd64/13.0, gcc-4.8.2, glibc-2.17, 3.10.17-alt381-amd64 x86_64)
=================================================================
System uname: Linux-3.10.17-alt381-amd64-x86_64-AMD_Opteron-TM-_Processor_6272-with-gentoo-2.2
KiB Mem:    65908096 total,  60784404 free
KiB Swap:          0 total,         0 free
Timestamp of tree: Wed, 20 Nov 2013 19:45:01 +0000
ld GNU ld (GNU Binutils) 2.23.1
app-shells/bash:          4.2_p45
dev-lang/python:          2.7.5-r4, 3.2.5-r3, 3.3.2-r2
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.69
sys-devel/automake:       1.13.4
sys-devel/binutils:       2.23.1
sys-devel/gcc:            4.8.2
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.10 (virtual/os-headers)
sys-libs/glibc:           2.17



I am currently in chrooted environment (this is a new installation) and doing the first @world update.

I am actual unable to install any timezone-data package (2013d is also not working).
Comment 5 Thomas Deutschmann (RETIRED) gentoo-dev 2013-11-20 20:54:23 UTC
OK, fixed:

sys-apps/file-5.12-r1 was causing the problem. After updating to sys-apps/file-5.15 I can now emerge sys-libs/timezone-data again.

Sorry for any noise.
Comment 6 Greg Turner 2014-04-08 20:39:15 UTC
Also prevents postgres-8.4 from starting ftr.
Comment 7 Greg Turner 2014-04-08 20:42:03 UTC
(In reply to Greg Turner from comment #6)
> Also prevents postgres-8.4 from starting ftr.

Oops, looks like that was already noted via bug dependencies.
Comment 8 Maxim Mikityanskiy 2015-02-10 18:11:58 UTC
xfce-base/xfce4-panel also suffers from this: https://bugzilla.xfce.org/show_bug.cgi?id=11495

Having /usr/share/zoneinfo/posix -> . symlink is completely wrong. /usr/share/zoneinfo/posix should contain only timezone information files, it shouldn't contain /usr/share/zoneinfo/posix/posix which contains /usr/share/zoneinfo/posix/posix/posix etc.

This problem could be solved without duplicating 2 MB of data. E.g. on Ubuntu /usr/share/zoneinfo/posix is a folder which contains symlinks to all timezone files in /usr/share/zoneinfo.

So reopen this bug please.
Comment 9 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-04-14 19:25:44 UTC
Please replace that with a directory of symlinks then. Patching random Gentoo packages to support this is unacceptable.
Comment 10 SpanKY gentoo-dev 2015-04-14 20:25:44 UTC
(In reply to Michał Górny from comment #9)

very few packages actually walk the db directly.  if they fail to handle circ loops, then fix them and send the patches upstream.

this is a bit moot w/2015c-r1 at any rate.