[Bug libstdc++/19567] New: dynamic_cast failure in dlopen-ed shared object
Please note this is not a duplicate of #4993, because I am using RTLD_GLOBAL and -Wl,-E. This test project demonstatrates a problem when using dynamic_cast from inside a shared object to attempt to convert a base class (interface) to a derived class (another interface) whose definitions are in header files shared between the application and the shared object. When casting from a base class to the derived class from inside the main executable, dynamic_cast works as expected and returns a non null pointer. However, from inside of the dlopen-ed shared library, the dynamic_cast function incorrectly returns zero. Attachment will follow. -- Summary: dynamic_cast failure in dlopen-ed shared object Product: gcc Version: 3.4.2 Status: UNCONFIRMED Severity: normal Priority: P2 Component: libstdc++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: daveregs at rsaisp dot com CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19567
[Bug libstdc++/19567] dynamic_cast failure in dlopen-ed shared object
--- Additional Comments From daveregs at rsaisp dot com 2005-01-21 17:29 --- Created an attachment (id=8032) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8032&action=view) Example program that demonstrates the bug -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19567
[Bug libstdc++/19567] dynamic_cast failure in dlopen-ed shared object
--- Additional Comments From daveregs at rsaisp dot com 2005-01-21 17:30 --- Tested on fedora core 2 and 3, results are the same. more info: fc2: gcc version 3.3.3 20040412 Works on windows 3.4.2 (mingw-special) most likely because of the lack of support for weak symbols. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19567
[Bug libstdc++/19567] dynamic_cast failure in dlopen-ed shared object
--- Additional Comments From daveregs at rsaisp dot com 2005-01-28 15:10 --- Hi Chris, I beleive that this problem may be related to the typeinfo header or other related headers that are involved with RTTI. I have also refered to an older bug that involved this same problem which was posted under libstdc++ and appeared to have been resolved in this category: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4292 However, I could be wrong, so if you are positive I have this in the wrong category I will move it. Thank you, - Dave -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19567
[Bug c++/19567] dynamic_cast failure in dlopen-ed shared object
--- Additional Comments From daveregs at rsaisp dot com 2005-02-02 03:28 --- This is becoming a real showstopper for me, so I am changing the component to C++ in the hopes that it is a closer match and this bug will be looked at. -- What|Removed |Added Component|libstdc++ |c++ http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19567