bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gold/16417] New: executable linked with gold segfaults before main


From: i.zaufi at gmail dot com
Subject: [Bug gold/16417] New: executable linked with gold segfaults before main
Date: Thu, 09 Jan 2014 05:40:50 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=16417



            Bug ID: 16417

           Summary: executable linked with gold segfaults before main

           Product: binutils

           Version: 2.24

            Status: NEW

          Severity: critical

          Priority: P2

         Component: gold

          Assignee: ian at airs dot com

          Reporter: i.zaufi at gmail dot com

                CC: ccoutant at google dot com



Created attachment 7342

  --> https://sourceware.org/bugzilla/attachment.cgi?id=7342&action=edit

output of `cave info`



I'm using gentoo w/ my custom compilation flags. I've found that simple pro
gram

being compiled and linked w/ gold segfaults w/ the following backtrace:



Program received signal SIGSEGV, Segmentation fault.

0x0000000000000000 in ?? ()

(gdb) bt

#0  0x0000000000000000 in ?? ()

#1  0x00007ffff7f2a1e1 in __gthread_once (__func=0x7ffff7f2a180

<std::locale::_S_initialize_once()>, __once=<optimized out>)

    at

/storage/tmp/paludis/sys-devel-gcc-4.8.2/work/build/x86_64-pc-linux-gnu/lib
stdc++-v3/include/x86_64-pc-linux-gnu/bits/gthr-default.h:699

#2  std::locale::_S_initialize () at

/storage/tmp/paludis/sys-devel-gcc-4.8.2/work/gcc-4.8.2/libstdc++-v3/src/c+
+98/locale_init.cc:276

#3  0x00007ffff7f2a223 in std::locale::locale (this=0x7ffff7fbffb8

<__gnu_internal::buf_cout_sync+56>)

    at

/storage/tmp/paludis/sys-devel-gcc-4.8.2/work/gcc-4.8.2/libstdc++-v3/src/c+
+98/locale_init.cc:210

#4  0x00007ffff7f2710c in basic_streambuf (this=<optimized out>)

    at

/storage/tmp/paludis/sys-devel-gcc-4.8.2/work/build/x86_64-pc-linux-gnu/lib
stdc++-v3/include/streambuf:466

#5  stdio_sync_filebuf (__f=0x7ffff7dd62a0 <_IO_2_1_stdout_>, this=<opt
imized

out>)

    at

/storage/tmp/paludis/sys-devel-gcc-4.8.2/work/build/x86_64-pc-linux-gnu/lib
stdc++-v3/include/ext/stdio_sync_filebuf.h:77

#6  std::ios_base::Init::Init (this=<optimized out>) at

/storage/tmp/paludis/sys-devel-gcc-4.8.2/work/gcc-4.8.2/libstdc++-v3/src/c+
+98/ios_init.cc:85

#7  0x0000000000400dce in __static_initialization_and_destruction_0

(__initialize_p=1, __priority=65535)

    at /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/include/g++-v4/iostream:74

#8  _GLOBAL__sub_I_main () at print_exports.cc:33

#9  0x0000000000400f2d in __libc_csu_init (address@hidden,

address@hidden, envp=0x7fffffffcca8) at elf-init.c:83

#10 0x00007ffff7a55905 in __libc_start_main (main=0x400be0 <main()>, argc
=1,

ubp_av=0x7fffffffcc98, init=0x400ee0 <__libc_csu_init>,

    fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff
ffffcc88)

at libc-start.c:217

#11 0x0000000000400e11 in _start () at ../sysdeps/x86_64/start.S:123



the source code is:



#include <string>

#include <iostream>



extern char ** environ;



int

main()

{

    for (char ** it = environ; nullptr != *it; ++it)

    {

        std::string str(*it);

        std::cout << "export " << str.substr(0, str.find('=')) << std::en
dl;

    }

}



compile commands:



x86_64-pc-linux-gnu-g++ -pthread -std=gnu++0x -pedantic -ggdb -O2 -pipe

-march=native -minline-stringops-dynamically -mtls-dialect=gnu2 -floop-
block

-floop-interchange -ftree-loop-distribution -floop-strip-mine -ftree-vector
ize

-fmerge-all-constants -fira-loop-pressure -pedantic -c -o print_exports.o

print_exports.cc



x86_64-pc-linux-gnu-g++ -pthread -std=gnu++0x -pedantic -ggdb -O2 -pipe

-march=native -minline-stringops-dynamically -mtls-dialect=gnu2 -floop-
block

-floop-interchange -ftree-loop-distribution -floop-strip-mine -ftree-vector
ize

-fmerge-all-constants -fira-loop-pressure -pedantic -Wl,-O1 -Wl,--sort-comm
on

-Wl,--enable-new-dtags -Wl,--gc-sections -Wl,--hash-style=gnu -o print_ex
ports

print_exports.o  -Wl,--as-needed -pthread -Wl,-fuse-ld=gold



GCC info:



/home/zaufi‚Ć™ g++ -v

Using built-in specs.

COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.2/g++

COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.8.2/lto-wrapper

Target: x86_64-pc-linux-gnu

Configured with:

/storage/tmp/paludis/sys-devel-gcc-4.8.2/work/gcc-4.8.2/configure

--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr

--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.2

--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/include

--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.2

--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.2/man

--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.2/info

--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/include/g++
-v4

--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.8.2/python

--enable-languages=c,c++ --enable-obsolete --enable-secureplt --disable-w
error

--with-system-zlib --disable-nls --enable-checking=release

--with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.8.2 
p1.2,

pie-0.5.8' --enable-libstdcxx-time --enable-shared --enable-threads=posix

--enable-__cxa_atexit --enable-clocale=gnu --enable-multilib

--with-multilib-list=m32,m64 --disable-altivec --disable-fixed-point

--enable-targets=all --disable-libgcj --enable-libgomp --enable-libmudflap

--disable-libssp --disable-libquadmath --enable-lto --with-cloog

--disable-isl-version-check

Thread model: posix

gcc version 4.8.2 (Gentoo 4.8.2 p1.2, pie-0.5.8)



-- 

You are receiving this mail because:

You are on the CC list for the bug.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]