[C++-sig] Re: Multiple typeinfos causing failure of exception catches
Niall Douglas
s_sourceforge at nedprod.com
Sat Jul 10 14:05:03 CEST 2004
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
A little more on this:
[ned at katey2 lib]$ ./TestEmbedPython
TnFOX Python test:
- -=-=-=-=-=-=-=-=-Working with Python 2.3 (#8, Jul 10 2004, 11:28:33)
[GCC 3.4.0]
If you can read this, python prints!
Typeinfo of FXException in DLL is 0x804cba0,0x41f65004
(N2FX11FXExceptionE)
Typeinfo of FXPythonException in DLL is 0x804a9d8,0x804a9e4
(N2FX17FXPythonExceptionE)
Throwing a python exception ...
Typeinfo of caught exception in DLL is 0x804a9d8,0x804a9e4
(N2FX17FXPythonExceptionE)
C++ exception caught: exceptions.IOError,A parameter to a python
exception at line 2 in <string> (code 0xFFDE)
Typeinfo of pointer to be returned from DLL is 0x804a9d8,0x804a9e4
(N2FX17FXPythonExceptionE)
Typeinfo of pointer returned from DLL is 0x804a9d8,0x804a9e4
(N2FX17FXPythonExceptionE)
Typeinfo of FXException in EXE is 0x804cba0,0x41f65004
(N2FX11FXExceptionE)
Typeinfo of FXPythonException in EXE is 0x804a9d8,0x804a9e4
(N2FX17FXPythonExceptionE)
Throwing a python exception ...
terminate called after throwing an instance of
'FX::FXPythonException'
Deleted secure heap
Unhandled Signal 0x6 (Abnormal termination)
at address 0x5979 - immediate exit!
What I've done here is copy the throw/catch code into the bindings
shared object. As we can see, the first throw/catch works fine and
the second dies with terminate(). Both sets of code are identical -
just in the second the throw is in the bindings DLL and the catch is
in the EXE.
I have it printing the address of the typeinfo, the typeinfo.name()
address and then the string. I was surprised to see that in both the
DLL and EXE all addresses are the same, so therefore typeinfo
comparison by address should be working. Therefore it would seem that
this bug is not the same as Dave's original one.
I'll investigate GCC's source code next, maybe get it printing what
the hell it's up to when it's catching exceptions. I've already
looked through the assembler output from GCC for each of the source
files and I'm fairly confident it's not that - also, a mockup of the
same DLL & EXE configuration works fine so I think it's the linker,
perhaps because it's linking 120Mb of non-debug object files with
nearly 160,000 symbols.
Cheers,
Niall
-----BEGIN PGP SIGNATURE-----
Version: idw's PGP-Frontend 4.9.6.1 / 9-2003 + PGP 8.0.2
iQA/AwUBQO/bb8EcvDLFGKbPEQLXpACgqwP/hgNoh0+eXgmDVBYpuVt4sugAniGe
CWzSIkAX1gcgqXTG0jlH4Mun
=wGDg
-----END PGP SIGNATURE-----
More information about the Cplusplus-sig
mailing list