https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63726
Bug ID: 63726 Summary: -Xlinker --threads cause random crash on gcc 4.9.2 Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: driver Assignee: unassigned at gcc dot gnu.org Reporter: dushistov at mail dot ru With such simple program: $ cat /tmp/test2.cpp #include <cstdio> #include <vector> int main() { std::vector<int> v = {1, 2}; for (auto a : v) printf("%d\n", a); return 0; } I get: for i in `seq 1 10`; do g++ -std=c++11 -fuse-ld=gold -Xlinker --threads test2.cpp; done collect2: error: ld terminated with signal 11 [Segmentation fault] *** Error in `/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/../../../../x86_64-pc-linux-gnu/bin/ld.gold': double free or corruption (fasttop): 0x00007fa66c000d10 *** collect2: error: ld terminated with signal 11 [Segmentation fault] /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/../../../../x86_64-pc-linux-gnu/bin/ld.gold: fatal error: /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/crtend.o: file too short collect2: error: ld returned 1 exit status collect2: error: ld terminated with signal 11 [Segmentation fault] collect2: error: ld terminated with signal 11 [Segmentation fault] *** Error in `/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/../../../../x86_64-pc-linux-gnu/bin/ld.gold': double free or corruption (fasttop): 0x0000000000a50df0 *** out of memory allocating 47278999994368 bytes after a total of 18446604027574911016 bytes collect2: error: ld returned 1 exit status collect2: error: ld terminated with signal 11 [Segmentation fault] While with gcc 4.8.3 all works fine: $ for i in `seq 1 10`; do g++ -std=c++11 -fuse-ld=gold -Xlinker --threads test2.cpp; done $