[Bug 32316] Autodesk 3ds Max 9 32-bit exits silently or crashes on startup with Wine-Mono

WineHQ Bugzilla wine-bugs at winehq.org
Sun Dec 13 14:46:55 CST 2020


https://bugs.winehq.org/show_bug.cgi?id=32316

Anastasius Focht <focht at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |NEW

--- Comment #17 from Anastasius Focht <focht at gmx.net> ---
Hello Bruni,

--- quote ---
It seems here that all managed OOM exceptions were thrown from constructors.
--- quote ---

no, the managed exception messages (ctors) are just part of runtime class
loading/type resolving, they are not actual errors.

The vtable fixup problem was an artifact from older Wine-Mono 5.0.0. Apparently
I didn't install in clean WINEPREFIX for the last test.

That's an important thing: For each test you have to start from a clean (new)
WINEPREFIX and install the app with all prerequisites otherwise you get all
sorts of problems. Prefix upgrades don't work well in this case.

On Wine 5.19 -> Wine-Mono 5.1.1:

--- snip ---
$ WINEDEBUG=+loaddll,+seh WINE_MONO_TRACE=assembly wine ./3dsmax.exe
...
0024:trace:loaddll:build_module Loaded L"C:\\Program Files\\Autodesk\\3ds Max
9\\rct_havok3.dll" at 62E00000: native
0024:trace:loaddll:build_module Loaded
L"C:\\windows\\mono\\mono-2.0\\lib\\mono\\gac\\Accessibility\\4.0.0.0__b03f5f7f11d50a3a\\Accessibility.dll"
at 0EBE0000: native
0024:trace:loaddll:build_module Loaded
L"C:\\windows\\mono\\mono-2.0\\lib\\mono\\gac\\System.Configuration\\4.0.0.0__b03f5f7f11d50a3a\\System.Configuration.dll"
at 0EC00000: native
[00000024:] EXCEPTION handling: System.NotSupportedException: Event
BackgroundImageLayoutChanged is not valid on this ActiveX control.
0024:trace:seh:dispatch_exception code=c0000005 flags=0 addr=0BBED5A6
ip=0bbed5a6 tid=0024
0024:trace:seh:dispatch_exception  info[0]=00000000
0024:trace:seh:dispatch_exception  info[1]=00000000
0024:trace:seh:dispatch_exception  eax=00000000 ebx=0031e120 ecx=00000000
edx=01854280 esi=0bc6c8e8 edi=0000005c
0024:trace:seh:dispatch_exception  ebp=0031e2c8 esp=0031e100 cs=0023 ds=002b
es=002b fs=0063 gs=006b flags=00010216
0024:trace:seh:call_vectored_handlers calling handler at 0A1803D0 code=c0000005
flags=0
0024:trace:seh:call_vectored_handlers handler at 0A1803D0 returned ffffffff
[00000024:] EXCEPTION handling: System.NullReferenceException: Object reference
not set to an instance of an object
[00000024:] EXCEPTION handling: System.NotImplementedException: The method or
operation is not implemented.
[00000024:] EXCEPTION handling: System.NotImplementedException: The method or
operation is not implemented.
[00000024:] EXCEPTION handling: System.NotImplementedException: The method or
operation is not implemented.

Unhandled Exception:
System.NotImplementedException: The method or operation is not implemented.
  at <Module>.MXS_dotNet.CDotNetHostWnd.Create (MXS_dotNet.CDotNetHostWnd* ,
HWND__* hParent, System.Int32 id, System.Int32 x, System.Int32 y, System.Int32
w, System.Int32 h, System.SByte* pControlTypeString, Value** keyparms,
System.Int32 keyparm_count) [0x0016d] in <f4057819e74943aea3adc5cdb41ca6ab>:0 
  at (wrapper native-to-managed)
<Module>.MXS_dotNet.CDotNetHostWnd.Create(MXS_dotNet.CDotNetHostWnd*
modopt(System.Runtime.CompilerServices.IsConst)
modopt(System.Runtime.CompilerServices.IsConst),HWND__*,int,int,int,int,int,sbyte
modopt(System.Runtime.CompilerServices.IsSignUnspecifiedByte)*,Value**,int)
[ERROR] FATAL UNHANDLED EXCEPTION: System.NotImplementedException: The method
or operation is not implemented.
  at <Module>.MXS_dotNet.CDotNetHostWnd.Create (MXS_dotNet.CDotNetHostWnd* ,
HWND__* hParent, System.Int32 id, System.Int32 x, System.Int32 y, System.Int32
w, System.Int32 h, System.SByte* pControlTypeString, Value** keyparms,
System.Int32 keyparm_count) [0x0016d] in <f4057819e74943aea3adc5cdb41ca6ab>:0 
01b4:trace:seh:NtQueryInformationThread (0xfffffffe,12,0xbd8ff38,4,(nil))
01b0:trace:seh:NtQueryInformationThread (0xfffffffe,12,0xaf1ff50,4,(nil))
  at (wrapper native-to-managed)
<Module>.MXS_dotNet.CDotNetHostWnd.Create(MXS_dotNet.CDotNetHostWnd*
modopt(System.Runtime.CompilerServices.IsConst)
modopt(System.Runtime.CompilerServices.IsConst),HWND__*,int,int,int,int,int,sbyte
modopt(System.Runtime.CompilerServices.IsSignUnspecifiedByte)*,Value**,int)(0xfffffffe,10,0x31d164,4)
0024:trace:seh:NtSetInformationThread (0xfffffffe,10,0x31d164,4)
0024:trace:loaddll:free_modref Unloaded module
L"C:\\windows\\mono\\mono-2.0\\lib\\mono\\gac\\System.Windows.Forms\\4.0.0.0__b77a5c561934e089\\System.Windows.Forms.dll"
: native
0024:trace:loaddll:free_modref Unloaded module
L"C:\\windows\\mono\\mono-2.0\\lib\\mono\\gac\\System\\4.0.0.0__b77a5c561934e089\\System.dll"
: native
0024:trace:loaddll:free_modref Unloaded module
L"C:\\windows\\mono\\mono-2.0\\lib\\mono\\gac\\System.Drawing\\4.0.0.0__b03f5f7f11d50a3a\\System.Drawing.dll"
: native
0024:trace:loaddll:free_modref Unloaded module
L"C:\\windows\\mono\\mono-2.0\\lib\\mono\\gac\\Accessibility\\4.0.0.0__b03f5f7f11d50a3a\\Accessibility.dll"
: native
0024:trace:loaddll:free_modref Unloaded module
L"C:\\windows\\mono\\mono-2.0\\lib\\mono\\4.5\\mscorlib.dll" : native
0024:trace:loaddll:free_modref Unloaded module
L"C:\\windows\\mono\\mono-2.0\\lib\\mono\\gac\\System.Configuration\\4.0.0.0__b03f5f7f11d50a3a\\System.Configuration.dll"
: native
0024:trace:seh:NtSetInformationThread (0xfffffffe,10,0x31d168,4)
...
--- snip ---

More detailed trace:

--- snip ---
0138:trace:win:WIN_CreateWindowEx "Welcome Screen" L"MAXScriptDialog"
ex=00000000 style=84c40000 -1,-1 588x517 parent=000100FE menu=00000000
inst=63340000 params=05B08E50 
...
[00000138: 0.87669 0] ENTER:c (wrapper native-to-managed)
<Module>:_AfxInitManaged ()()
[00000138: 0.87675 1] ENTER:c <Module>:_AfxInitManaged ()()
[00000138: 0.87676 1] LEAVE:c <Module>:_AfxInitManaged ()(result=0
[00000138: 0.87677 0] LEAVE:c (wrapper native-to-managed)
<Module>:_AfxInitManaged ()(result=0
[00000138: 0.87778 0] ENTER:c (wrapper native-to-managed)
<Module>:MXS_dotNet.CDotNetHostWnd.{ctor} (MXS_dotNet.CDotNetHostWnd*
modopt(System.Runtime.CompilerServices.IsConst)
modopt(System.Runtime.CompilerServices.IsConst),MXS_dotNet.dotNetControl*)(05B08F90,
0C0795C0) 
...
[00000138: 0.88116 2] ENTER:c (wrapper managed-to-native) <Module>:CWnd.Create
(CWnd* modopt(System.Runtime.CompilerServices.IsConst)
modopt(System.Runtime.CompilerServices.IsConst),char
modopt(System.Runtime.CompilerServices.IsConst)*,char
modopt(System.Runtime.CompilerServices.IsConst)*,uint
modopt(System.Runtime.CompilerServices.IsLong),tagRECT
modopt(System.Runtime.CompilerServices.IsConst)*
modopt(System.Runtime.CompilerServices.IsImplicitlyDereferenced),CWnd*,uint,CCreateContext*)(05B08F90,
02348414, 5B97E474, 1342177280, 0031E3A8, 052895DC, 3, 00000000)
0138:trace:win:WIN_CreateWindowEx L"" L"Afx:5B960000:0" ex=00000000
style=50000000 2,7 575x450 parent=000107AA menu=00000003 inst=5B960000
params=00000000 
...
0138:trace:win:WIN_CreateWindowEx created window 000107AE
[00000138: 0.88416 2] LEAVE:c (wrapper managed-to-native) <Module>:CWnd.Create
(CWnd* modopt(System.Runtime.CompilerServices.IsConst)
modopt(System.Runtime.CompilerServices.IsConst),char
modopt(System.Runtime.CompilerServices.IsConst)*,char
modopt(System.Runtime.CompilerServices.IsConst)*,uint
modopt(System.Runtime.CompilerServices.IsLong),tagRECT
modopt(System.Runtime.CompilerServices.IsConst)*
modopt(System.Runtime.CompilerServices.IsImplicitlyDereferenced),CWnd*,uint,CCreateContext*)(result=1 
...
[00000138: 0.88470 4] LEAVE:c string:CreateString
(char*)([STRING:0A802290:webbrowser] 
...
0138:trace:loaddll:build_module Loaded
L"C:\\windows\\mono\\mono-2.0\\lib\\mono\\gac\\Accessibility\\4.0.0.0__b03f5f7f11d50a3a\\Accessibility.dll"
at 0DD40000: native
[00000138: 0.89748 7] ENTER:c (wrapper runtime-invoke)
object:runtime_invoke_void__this__
(object,intptr,intptr,intptr)([System.Windows.Forms.WebBrowser:0A802550],
0031DDF0, 0031DD9C, 0DD3F758)
[00000138: 0.89750 8] ENTER:c System.Windows.Forms.WebBrowser:.ctor
()(this:0A802550[System.Windows.Forms.WebBrowser 3dsmax.exe]) 
...
[00000138: 1.05124 2] ENTER:c
MXS_dotNet.CDotNetHostWnd/delegate_proxy_type:set_control
(System.Windows.Forms.Control)(this:0A802268[.delegate_proxy_type 3dsmax.exe],
[System.Windows.Forms.WebBrowser:0A802550])
...
[00000138: 1.05164 2] ENTER:c
<Module>:MXS_dotNet.CDotNetHostWnd.CreateEventHandlerDelegates
(MXS_dotNet.CDotNetHostWnd* modopt(System.Runtime.CompilerServices.IsConst)
modopt(System.Runtime.CompilerServices.IsConst))(05B08F90) 
...
[00000138: 1.05351 5] ENTER:c
MXS_dotNet.CDotNetHostWnd/delegate_proxy_type:get_control
()(this:0A802268[.delegate_proxy_type 3dsmax.exe])
[00000138: 1.05352 5] LEAVE:c
MXS_dotNet.CDotNetHostWnd/delegate_proxy_type:get_control
()([System.Windows.Forms.WebBrowser:0A802550] 
...
[00000138: 1.05404 4] ENTER:c System.RuntimeType:GetEvents
(System.Reflection.BindingFlags)([this:[TYPE:0BC6C900:System.Windows.Forms.WebBrowser]],
92)
[00000138: 1.05405 5] ENTER:c System.RuntimeType:GetEventCandidates
(string,System.Reflection.BindingFlags,bool)([this:[TYPE:0BC6C900:System.Windows.Forms.WebBrowser]],
00000000, 92, 0) 
...
[00000138: 1.05407 6] ENTER:c System.RuntimeType:GetEvents_internal
(string,System.Reflection.BindingFlags,System.RuntimeType/MemberListType,System.RuntimeType)([this:[TYPE:0BC6C900:System.Windows.Forms.WebBrowser]],
00000000, 92, 0, [TYPE:System.Windows.Forms.WebBrowser]) 
...
[00000138: 1.16806 7] ENTER:c (wrapper managed-to-native)
System.Delegate:CreateDelegate_internal
(System.Type,object,System.Reflection.MethodInfo,bool)([TYPE:System.EventHandler],
[.delegate_proxy_type:0A802268],
[System.Reflection.Emit.DynamicMethod:0A80F498], 1)
[00000138: 1.16814 7] LEAVE:c (wrapper managed-to-native)
System.Delegate:CreateDelegate_internal
(System.Type,object,System.Reflection.MethodInfo,bool)([System.EventHandler:0A80F848]
[00000138: 1.16815 6] LEAVE:c System.Delegate:CreateDelegate
(System.Type,object,System.Reflection.MethodInfo,bool,bool)([System.EventHandler:0A80F848]
[00000138: 1.16816 5] LEAVE:c System.Delegate:CreateDelegate
(System.Type,object,System.Reflection.MethodInfo)([System.EventHandler:0A80F848]
[00000138: 1.16817 4] LEAVE:c
System.Reflection.Emit.DynamicMethod:CreateDelegate
(System.Type,object)([System.EventHandler:0A80F848]
[00000138: 1.16833 4] ENTER:c System.Reflection.EventInfo:AddEventHandler
(object,System.Delegate)(this:0A8087A8[System.Reflection.RuntimeEventInfo
3dsmax.exe], [System.Windows.Forms.WebBrowser:0A802550],
[System.EventHandler:0A80F848])
[00000138: 1.16840 5] ENTER:c System.Reflection.EventInfo:GetAddMethod
()(this:0A8087A8[System.Reflection.RuntimeEventInfo 3dsmax.exe])
[00000138: 1.16841 6] ENTER:c System.Reflection.RuntimeEventInfo:GetAddMethod
(bool)(this:0A8087A8[System.Reflection.RuntimeEventInfo 3dsmax.exe], 0)
[00000138: 1.16842 7] ENTER:c System.Reflection.RuntimeEventInfo:GetEventInfo
(System.Reflection.RuntimeEventInfo)([System.Reflection.RuntimeEventInfo:0A8087A8])
...
[00000138: 1.34521 5] LEAVE:c
System.Reflection.EventInfo:CreateAddEventDelegate
(System.Reflection.MethodInfo)([.AddEventAdapter:0A815500]
[00000138: 1.34523 5] ENTER:c System.Reflection.EventInfo:AddEventFrame<T_REF,
D_REF> (System.Reflection.EventInfo/AddEvent`2<T_REF, D_REF>,object,object)(XX,
[System.Windows.Forms.WebBrowser:0A802550], [System.EventHandler:0A815198]) 
...
[00000138: 1.34554 6] ENTER:c
System.Windows.Forms.WebBrowserBase:add_BackgroundImageLayoutChanged
(System.EventHandler)(this:0A802550[System.Windows.Forms.WebBrowser
3dsmax.exe], [System.EventHandler:0A815198]) 
...
[00000138: 1.34564 7] LEAVE:c (wrapper managed-to-native)
object:__icall_wrapper_mono_helper_ldstr (intptr,int)([STRING:0BC2C2A0:Event
{0} is not valid on this ActiveX control.]
...
[00000138:] EXCEPTION handling: System.NotSupportedException: Event
BackgroundImageLayoutChanged is not valid on this ActiveX control.
EXCEPTION: catch found at clause 0 of
<Module>:MXS_dotNet.DotNetObjectWrapper.CreateEventHandlerDelegates
(MXS_dotNet.DotNetObjectWrapper*
modopt(System.Runtime.CompilerServices.IsConst)
modopt(System.Runtime.CompilerServices.IsConst),object,System.Reflection.MethodInfo) 
--- snip ---

A window which ought to host webbrowser Activex control gets passed to be
wrapped in a managed object.

So the sequence is likely this: 

MXS_dotNet::CDotNetHostWnd::Create()
  MXS_dotNet::CDotNetHostWnd::CreateEventHandlerDelegates()
    wrapped_object::GetEvents()
    ...

'System.RuntimeType:GetEvents' gets called with BindingFlags = 92 

BindingFlags = 64 (FlattenHierarchy) + 16 (Public) + 8 (Static) + 4 (Instance) 

https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.webbrowserbase.backgroundimagelayoutchanged?view=netframework-2.0

https://github.com/mono/mono/blob/master/mcs/class/System.Windows.Forms/System.Windows.Forms/WebBrowserBase.cs#L486

--- snip ---
        [Browsable (false)]
        [EditorBrowsable (EditorBrowsableState.Never)]
        public new event EventHandler BackgroundImageLayoutChanged {
            add { throw new NotSupportedException ("Invalid event handler for
BackgroundImageLayoutChanged"); }
            remove { }
        }
--- snip ---

The exception makes entirely sense. The question remains why these "invalid"
events get collected in first place the be wrapped in event delegates in the
managed wrapper.

I've found the managed 'CDotNetHostWnd' C++ class interface here (created
snapshot to preserve it):

https://web.archive.org/web/20201213193159/https://searchcode.com/codesearch/view/13813692/

But that's just the public interface. The implementation is in 'mxsdotnet.dlx'
mixed assembly (contains mixture of .​NET and native C++ code).

Regards

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.


More information about the wine-bugs mailing list