This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/51460] New: [4.6 regression] Struct with two boost mutexes allocated on the heap inside of a while loop causes compiler segfault


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51460

             Bug #: 51460
           Summary: [4.6 regression] Struct with two boost mutexes
                    allocated on the heap inside of a while loop causes
                    compiler segfault
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: fsaresh@ucdavis.edu


Hello,

This is my first gcc bug report so I apologize if this is in the wrong place. I
tried searching for previously reported bugs, but couldn't find anything that
was similar to my bug report.

gcc segfaults while trying to compile the following program:

#include <boost/thread/mutex.hpp>

struct foo {
    boost::mutex bar;
    boost::mutex baz;
};

int main() {
    while(true) {
        foo* f = new foo;
        continue;
    }
    return 0;
}

My compile command is

$ g++ -g -O3 bug.cc /usr/lib64/libboost_thread-gcc43-mt-1_37.a

The full output of verbose gcc compile is:

[fsareshwala@fsareshwala-l /tmp]% g++ -v -save-temps -g -O3 lol.cc
/usr/lib64/libboost_thread-gcc43-mt-1_37.a              [ /tmp ]
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.6.2-5'
--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-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6
--libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc
--with-arch-32=i586 --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.2 (Debian 4.6.2-5) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-g' '-O3' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/4.6/cc1plus -E -quiet -v -imultilib .
-imultiarch x86_64-linux-gnu -D_GNU_SOURCE lol.cc -mtune=generic -march=x86-64
-g -fworking-directory -O3 -fpch-preprocess -o lol.ii
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/4.6
 /usr/include/c++/4.6/x86_64-linux-gnu/.
 /usr/include/c++/4.6/backward
 /usr/lib/gcc/x86_64-linux-gnu/4.6/include
 /usr/local/include
 /usr/lib/gcc/x86_64-linux-gnu/4.6/include-fixed
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-g' '-O3' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/4.6/cc1plus -fpreprocessed lol.ii -quiet
-dumpbase lol.cc -mtune=generic -march=x86-64 -auxbase lol -g -O3 -version -o
lol.s
GNU C++ (Debian 4.6.2-5) version 4.6.2 (x86_64-linux-gnu)
        compiled by GNU C version 4.6.2, GMP version 5.0.2, MPFR version
3.1.0-p3, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++ (Debian 4.6.2-5) version 4.6.2 (x86_64-linux-gnu)
        compiled by GNU C version 4.6.2, GMP version 5.0.2, MPFR version
3.1.0-p3, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 16d7c73e7d9f05ccb8ae4d28e530e18c
g++: internal compiler error: Segmentation fault (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions.

Please let me know if I have forgotten anything you need.

Thank you,
Faraaz Sareshwala


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]