Bug 679513

Summary: Internal compiler error during gflags compilation
Product: [openSUSE] openSUSE 11.4 Reporter: Krzysztof Pawlik <krzysiek.pawlik>
Component: DevelopmentAssignee: Richard Biener <rguenther>
Status: RESOLVED DUPLICATE QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P5 - None CC: pth
Version: Final   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE 11.3   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: libgflags_la-gflags.i

Description Krzysztof Pawlik 2011-03-14 19:34:15 UTC
User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.133 Safari/534.16

(Side note: OS list is missing 11.4)

On fresh openSUSE 11.4 install I get ICE during compilation of Google gflags 1.5:

if /bin/sh ./libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I./src  -I./src  -pthread -DNDEBUG -O3 -march=k8 -pipe -MT libgflags_la-gflags.lo -MD -MP -MF ".deps/libgflags_la-gflags.Tpo" -c -o libgflags_la-gflags.lo `test -f 'src/gflags.cc' || echo './'`src/gflags.cc; \
then mv -f ".deps/libgflags_la-gflags.Tpo" ".deps/libgflags_la-gflags.Plo"; else rm -f ".deps/libgflags_la-gflags.Tpo"; exit 1; fi
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I. -I./src -I./src -pthread -DNDEBUG -O3 -march=k8 -pipe -MT libgflags_la-gflags.lo -MD -MP -MF .deps/libgflags_la-gflags.Tpo -c src/gflags.cc  -fPIC -DPIC -o .libs/libgflags_la-gflags.o
src/gflags.cc: In member function âbool google::<unnamed>::FlagValue::ParseFrom(const char*)â:
src/gflags.cc:1958:1: internal compiler error: Aborted

Reproducible: Always

Steps to Reproduce:
1. Download gflags 1.5
2. CXXFLAGS="-O3 -march=k8 -pipe" ./configure --enable-static --enable-shared
3. make

Alternatively: try to compile attached preprocessed source:
# g++ -O3 -march=k8 -pipe libgflags_la-gflags.i -c -o /dev/null
Actual Results:  
ICE.

Expected Results:  
Successful compilation.

# g++ --version
g++ (SUSE Linux) 4.5.1 20101208 [gcc-4_5-branch revision 167585]


Bug is present when using -On where n is >= 1, with -O0 it works - source is compiled correctly.
Comment 1 Krzysztof Pawlik 2011-03-14 19:37:42 UTC
Created attachment 419234 [details]
libgflags_la-gflags.i
Comment 2 Richard Biener 2011-03-15 09:36:01 UTC
I can't reproduce it.  GCC doesn't abort itself but instead it looks like it
might be gmp or mpfr that is aborting.  Can you capture a backtrace with gdb?
Append -v to the command-line and run the printed cc1plus command in gdb.
Comment 3 Krzysztof Pawlik 2011-03-15 16:04:05 UTC
Indeed it's gmp issue, here's gdb session output:

# gdb /usr/lib64/gcc/x86_64-suse-linux/4.5/cc1plus
GNU gdb (GDB) SUSE (7.2-3.3)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-suse-linux".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/lib64/gcc/x86_64-suse-linux/4.5/cc1plus...Reading symbols from /usr/lib/debug/usr/lib64/gcc/x86_64-suse-linux/4.5/cc1plus.debug...done.
done.
(gdb) run -fpreprocessed libgflags_la-gflags.i -quiet -dumpbase libgflags_la-gflags.i -march=k8 -auxbase libgflags_la-gflags -O3 -version -o /dev/null
Starting program: /usr/lib64/gcc/x86_64-suse-linux/4.5/cc1plus -fpreprocessed libgflags_la-gflags.i -quiet -dumpbase libgflags_la-gflags.i -march=k8 -auxbase libgflags_la-gflags -O3 -version -o /dev/null
GNU C++ (SUSE Linux) version 4.5.1 20101208 [gcc-4_5-branch revision 167585] (x86_64-suse-linux)
        compiled by GNU C version 4.5.1 20101208 [gcc-4_5-branch revision 167585], GMP version 5.0.1, MPFR version 3.0.0-p3, MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=63 --param ggc-min-heapsize=62922
GNU C++ (SUSE Linux) version 4.5.1 20101208 [gcc-4_5-branch revision 167585] (x86_64-suse-linux)
        compiled by GNU C version 4.5.1 20101208 [gcc-4_5-branch revision 167585], GMP version 5.0.1, MPFR version 3.0.0-p3, MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=63 --param ggc-min-heapsize=62922
Compiler executable checksum: b686b522c23d63d939a69260954dc74f

Program received signal SIGABRT, Aborted.
0x00007ffff61feab5 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64        return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
(gdb) bt
#0  0x00007ffff61feab5 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00007ffff61fffb6 in abort () at abort.c:92
#2  0x00007ffff69928d5 in __gmpn_cpuvec_init () at fat.c:140
#3  0x00007ffff6992ade in ?? () at tmp-fat_entry.s:314 from /usr/lib64/libgmp.so.10
#4  0x0000000000000000 in ?? ()
(gdb) up
#1  0x00007ffff61fffb6 in abort () at abort.c:92
92            raise (SIGABRT);
(gdb) up
#2  0x00007ffff69928d5 in __gmpn_cpuvec_init () at fat.c:140
140                   abort ();
(gdb) list
135             {
136               switch (family)
137                 {
138                 case 5:
139                 case 6:
140                   abort ();
141                   break;
142                 case 15:
143                   /* CPUVEC_SETUP_athlon */
144                   break;
(gdb) q


Can this be related to the fact that this system is running as virtual machine under KVM?
Comment 4 Richard Biener 2011-03-15 16:31:33 UTC
Yes.

*** This bug has been marked as a duplicate of bug 663675 ***