This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/4235: Exception handling on AIX 4.2 does not catch
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/4235: Exception handling on AIX 4.2 does not catch
- From: thomas dot nilsson at streamserve dot com
- Date: 5 Sep 2001 09:12:30 -0000
- Cc: torbjorn dot gaard at streamserve dot com
- Reply-To: thomas dot nilsson at streamserve dot com
>Number: 4235
>Category: c++
>Synopsis: Exception handling on AIX 4.2 does not catch
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Sep 05 02:16:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Thomas Nilsson
>Release: gcc version 3.0.1
>Organization:
>Environment:
powerpc-ibm-aix4.2.0.0
>Description:
It is not possible to catch an exception in the AIX environment.
When cxa_throw() is invoked abort() will be called as if there are no catch handlers.
If looking closer to the libgcc source you will notice that there are two calls to __register_frame_info_table_bases() in unwind-dw2-fde.c using different instances of the object_mutex declared statically in this file.
The first __register_frame_info_table_bases() is called from the file generated by collect2 and contains the correct frame information. I can't find the origin of the second call to __register_frame_info_table_bases().
Anyway the calls above register the frame information in different instances of unseen_objects.
When cxa_throw() is called only the latter frame information in unseen_object is used. The first registration is never used, and therefore no handler is found.
===
Reading specs from /usr/local/lib/gcc-lib/powerpc-ibm-aix4.2.0.0/3.0.1/specs
Configured with: ../gcc-3.0.1/configure --prefix=/usr/local --with-gnu-as --with-as=/usr/local/bin/as --enable-threads=aix --enable-shared
Thread model: aix
gcc version 3.0.1
/usr/local/lib/gcc-lib/powerpc-ibm-aix4.2.0.0/3.0.1/cpp0 -lang-c++ -D__GNUG__=3 -D__GXX_DEPRECATED -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 -v -D__GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=1 -D_IBMR2 -D_POWER -D_AIX -D_AIX32 -D_AIX41 -D_LONG_LONG -D_IBMR2 -D_POWER -D_AIX -D_AIX32 -D_AIX41 -D_LONG_LONG -Asystem=unix -Asystem=aix -D__CHAR_UNSIGNED__ -D__NO_INLINE__ -D__STDC_HOSTED__=1 -D_ARCH_COM simple.cpp simple.ii
GNU CPP version 3.0.1 (cpplib)
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include/g++-v3
/usr/local/include/g++-v3/powerpc-ibm-aix4.2.0.0
/usr/local/include/g++-v3/backward
/usr/local/include
/usr/local/lib/gcc-lib/powerpc-ibm-aix4.2.0.0/3.0.1/include
/usr/local/powerpc-ibm-aix4.2.0.0/include
/usr/include
End of search list.
/usr/local/lib/gcc-lib/powerpc-ibm-aix4.2.0.0/3.0.1/cc1plus -fpreprocessed simple.ii -quiet -dumpbase simple.cpp -version -o simple.s
GNU CPP version 3.0.1 (cpplib)
GNU C++ version 3.0.1 (powerpc-ibm-aix4.2.0.0)
compiled by GNU C version 2.95.3 20010315 (release).
/usr/local/bin/as --traditional-format -u -mcom -o simple.o simple.s
/usr/local/lib/gcc-lib/powerpc-ibm-aix4.2.0.0/3.0.1/collect2 -bpT:0x10000000 -bpD:0x20000000 -btextro -bnodelcsect /lib/crt0.o -L/usr/local/lib/gcc-lib/powerpc-ibm-aix4.2.0.0/3.0.1 -L/usr/local/lib/gcc-lib/powerpc-ibm-aix4.2.0.0/3.0.1/../../.. -lstdc++ simple.o /usr/local/lib/gcc-lib/powerpc-ibm-aix4.2.0.0/3.0.1/libgcc.a -lc /usr/local/lib/gcc-lib/powerpc-ibm-aix4.2.0.0/3.0.1/libgcc.a
It aborts also when --enable-shared is not specified with configure.
>How-To-Repeat:
int main(int argc, char **argv)
{
int x = 0;
try {
throw new int;
x = 1;
} catch (int *) {
x = 2;
}
return x;
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: