Bug 911307 - gcc-4.8.0-0.{8,10,12} fail to build latest glibc, causing segfaults
Summary: gcc-4.8.0-0.{8,10,12} fail to build latest glibc, causing segfaults
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: rawhide
Hardware: powerpc
OS: Linux
high
high
Target Milestone: ---
Assignee: Carlos O'Donell
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-02-14 17:13 UTC by Karsten Hopp
Modified: 2016-11-24 15:39 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-02-28 12:23:27 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
build log (905.59 KB, text/plain)
2013-02-14 17:13 UTC, Karsten Hopp
no flags Details
root log (83.49 KB, text/plain)
2013-02-14 17:13 UTC, Karsten Hopp
no flags Details

Description Karsten Hopp 2013-02-14 17:13:06 UTC
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.

Comment 1 Karsten Hopp 2013-02-14 17:13:41 UTC
Created attachment 697287 [details]
root log

Comment 2 Jakub Jelinek 2013-02-14 19:25:06 UTC
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).

Comment 3 Carlos O'Donell 2013-02-14 20:29:41 UTC
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?

Comment 4 Carlos O'Donell 2013-02-14 21:03:06 UTC
Raised with upstream to discuss acceptable solution:
http://sourceware.org/ml/libc-alpha/2013-02/msg00299.html

Comment 5 Brent Baude 2013-02-26 16:27:10 UTC
Hi Carlos, I believe Steve Munroe responded directly to you after your upstream post.  Thoughts?

Comment 6 Carlos O'Donell 2013-02-26 16:51:39 UTC
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.

Comment 7 Carlos O'Donell 2013-02-27 19:28:20 UTC
Patch done. Tested, and verified. Posting upstream.

Comment 8 Carlos O'Donell 2013-02-27 20:19:35 UTC
Found a an issues relating to old compilers, adding some checks.

Comment 9 Carlos O'Donell 2013-02-27 23:28:42 UTC
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.

Comment 10 Carlos O'Donell 2013-02-28 01:00:34 UTC
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.

Comment 11 Carlos O'Donell 2013-02-28 12:23:27 UTC
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.


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