symlinks uses lstat(2) to find dangling symlinks, but fails with EOVERFLOW when running on 32-bit (x86) and when the target file is >2GB. Reproducible: Always Steps to Reproduce: 1. emerge symlinks on 32-bit arch (x86) 2. create symlink to file >2GB 3. oopsie Actual Results: holger>ll foo largefile lrwxrwxrwx 1 holger users 8 Mar 27 23:27 foo -> swapfile -rw-r--r-- 1 holger users 2.0G Mar 27 23:25 largefile holger>symlinks -r /tmp dangling: /tmp/foo -> largefile /tmp/largefile: Value too large for defined data type Expected Results: No error
Created attachment 306909 [details, diff] Patch to add 64-bit file offset awareness This kills the bug.
(In reply to comment #0) > lrwxrwxrwx 1 holger users 8 Mar 27 23:27 foo -> swapfile > -rw-r--r-- 1 holger users 2.0G Mar 27 23:25 largefile *sigh* in case anyone is wondering about this inconsistency ("swapfile" vs. "largefile") in target filenames: this was an error in manual editing to hide the real filenames. The bug is real and reproducible.
+*symlinks-1.4-r1 (28 Mar 2012) + + 28 Mar 2012; Justin Lecher <jlec@gentoo.org> +symlinks-1.4-r1.ebuild: + Add lfs flags in order to handle largefiles, #409927; drop optimization flag + from upstream +
The append-lfs-flags thing didn't work for me (yes, I rebuilt -r1): root>symlinks -r / | grep dangling /swapfile: Value too large for defined data type Any ideas why?
(In reply to comment #4) > The append-lfs-flags thing didn't work for me (yes, I rebuilt -r1): > > root>symlinks -r / | grep dangling > /swapfile: Value too large for defined data type > > Any ideas why? If I manually add the flags from append-lfs-flags() in http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/flag-o-matic.eclass?revision=1.169&view=markup to the original Makefile and rebuild, it works. The ebuild does not apply the flag. holger>emerge --quiet-build=n symlinks Calculating dependencies ... done! >>> Verifying ebuild manifests >>> Emerging (1 of 1) app-misc/symlinks-1.4-r1 * symlinks-1.4.tar.gz RMD160 SHA1 SHA256 size ;-) ... [ ok ] >>> Unpacking source... >>> Unpacking symlinks-1.4.tar.gz to /var/tmp/portage/app-misc/symlinks-1.4-r1/work >>> Source unpacked in /var/tmp/portage/app-misc/symlinks-1.4-r1/work >>> Preparing source in /var/tmp/portage/app-misc/symlinks-1.4-r1/work/symlinks-1.4 ... >>> Source prepared. >>> Configuring source in /var/tmp/portage/app-misc/symlinks-1.4-r1/work/symlinks-1.4 ... >>> Source configured. >>> Compiling source in /var/tmp/portage/app-misc/symlinks-1.4-r1/work/symlinks-1.4 ... make -j4 CC=i686-pc-linux-gnu-gcc 'CFLAGS=-pipe -march=native -mfpmath=sse -msse4.2 -O2 -fomit-frame-pointer -Wl,-O1,--as-needed,-z,now' i686-pc-linux-gnu-gcc -Wall -Wstrict-prototypes -pipe -march=native -mfpmath=sse -msse4.2 -O2 -fomit-frame-pointer -Wl,-O1,--as-needed,-z,now -o symlinks symlinks.c >>> Source compiled. >>> Test phase [not enabled]: app-misc/symlinks-1.4-r1
The reason is that append-lfs-flags appends to CPPFLAGS, not CFLAGS. So it miust be passed to make: emake CC=$(tc-getCC) CFLAGS="${CPPFLAGS} ${CFLAGS} ${LDFLAGS}" This works.
(In reply to comment #6) > The reason is that append-lfs-flags appends to CPPFLAGS, not CFLAGS. So it > miust be passed to make: emake CC=$(tc-getCC) CFLAGS="${CPPFLAGS} ${CFLAGS} > ${LDFLAGS}" > > This works. Thanks for the tip, I should have looked more closely.