public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/19567] New: dynamic_cast failure in dlopen-ed shared object
@ 2005-01-21 17:24 daveregs at rsaisp dot com
  2005-01-21 17:31 ` [Bug libstdc++/19567] " daveregs at rsaisp dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: daveregs at rsaisp dot com @ 2005-01-21 17:24 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/19567] dynamic_cast failure in dlopen-ed shared object
  2005-01-21 17:24 [Bug libstdc++/19567] New: dynamic_cast failure in dlopen-ed shared object daveregs at rsaisp dot com
@ 2005-01-21 17:31 ` daveregs at rsaisp dot com
  2005-01-21 17:33 ` daveregs at rsaisp dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: daveregs at rsaisp dot com @ 2005-01-21 17:31 UTC (permalink / raw)
  To: gcc-bugs


------- 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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/19567] dynamic_cast failure in dlopen-ed shared object
  2005-01-21 17:24 [Bug libstdc++/19567] New: dynamic_cast failure in dlopen-ed shared object daveregs at rsaisp dot com
  2005-01-21 17:31 ` [Bug libstdc++/19567] " daveregs at rsaisp dot com
@ 2005-01-21 17:33 ` daveregs at rsaisp dot com
  2005-01-28 14:54 ` chris at bubblescope dot net
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: daveregs at rsaisp dot com @ 2005-01-21 17:33 UTC (permalink / raw)
  To: gcc-bugs


------- 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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/19567] dynamic_cast failure in dlopen-ed shared object
  2005-01-21 17:24 [Bug libstdc++/19567] New: dynamic_cast failure in dlopen-ed shared object daveregs at rsaisp dot com
  2005-01-21 17:31 ` [Bug libstdc++/19567] " daveregs at rsaisp dot com
  2005-01-21 17:33 ` daveregs at rsaisp dot com
@ 2005-01-28 14:54 ` chris at bubblescope dot net
  2005-01-28 15:10 ` daveregs at rsaisp dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: chris at bubblescope dot net @ 2005-01-28 14:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From chris at bubblescope dot net  2005-01-28 14:53 -------
I don't think this bug has anything to do with libstdc++ (which over covers
errors in the c++ standard library). I would suggest changing the Component to
c++, which I suspect a closer match for where the bug lives (although I'm not
certain I will admit).

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19567


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/19567] dynamic_cast failure in dlopen-ed shared object
  2005-01-21 17:24 [Bug libstdc++/19567] New: dynamic_cast failure in dlopen-ed shared object daveregs at rsaisp dot com
                   ` (2 preceding siblings ...)
  2005-01-28 14:54 ` chris at bubblescope dot net
@ 2005-01-28 15:10 ` daveregs at rsaisp dot com
  2005-02-02  3:28 ` [Bug c++/19567] " daveregs at rsaisp dot com
  2005-02-02  3:52 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: daveregs at rsaisp dot com @ 2005-01-28 15:10 UTC (permalink / raw)
  To: gcc-bugs


------- 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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/19567] dynamic_cast failure in dlopen-ed shared object
  2005-01-21 17:24 [Bug libstdc++/19567] New: dynamic_cast failure in dlopen-ed shared object daveregs at rsaisp dot com
                   ` (3 preceding siblings ...)
  2005-01-28 15:10 ` daveregs at rsaisp dot com
@ 2005-02-02  3:28 ` daveregs at rsaisp dot com
  2005-02-02  3:52 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: daveregs at rsaisp dot com @ 2005-02-02  3:28 UTC (permalink / raw)
  To: gcc-bugs


------- 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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/19567] dynamic_cast failure in dlopen-ed shared object
  2005-01-21 17:24 [Bug libstdc++/19567] New: dynamic_cast failure in dlopen-ed shared object daveregs at rsaisp dot com
                   ` (4 preceding siblings ...)
  2005-02-02  3:28 ` [Bug c++/19567] " daveregs at rsaisp dot com
@ 2005-02-02  3:52 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-02  3:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-02-02 03:52 -------
You messed up you used -W1, not -Wl which is different.

you need to use l as in the lowercase L.
I changed the Makefile to use -Wl,-E and it worked.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19567


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-02-02  3:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-21 17:24 [Bug libstdc++/19567] New: dynamic_cast failure in dlopen-ed shared object daveregs at rsaisp dot com
2005-01-21 17:31 ` [Bug libstdc++/19567] " daveregs at rsaisp dot com
2005-01-21 17:33 ` daveregs at rsaisp dot com
2005-01-28 14:54 ` chris at bubblescope dot net
2005-01-28 15:10 ` daveregs at rsaisp dot com
2005-02-02  3:28 ` [Bug c++/19567] " daveregs at rsaisp dot com
2005-02-02  3:52 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).