Created attachment 697286 [details] build log Description of problem: I've tested only gcc-4.8.0-0.{8,10,12}.fc19, but all of them fail to build glibc-2.17-2.fc19 (or glibc-2.17-1.fc19, with is known to build with gcc-4.7.2-9): mkdir /builddir/build/BUILDROOT/glibc-2.17-2.fc19.ppc/usr/lib/locale aa_DJ.UTF-8aa_ER.UTF-8af_ZA.UTF-8aa_ER.UTF-8aa_DJ.ISO-8859-1...am_ET....ISO-8859-15an_ESaa_ET.UTF-8.UTF-8...af_ZA.ISO-8859-1...ar_BH.ISO-8859-6...ar_BH.UTF-8...ar_AEar_AE.ISO-8859-6.UTF-8............ar_DZar_DZ.ISO-8859-6.UTF-8................../bin/sh: line 13: 40821 Segmentation fault I18NPATH=. GCONV_PATH=/builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/iconvdata LC_ALL=C /builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/elf/ld.so --library-path /builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux:/builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/math:/builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/elf:/builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/dlfcn:/builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/nss:/builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/nis:/builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/rt:/builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/resolv:/builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/crypt:/builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/nptl /builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/locale/localedef --alias-file=../intl/locale.alias --no-archive -i locales/$input -c -f charmaps/$charset --prefix=/builddir/build/BUILDROOT/glibc-2.17-2.fc19.ppc $locale /bin/sh: line 13: 40834 Segmentation fault I18NPATH=. GCONV_PATH=/builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/iconvdata LC_ALL=C /builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/elf/ld.so --library-path /builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux:/builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/math:/builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/elf:/builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/dlfcn:/builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/nss:/builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/nis:/builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/rt:/builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/resolv:/builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/crypt:/builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/nptl /builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/locale/localedef --alias-file=../intl/locale.alias --no-archive -i locales/$input -c -f charmaps/$charset --prefix=/builddir/build/BUILDROOT/glibc-2.17-2.fc19.ppc $locale done done /bin/sh: line 13: 40827 Segmentation fault I18NPATH=. GCONV_PATH=/builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/iconvdata LC_ALL=C /builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/elf/ld.so --library-path /builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux:/builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/math:/builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/elf:/builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/dlfcn:/builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/nss:/builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/nis:/builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/rt:/builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/resolv:/builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/crypt:/builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/nptl /builddir/build/BUILD/glibc-2.17-c758a686/build-ppc-redhat-linux/locale/localedef --alias-file=../intl/locale.alias --no-archive -i locales/$input -c -f charmaps/$charset --prefix=/builddir/build/BUILDROOT/glibc-2.17-2.fc19.ppc $locale done How reproducible: always Steps to Reproduce: 1. ppc-koji build --scratch f19 glibc-2.17-2.fc19.src.rpm 2. 3. Actual results: http://ppc.koji.fedoraproject.org/koji/taskinfo?taskID=909430 Expected results: Additional info: I've set up a rawhide mock environment and changed only gcc and it dependencies from gcc-4.7.2-9 to the newer gcc-4.8.0. glibc-2.17-1.fc19 builds fine with the old compiler, but there are lots of segfaults when compiled with the newer gcc.
Created attachment 697287 [details] root log
This sounds like something that needs to be fixed on the glibc side, at least my understanding of the bug. gcc 4.8 now has -ftree-loop-distribute-patterns by default for -O3, which is undesirable if one compiles with it the implementation of memset or memcpy if they are not implemented in assembly. So, I think glibc should check in configure whether -fno-tree-loop-distribute-patterns option is accepted, and if yes, add it to CFLAGS for {,rtld-}mem{set,cpy,pcpy}.o* at least or perhaps for all functions in string/ subdir, whatever. At least, that is what I saw in the backtrace (endless recursion in the dynamic linker's memset).
Jakub, Yes, we need to fix this in glibc. We should disable the optimization for all of elf/ and string/ where it could cause infinite recursion matching patterns on the function it itself wants to call. If the list of detected patterns changes then glibc needs to be updated, so we should keep clear the channels of communication. My preference would be that gcc clearly documents which functions might be called by the optimization that way other developers implementing their own runtimes can adjust accordingly. Comments on enhancing gcc documentation?
Raised with upstream to discuss acceptable solution: http://sourceware.org/ml/libc-alpha/2013-02/msg00299.html
Hi Carlos, I believe Steve Munroe responded directly to you after your upstream post. Thoughts?
Baude, Yes, Steve Munroe did respond directly to me indicating that it should be OK for elf/ and string/ to be excluded from this optimization. I'm working through a solution to this for today and I'll work to get it into rawhide.
Patch done. Tested, and verified. Posting upstream.
Found a an issues relating to old compilers, adding some checks.
I have a rawhide patch that works with gcc 4.6.0 and newer, and will be committing this once my local builds complete. The upstream patch will require a little more work and I don't want to block the rawhide builds any longer.
Verified that I can build the patched glibc with gcc 4.8.0 without any problems. Verified that there were no testsuite regressions on x86_64. Fix checked into rawhide... --- commit 6cfdaac5b6b98b0810253d20e3cb4e069f432ec6 Author: Carlos O'Donell <carlos> Date: Wed Feb 27 19:48:51 2013 -0500 2.17-3 - Renamed release engineering directory to `releng' (#903754). - Fix building with gcc 4.8.0 (#911307). --- ... and build started: http://koji.fedoraproject.org/koji/taskinfo?taskID=5062864 I'll wait for koji builds to complete before marking this as fixed, but my local and mockbuild didn't fail so I don't expect any surprises.
Previously submittted koji builds failed for some odd reason. Resubmitted builds worked fine. http://koji.fedoraproject.org/koji/taskinfo?taskID=5063196 I'm marking this CLOSED / RAWHIDE.