https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66212

            Bug ID: 66212
           Summary: Exception handling broken on powerpc
           Product: gcc
           Version: 5.1.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: libgcc
          Assignee: unassigned at gcc dot gnu.org
          Reporter: andri.yngvason at marel dot com
  Target Milestone: ---

All exceptions cause the running process to be aborted.

The following program is aborted when trying to unwind the stack:
#include <exception>
#include <stdexcept>
#include <iostream>

using std::cout;
using std::endl;

void foobar()
{
    cout << "..." << endl;
    throw std::runtime_error("Whoohoo");
    cout << "Wtf?" << endl;
}

int main(int, char**)
{
    cout << "Throwing standard exception..." << endl;

    try {
        foobar();
    } catch(std::exception& e) {
        cout << "Caught: " << e.what() << endl;
    }

    cout << "Done!" << endl;

    return 0;
}

Backtrace:
#0  0x0fbff76c in raise () from /lib/libc.so.6
#1  0x0fc010cc in abort () from /lib/libc.so.6
#2  0x0fd5fc1c in uw_init_context_1 () from /lib/glibc2.21/libgcc_s.so.1
#3  0x0fd60408 in _Unwind_RaiseException () from /lib/glibc2.21/libgcc_s.so.1
#4  0x0fed10ac in __cxa_throw () at
../../../../gcc-5.1.0/libstdc++-v3/libsupc++/eh_throw.cc:82
#5  0x10000c28 in foobar() ()
#6  0x10000cac in main ()

$ powerpc-marel-linux-gnu-g++ -v 
Using built-in specs.
COLLECT_GCC=powerpc-marel-linux-gnu-g++
COLLECT_LTO_WRAPPER=/opt/plutotoolchain/libexec/gcc/powerpc-marel-linux-gnu/5.1.0/lto-wrapper
Target: powerpc-marel-linux-gnu
Configured with: ../gcc-5.1.0/configure --prefix=/opt/plutotoolchain
--target=powerpc-marel-linux-gnu --enable-languages=c,c++
--enable-threads=posix --enable-shared --disable-multilib --enable-__cxa_atexit
--disable-sjlj-exceptions --disable-nls --enable-symvers=gnu --enable-c99
--enable-long-long --enable-profile --with-tune=e300c3 --disable-altivec
Thread model: posix
gcc version 5.1.0 (GCC) 

I tried to compile libgcc with debug symbols so that I could see which
assertion fails, but my attempts had no effect. I'd be happy to learn how to
get those debug symbols in there.

Reply via email to