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++/13887] New: Throw in shared library causes core


This is most likely related to 13878, but I cannot add a comment (trying to
change from c++ to c++...).

Throwing any exception in a shared library causes a core. It appears that g++ is
not finding the proper handler, allowing the exception to rise out of main and
terminate() is being called.

Simple test case follows.

> g++ -v
Reading specs from
/usr/local/gcc/bin/../lib/gcc-lib/powerpc-ibm-aix5.1.0.0/3.3.2/specs
Configured with: ../gcc-3.3.2/configure --disable-nls --prefix=/usr/local/gcc-3.3.2
Thread model: aix
gcc version 3.3.2

> uname -a
AIX devcom 1 5 000DBC1D4C00 unknown

commands:
> g++ -c tstlib.cpp
> g++ -shared -o tstlib.so tstlib.o
> g++ tstthrow.cpp $PWD/tstlib.so -o tstthrow
> ./tstthrow
IOT/Abort trap (core dumped)

tstlib.ii:
# 1 "tstlib.cpp"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "tstlib.cpp"
void tstthrow()
{
    try
    {
        throw 1;
    }
    catch (...)
    {
    }

    return;
}

tstthrow.ii:
# 1 "tstthrow.cpp"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "tstthrow.cpp"
extern void tstthrow();

int main()
{
    tstthrow();
    return 0;
}

-- 
           Summary: Throw in shared library causes core
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tsorensen at dtrac dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: powerpc-ibm-aix5.1.0.0
  GCC host triplet: powerpc-ibm-aix5.1.0.0
GCC target triplet: powerpc-ibm-aix5.1.0.0


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


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