Unfortunately I can't post the source code for this, but I will try to set it up as best I can.
I have a case where dynamic_cast fails to cast to a derived class type, and I know it should succeed (ie, I know the actual type of the instance). Also typeid for a heap allocated object doesn't equal the typeid for a stack allocated object!! IE,
Foo mstack;
Foo*mheap = new Foo();
typeid(mstack) == typeid(*mheap); // returns FALSE!?
So there is clearly a RTTI problem somewhere. The class implementation (for both base and derived classes) is in one shared library, the malfunctioning code is in a second shared library which is loaded as a Python module in the Python interpreter (all on linux, same problem when using either gcc 4 or Intel C++ compiler). If I write a simple little test executable that links both shared libraries, everything works fine. I've tried --export-dynamic when linking the shared libraries without success (looks like it's intended for use with executables). Anybody have any pointers for where to look? Is there something particular about the way Python uses dlopen() that causes this kind of problem?