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.)
http://bugs.winehq.org/show_bug.cgi?id=31335
--- Comment #1 from Dan Kegel dank@kegel.com 2012-07-26 22:23:35 CDT --- Created attachment 41176 --> http://bugs.winehq.org/attachment.cgi?id=41176 Demo programs, 32 and 64 bit, built with vc 2010 /MD
http://bugs.winehq.org/show_bug.cgi?id=31335
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, source, testcase, | |win64 Platform|x86 |x86-64 Summary|__RTDynamicCast (aka |__RTDynamicCast (aka |dynamic_cast<>) broken on |dynamic_cast<>) broken on |win64 |win64?
http://bugs.winehq.org/show_bug.cgi?id=31335
--- Comment #2 from Dan Kegel dank@kegel.com 2012-07-26 22:28:28 CDT --- To reproduce the error, I did rm -rf ~/.wine WINEARCH=win64 wine x WINEARCH=win64 sh winetricks -q vcrun2010 sh winetricks msvcr100=builtin wine kinda-rtti-64.exe
http://bugs.winehq.org/show_bug.cgi?id=31335
--- Comment #3 from Alexandre Julliard julliard@winehq.org 2012-07-27 02:03:42 CDT --- That's because the data structures are different on 64-bit (they use mostly RVAs instead of pointers).
http://bugs.winehq.org/show_bug.cgi?id=31335
Piotr Caban piotr.caban@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |33937f039f837e3328359d1c617 | |b1424ce334b24 Status|NEW |RESOLVED CC| |piotr.caban@gmail.com Resolution| |FIXED
--- Comment #4 from Piotr Caban piotr.caban@gmail.com 2012-12-04 11:18:09 CST --- Attached test works for me with newest wine.
http://bugs.winehq.org/show_bug.cgi?id=31335
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #5 from Alexandre Julliard julliard@winehq.org 2012-12-07 13:36:06 CST --- Closing bugs fixed in 1.5.19.