[Bug 201784] [libcxxrt] C++ dynamic_cast does not recognize same types across dynamically loaded modules when downcasting

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Jul 23 10:40:53 UTC 2015


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=201784

            Bug ID: 201784
           Summary: [libcxxrt] C++ dynamic_cast does not recognize same
                    types across dynamically loaded modules when
                    downcasting
           Product: Base System
           Version: 10.2-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: standards
          Assignee: freebsd-standards at FreeBSD.org
          Reporter: saper at saper.info

Created attachment 159107
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=159107&action=edit
dynamic_cast testcase (shell archive)

dynamic_cast returns 0 when the (apparently same) type is known in the
different runtime modules.

The attached test (just run "make all run" with BSD make or bmake on Linux)
returns:

Parent::something() = 1
Child::something() = 2
library dynamic_cast<Child *>(Parent *) = 0x0
library dynamic_cast<Child *>(Child *) = 0x0
local dynamic_cast<Child *>(Parent *) = 0x0
local dynamic_cast<Child *>(Child *) = 0x7fffffffe580

When using libstdc++.so.6 from gcc48 or newer:

Parent::something() = 1
Child::something() = 2
library dynamic_cast<Child *>(Parent *) = (nil)
library dynamic_cast<Child *>(Child *) = 0x7fffaea254c0
local dynamic_cast<Child *>(Parent *) = (nil)
local dynamic_cast<Child *>(Child *) = 0x7fffaea254c0

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-standards mailing list