19981019 misfeature? aka "Exception Handling vs. Multiple Inheritance"

Henric Jungheim junghelh@pe-nelson.com
Fri Nov 6 20:09:00 GMT 1998


Shouldn't this code either catch the exception or not catch the
exception?  Cygwin32 (below) seems to catch it before going south.  
FreeBSD just aborts (further below).

BTW, this is Cygwin32 B19.1 under NT4sp4.

JUNGHELH:/src/scanTest/egcs>g++ -v-O0 -oegBug5 egBug5.cpp
Reading specs from
\usr\local\lib\gcc-lib\i686-pc-cygwin32\egcs-2.92.16\specs
gcc version egcs-2.92.16 19981019 (gcc2 ss-980609 experimental)
 \usr\local\lib\gcc-lib\i686-pc-cygwin32\egcs-2.92.16\cpp.exe -lang-c++
-v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_M
INOR__=92 -Di386 -D_WIN32 -D__CYGWIN32__ -DWINNT -D_X86_=1 -D__STDC__=1
-D__stdcall=__attribute__((__stdcall__)) -D__cdecl=__attribu
te__((__cdecl__)) -D__declspec(x)=__attribute__((x)) -D__i386__ -D_WIN32
-D__CYGWIN32__ -D__WINNT__ -D_X86_=1 -D__STDC__=1 -D__stdca
ll=__attribute__((__stdcall__)) -D__cdecl=__attribute__((__cdecl__))
-D__declspec(x)=__attribute__((x)) -D__i386 -D__WINNT -Asystem(
winnt) -Acpu(i386) -Amachine(i386) -D__EXCEPTIONS -remap -Acpu(i386)
-Amachine(i386) -Di386 -D__i386 -D__i386__ -Di686 -Dpentiumpro
-D__i686 -D__i686__ -D__pentiumpro -D__pentiumpro__ egBug5.cpp
C:\TEMP\ccYbYRAC.ii
GNU CPP version egcs-2.92.16 19981019 (gcc2 ss-980609 experimental)
(80386, BSD syntax)
#include "..." search starts here:
#include <...> search starts here:

\usr\local\lib\gcc-lib\i686-pc-cygwin32\egcs-2.92.16\..\..\..\..\include\g++-2
 \usr\local\include

\usr\local\lib\gcc-lib\i686-pc-cygwin32\egcs-2.92.16\..\..\..\..\i686-pc-cygwin32\include
 \usr\local\lib\gcc-lib\i686-pc-cygwin32\egcs-2.92.16\include
 \usr\include
End of search list.
 \usr\local\lib\gcc-lib\i686-pc-cygwin32\egcs-2.92.16\cc1plus.exe
C:\TEMP\ccYbYRAC.ii -quiet -dumpbase egBug5.cc -O0 -version -o C:\
TEMP\ccFeGUsm.s
GNU C++ version egcs-2.92.16 19981019 (gcc2 ss-980609 experimental)
(i686-pc-cygwin32) compiled by GNU C version egcs-2.92.16 199810
19 (gcc2 ss-980609 experimental).
 \usr\local\i686-pc-cygwin32\bin\as.exe -o C:\TEMP\cct99U5H.o
C:\TEMP\ccFeGUsm.s
 \usr\local\lib\gcc-lib\i686-pc-cygwin32\egcs-2.92.16\collect2.exe
-oegBug5.exe \usr\local\i686-pc-cygwin32\lib\crt0.o -L\usr\local\
lib\gcc-lib\i686-pc-cygwin32\egcs-2.92.16
-L\usr\local\i686-pc-cygwin32\lib -L\usr\local\lib C:\TEMP\cct99U5H.o
-lstdc++ -lm -lgcc -
lcygwin -lkernel32 -ladvapi32 -lshell32 -lgcc
JUNGHELH:/src/scanTest/egcs>./egBug5.exe
caught C
(C:\src\scanTest\egcs\egBug5.exe 4481) Exception:
STATUS_ACCESS_VIOLATION
(C:\src\scanTest\egcs\egBug5.exe 4481) Dumping stack trace to
egBug5.exe.core
JUNGHELH:/src/scanTest/egcs>



For comparison, this is under FreeBSD 3 (note that I have an earlier
version of egcs on this box):

/tmp>eg++ -v -O0 -o egBug5 egBug5.cpp 
Reading specs from
/usr/local/lib/gcc-lib/i386-unknown-freebsdelf/egcs-2.92.07/specs
gcc version egcs-2.92.07 19980914 (gcc2 ss-980609 experimental)
 /usr/local/lib/gcc-lib/i386-unknown-freebsdelf/egcs-2.92.07/cpp
-lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus
-D__GNUC_MINOR__=92 -Di386 -Dunix -D__ELF__ -D__FreeBSD__=3 -D__i386__
-D__unix__ -D__ELF__ -D__FreeBSD__=3 -D__i386 -D__unix -Asystem(unix)
-Asystem(FreeBSD) -Acpu(i386) -Amachine(i386) -D__EXCEPTIONS -Acpu(i386)
-Amachine(i386) -Di386 -D__i386 -D__i386__ egBug5.cpp /tmp/ccL8EQeu.ii
GNU CPP version egcs-2.92.07 19980914 (gcc2 ss-980609 experimental)
(i386 FreeBSD/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/lib/gcc-lib/i386-unknown-freebsdelf/egcs-2.92.07/include/g++
 /usr/local/include
 /usr/local/i386-unknown-freebsdelf/include
 /usr/local/lib/gcc-lib/i386-unknown-freebsdelf/egcs-2.92.07/include
 /usr/include
End of search list.
 /usr/local/lib/gcc-lib/i386-unknown-freebsdelf/egcs-2.92.07/cc1plus
/tmp/ccL8EQeu.ii -quiet -dumpbase egBug5.cc -O0 -version -o
/tmp/cckMb3sS.s
GNU C++ version egcs-2.92.07 19980914 (gcc2 ss-980609 experimental)
(i386-unknown-freebsdelf) compiled by GNU C version egcs-2.92.07
19980914 (gcc2 ss-980609 experimental).
 as -V -Qy -o /tmp/ccFCkSJB.o /tmp/cckMb3sS.s
GNU assembler version 2.9.1 (i386-unknown-freebsdelf), using BFD version
2.9.1
 /usr/local/lib/gcc-lib/i386-unknown-freebsdelf/egcs-2.92.07/collect2 -m
elf_i386 -dynamic-linker /usr/libexec/ld-elf.so.1 -o egBug5
/usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o
-L/usr/local/lib/gcc-lib/i386-unknown-freebsdelf/egcs-2.92.07
-L/usr/local/i386-unknown-freebsdelf/lib -L/usr/local/lib
/tmp/ccFCkSJB.o -lstdc++ -lm -lgcc -lc -lgcc /usr/lib/crtend.o
/usr/lib/crtn.o
/tmp>./egBug5 
Abort (core dumped)
/tmp>
egBug5.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: egBug5.cpp
Type: text/x-c++
Size: 396 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/19981106/820da81f/attachment.bin>


More information about the Gcc-bugs mailing list