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

            Bug ID: 60612
           Summary: Throwing exception, catching and rethrowing
                    (std::exception_ptr) in destructor leads to segfault
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tasptz at gmail dot com

Created attachment 32420
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32420&action=edit
Test source file

See attached sample.
Compiled with gcc 4.7 (g++-4.7 (Ubuntu/Linaro 4.7.3-2ubuntu1~12.04) 4.7.3) the
program runs and exits normally. Compiled with gcc 4.8 a segfault occurs.

#0  0x0000000000000000 in ?? ()
#1  0x00007ffff7b34c76 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#2  0x00007ffff7b33d39 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007ffff7b348ea in __gxx_personality_v0 () from
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007ffff75d3803 in ?? () from /lib/x86_64-linux-gnu/libgcc_s.so.1
#5  0x00007ffff75d3b9b in _Unwind_RaiseException () from
/lib/x86_64-linux-gnu/libgcc_s.so.1
#6  0x00007ffff7b34c5a in
std::rethrow_exception(std::__exception_ptr::exception_ptr) () from
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
#7  0x0000000000400cb1 in A::~A() ()
#8  0x0000000000400bc4 in main ()

version:
g++ (GCC) 4.8.2

system:
Linux gpustation 3.5.0-21-generic #32~precise1-Ubuntu SMP Thu Dec 13 20:26:47
UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

gcc configure:
--enable-languages=c,c++

example compilation:
g++ -std=c++11 -o main main.cpp

Reply via email to