We're seeing the behavior below in 64-bit statically linked programs on
PowerPC/Linux (this has the same effect: gcc -m64 t.cpp -lsupc++). Here's
the stack trace, if it helps at all:

#0  0x00000000100010e8 in .__cxa_get_globals_fast ()
#1  0x0000000010000d60 in .__cxa_end_catch ()
#2  0x0000000010000a98 in main () at t.cpp:10

$ cat t.cpp && gcc --version && g++ -m64 t.cpp -static && ./a.out 
void foo () { throw 0; }

int main ()
{
    try {
        try {
            foo ();
        }
        catch (...) {
            throw;
        }
    }
    catch (...) {
        return 0;
    }

    return 1;
} 
$ cat t.cpp && gcc --version && g++ -m64 t.cpp -static && ./a.out 
void foo () { throw 0; }

int main ()
{
    try {
        try {
            foo ();
        }
        catch (...) {
            throw;
        }
    }
    catch (...) {
        return 0;
    }

    return 1;
} 

gcc (GCC) 3.3.3 (SuSE Linux)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Segmentation fault

gcc (GCC) 3.3.3 (SuSE Linux)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Segmentation fault


-- 
           Summary: SIGSEGV rethrowing an exception with -m64 -static on
                    ppc/linux
           Product: gcc
           Version: 3.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sebor at roguewave dot com
 GCC build triplet: powerpc-suse-linux
  GCC host triplet: powerpc-suse-linux
GCC target triplet: powerpc-suse-linux


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

Reply via email to