http://bugs.winehq.org/show_bug.cgi?id=31335
Bug #: 31335 Summary: __RTDynamicCast (aka dynamic_cast<>) broken on win64 Product: Wine Version: 1.5.9 Platform: x86 OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: msvcrt AssignedTo: wine-bugs@winehq.org ReportedBy: dank@kegel.com Classification: Unclassified
An MFC app compiled with Visual C++ 2010 for 64 bit failed with builtin msvcr100.dll. The +msvcrt log shows things like
trace:msvcrt:MSVCRT___RTDynamicCast obj: 0x14a008 unknown: 0 src: 0x403000 {vtable=0x4021e8 name=.?AVCObject@@ ()} dst: 0x403018 {vtable=0x4021e8 name=.?AVCPerson@@ ()} do_throw: 0) trace:msvcrt:dump_obj_locator 0x402240: sig=00000000 base_offset=00000000 flags=00000000 type=0x403018 {vtable=0x4021e8 name=.?AVCPerson@@ ()} hierarchy=0x402254 trace:msvcrt:dump_obj_locator hierarchy: sig=00000000 attr=00000000 len=2 base classes=0x402264 trace:msvcrt:dump_obj_locator base class 0x402270: num 1 off 0,-1,0 attr 00000040 type 0x403018 {vtable=0x4021e8 name=.?AVCPerson@@ ()} trace:msvcrt:dump_obj_locator base class 0x40228c: num 0 off 0,-1,0 attr 00000040 type 0x403000 {vtable=0x4021e8 name=.?AVCObject@@ ()}
(Can't tell what +relay shows because of bug 31330.)
The very first RTTI dynamic_cast I tried seems to reproduce the problem; it throws the exception Unhandled exception: C++ exception(object = 0x0022fbc0, type = 0x7fe293732980) in 64-bit code (0x000000007b84a034). when it should have succeed.
See attachment for kinda-rtti.cc, kinda-rtti-64.exe, and kinda-rtti.exe, built with Visual C+ 2010's cl.exe /MD for 64 and 32 bits respectively (as well as kinda-rtci.cc, kinda-rtci-64.exe, and kinda-rtci.exe, which demonstrates that the older RTCI seems to work fine on 64 bits, so older MFC apps might not run into this problem.)