[Bug 690194] Re: /usr/lib/gcc/x86_64-linux-gnu/4.5/lto1 crashes with segmentation fault when both -fopenmp and -flto are used

Vladimir Kolesnikov vladimir at free-sevastopol.com
Fri Jul 15 12:32:54 UTC 2011


With gcc-4.6 I see a different bug.

When compiling without -flto, ie

gcc test.c -o test -O1 -fopenmp -std=c99

everything is fine.

With -flto:

$ gcc test.c -o test -O1 -fopenmp -flto -std=c99
/tmp/cckxIhdE.ltrans0.ltrans.o: In function `main._omp_fn.0.2060.2020':
cckxIhdE.ltrans0.o:(.text+0x2): undefined reference to `omp_get_num_threads'
cckxIhdE.ltrans0.o:(.text+0x9): undefined reference to `omp_get_thread_num'
/tmp/cckxIhdE.ltrans0.ltrans.o: In function `main':
cckxIhdE.ltrans0.o:(.text+0x87): undefined reference to `GOMP_parallel_start'
cckxIhdE.ltrans0.o:(.text+0x8c): undefined reference to `GOMP_parallel_end'
collect2: ld returned 1 exit status

$ gcc test.c -o test -O1 -fopenmp -flto -std=c99 -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.1-4ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-multiarch --with-multiarch-defaults=x86_64-linux-gnu --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib/x86_64-linux-gnu --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib/x86_64-linux-gnu --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-4ubuntu1) 
COLLECT_GCC_OPTIONS='-o' 'test' '-O1' '-fopenmp' '-flto' '-std=c99' '-v' '-mtune=generic' '-march=x86-64' '-pthread'
 /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/cc1 -quiet -v -D_REENTRANT test.c -quiet -dumpbase test.c -mtune=generic -march=x86-64 -auxbase test -O1 -std=c99 -version -fopenmp -flto -fstack-protector -o /tmp/ccjn2A1G.s
GNU C (Ubuntu/Linaro 4.6.1-4ubuntu1) version 4.6.1 (x86_64-linux-gnu)
        compiled by GNU C version 4.6.1, GMP version 5.0.1, MPFR version 3.0.1-p3, MPC version 0.9
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/../../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/include
 /usr/local/include
 /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/include-fixed
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
GNU C (Ubuntu/Linaro 4.6.1-4ubuntu1) version 4.6.1 (x86_64-linux-gnu)
        compiled by GNU C version 4.6.1, GMP version 5.0.1, MPFR version 3.0.1-p3, MPC version 0.9
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: f4dac7f0dc853914603e09c85c5ce51e
COLLECT_GCC_OPTIONS='-o' 'test' '-O1' '-fopenmp' '-flto' '-std=c99' '-v' '-mtune=generic' '-march=x86-64' '-pthread'
 as --64 -o /tmp/ccLtmwIC.o /tmp/ccjn2A1G.s
COMPILER_PATH=/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/../../../:/lib/:/usr/lib/:/usr/lib/x86_64-linux-gnu/
Reading specs from /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/libgomp.spec
COLLECT_GCC_OPTIONS='-o' 'test' '-O1' '-fopenmp' '-flto' '-std=c99' '-v' '-mtune=generic' '-march=x86-64' '-pthread'
 /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/collect2 -plugin /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/liblto_plugin.so -plugin-opt=/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/lto-wrapper -plugin-opt=-fresolution=/tmp/ccLuLary.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -flto --build-id --no-add-needed --as-needed --eh-frame-hdr -m elf_x86_64 --hash-style=gnu -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o test /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/../../../crt1.o /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/../../../crti.o /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/crtbegin.o -L/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1 -L/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/../../.. -L/usr/lib/x86_64-linux-gnu /tmp/ccLtmwIC.o -lgomp -lgcc --as-needed -lgcc_s --no-as-needed -lpthread -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/crtend.o /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/../../../crtn.o
 gcc @/tmp/ccoBOoSF.args
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.1-4ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-multiarch --with-multiarch-defaults=x86_64-linux-gnu --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib/x86_64-linux-gnu --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib/x86_64-linux-gnu --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-4ubuntu1) 
COLLECT_GCC_OPTIONS='-c' '-O1' '-fopenmp' '-std=c99' '-v' '-mtune=generic' '-march=x86-64' '-pthread' '-dumpdir' './' '-dumpbase' 'test.wpa' '-fltrans-output-list=/tmp/ccqnqk6J.ltrans.out' '-fwpa' '-fresolution=/tmp/ccLuLary.res' '-pthread'
 /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/lto1 -quiet -dumpdir ./ -dumpbase test.wpa -mtune=generic -march=x86-64 -auxbase ccLtmwIC -O1 -std=c99 -version -fopenmp -fltrans-output-list=/tmp/ccqnqk6J.ltrans.out -fwpa -fresolution=/tmp/ccLuLary.res @/tmp/ccOuUCCK
GNU GIMPLE (Ubuntu/Linaro 4.6.1-4ubuntu1) version 4.6.1 (x86_64-linux-gnu)
        compiled by GNU C version 4.6.1, GMP version 5.0.1, MPFR version 3.0.1-p3, MPC version 0.9
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU GIMPLE (Ubuntu/Linaro 4.6.1-4ubuntu1) version 4.6.1 (x86_64-linux-gnu)
        compiled by GNU C version 4.6.1, GMP version 5.0.1, MPFR version 3.0.1-p3, MPC version 0.9
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
COMPILER_PATH=/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/../../../:/lib/:/usr/lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/../../../:/lib/:/usr/lib/:/usr/lib/x86_64-linux-gnu/
COLLECT_GCC_OPTIONS='-c' '-O1' '-fopenmp' '-std=c99' '-v' '-mtune=generic' '-march=x86-64' '-pthread' '-dumpdir' './' '-dumpbase' 'test.wpa' '-fltrans-output-list=/tmp/ccqnqk6J.ltrans.out' '-fwpa' '-fresolution=/tmp/ccLuLary.res' '-pthread'
 gcc @/tmp/ccantxtx.args
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.1-4ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-multiarch --with-multiarch-defaults=x86_64-linux-gnu --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib/x86_64-linux-gnu --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib/x86_64-linux-gnu --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-4ubuntu1) 
COLLECT_GCC_OPTIONS='-c' '-O1' '-fopenmp' '-std=c99' '-v' '-mtune=generic' '-march=x86-64' '-pthread' '-dumpdir' './' '-dumpbase' 'test.ltrans0' '-fltrans' '-o' '/tmp/ccqnqk6J.ltrans0.ltrans.o' '-pthread'
 /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/lto1 -quiet -dumpdir ./ -dumpbase test.ltrans0 -mtune=generic -march=x86-64 -auxbase-strip /tmp/ccqnqk6J.ltrans0.ltrans.o -O1 -std=c99 -version -fopenmp -fltrans @/tmp/cckb2oPN -o /tmp/cclzJJEJ.s
GNU GIMPLE (Ubuntu/Linaro 4.6.1-4ubuntu1) version 4.6.1 (x86_64-linux-gnu)
        compiled by GNU C version 4.6.1, GMP version 5.0.1, MPFR version 3.0.1-p3, MPC version 0.9
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU GIMPLE (Ubuntu/Linaro 4.6.1-4ubuntu1) version 4.6.1 (x86_64-linux-gnu)
        compiled by GNU C version 4.6.1, GMP version 5.0.1, MPFR version 3.0.1-p3, MPC version 0.9
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
COLLECT_GCC_OPTIONS='-c' '-O1' '-fopenmp' '-std=c99' '-v' '-mtune=generic' '-march=x86-64' '-pthread' '-dumpdir' './' '-dumpbase' 'test.ltrans0' '-fltrans' '-o' '/tmp/ccqnqk6J.ltrans0.ltrans.o' '-pthread'
 as --64 -o /tmp/ccqnqk6J.ltrans0.ltrans.o /tmp/cclzJJEJ.s
COMPILER_PATH=/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/../../../:/lib/:/usr/lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/../../../:/lib/:/usr/lib/:/usr/lib/x86_64-linux-gnu/
COLLECT_GCC_OPTIONS='-c' '-O1' '-fopenmp' '-std=c99' '-v' '-mtune=generic' '-march=x86-64' '-pthread' '-dumpdir' './' '-dumpbase' 'test.ltrans0' '-fltrans' '-o' '/tmp/ccqnqk6J.ltrans0.ltrans.o' '-pthread'
/tmp/ccqnqk6J.ltrans0.ltrans.o: In function `main._omp_fn.0.2060.2020':
ccqnqk6J.ltrans0.o:(.text+0x2): undefined reference to `omp_get_num_threads'
ccqnqk6J.ltrans0.o:(.text+0x9): undefined reference to `omp_get_thread_num'
/tmp/ccqnqk6J.ltrans0.ltrans.o: In function `main':
ccqnqk6J.ltrans0.o:(.text+0x87): undefined reference to `GOMP_parallel_start'
ccqnqk6J.ltrans0.o:(.text+0x8c): undefined reference to `GOMP_parallel_end'
collect2: ld returned 1 exit status

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-4.5 in Ubuntu.
https://bugs.launchpad.net/bugs/690194

Title:
  /usr/lib/gcc/x86_64-linux-gnu/4.5/lto1 crashes with segmentation fault
  when both -fopenmp and -flto are used

Status in “gcc-4.5” package in Ubuntu:
  New
Status in “gcc-4.6” package in Ubuntu:
  Incomplete

Bug description:
  Binary package hint: gcc-4.5

  $ lsb_release -rd
  Description:    Ubuntu 10.10
  Release:        10.10

  $ LC_ALL=C apt-cache policy gcc-4.5
  gcc-4.5:
    Installed: 4.5.1-7ubuntu2
    Candidate: 4.5.1-7ubuntu2
    Version table:
   *** 4.5.1-7ubuntu2 0
          500 http://ua.archive.ubuntu.com/ubuntu/ maverick/main amd64 Packages
          100 /var/lib/dpkg/status

  Test file will be attached.

  $ gcc-4.5 test.c -o test -O1 -fopenmp -flto -std=c99
  lto1: internal compiler error: Segmentation fault
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-4.5/README.Bugs> for instructions.
  lto-wrapper: /usr/bin/gcc-4.5.real returned 1 exit status
  collect2: lto-wrapper returned 1 exit status

  The bug does not happen with -O0, or when either -flto or -fopenmp is
  not used

  Despite 'ulimit -c unlimited', core file is not generated.
  --- 
  Architecture: amd64
  DistroRelease: Ubuntu 10.10
  NonfreeKernelModules: fglrx
  Package: gcc-4.5 4.5.1-7ubuntu2
  PackageArchitecture: amd64
  ProcEnviron:
   LANGUAGE=ru_RU:ru
   LANG=ru_RU.UTF-8
   SHELL=/bin/bash
  ProcVersionSignature: Ubuntu 2.6.35-23.41-server 2.6.35.7
  Tags: maverick
  Uname: Linux 2.6.35-23-server x86_64
  UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare vboxusers

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.5/+bug/690194/+subscriptions




More information about the foundations-bugs mailing list