http://bugs.winehq.org/show_bug.cgi?id=32316
Bug #: 32316 Summary: 3dsmax 9 32bit Product: Wine Version: 1.5.18 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: keith@ukscifi.net Classification: Unclassified
Created attachment 42656 --> http://bugs.winehq.org/attachment.cgi?id=42656 console output for wine, running 3dsmax9-32bit.txt
3dsmax Installs fine except the metal-ray satellite service however this is unimportant and unneeded unless you want to start up a server rendering farm.
Running max itself;
Program starts to run checking all the plugins to the point where the main window appears then dies.
Logs attached!
http://bugs.winehq.org/show_bug.cgi?id=32316
hanska2@luukku.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |hanska2@luukku.com
--- Comment #1 from hanska2@luukku.com --- Can you do the same but newer wine?
https://bugs.winehq.org/show_bug.cgi?id=32316
--- Comment #2 from X-Seti keith@ukscifi.net --- I am going to give this another go.
Latest wine right..
https://bugs.winehq.org/show_bug.cgi?id=32316
X-Seti keith@ukscifi.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|1.5.18 |1.5.20 Severity|normal |major
https://bugs.winehq.org/show_bug.cgi?id=32316
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Severity|major |normal
https://bugs.winehq.org/show_bug.cgi?id=32316
Ken Sharp imwellcushtymelike@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |Abandoned?
https://bugs.winehq.org/show_bug.cgi?id=32316
super_man@post.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |austinenglish@gmail.com, | |super_man@post.com
--- Comment #3 from super_man@post.com --- (In reply to X-Seti from comment #2)
I am going to give this another go.
Latest wine right..
We are currently using 1.7.53 wine. Abandoned or NEEDINFO.
https://bugs.winehq.org/show_bug.cgi?id=32316
--- Comment #4 from X-Seti keith@ukscifi.net --- Notes; Dec12-2015
3dsmax9 32bit is the only version that really works, apart from not being able to register the product using the license manager. (this is broken / shows incomplete) as I am not able to paste the activation code given to me from Autodesk.
I do have both versions on 3dsmax9 32 and 64 bit. again there seems to be a problem trying to install the 64 bit version since dot.net2, can't be installed on a 64bit prefix.
As for later releases on 3dsmax 2012 to 2016.
These rely heavily on dot.net 3/4 so this is a doomed effect from the start.
https://bugs.winehq.org/show_bug.cgi?id=32316
--- Comment #5 from X-Seti keith@ukscifi.net --- (In reply to hanska2 from comment #1)
Can you do the same but newer wine?
Yes, following post https://bugs.winehq.org/show_bug.cgi?id=32316#c0
https://bugs.winehq.org/show_bug.cgi?id=32316
--- Comment #6 from X-Seti keith@ukscifi.net --- (In reply to super_man from comment #3)
(In reply to X-Seti from comment #2)
I am going to give this another go.
Latest wine right..
We are currently using 1.7.53 wine. Abandoned or NEEDINFO.
I haven't really abandoned this as I have been waiting to see what's happening with dot.net3/4 implementation.
https://bugs.winehq.org/show_bug.cgi?id=32316
--- Comment #7 from X-Seti keith@ukscifi.net --- (In reply to X-Seti from comment #2)
I am going to give this another go.
Latest wine right..
always use the latest wine.
however, I did start out with 1.4
https://bugs.winehq.org/show_bug.cgi?id=32316
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEEDINFO Ever confirmed|0 |1
--- Comment #8 from Austin English austinenglish@gmail.com --- (In reply to X-Seti from comment #6)
(In reply to super_man from comment #3)
(In reply to X-Seti from comment #2)
I am going to give this another go.
Latest wine right..
We are currently using 1.7.53 wine. Abandoned or NEEDINFO.
I haven't really abandoned this as I have been waiting to see what's happening with dot.net3/4 implementation.
dotnet30/dotnet40 works fine in a 32-bit prefix using winetricks. It sounds like you're exclusively using 64-bit prefixes, please retry in a 32-bit prefix.
Also you're still not listing your wine version.
https://bugs.winehq.org/show_bug.cgi?id=32316
X-Seti keith@ukscifi.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|1.5.20 |1.6.2
--- Comment #9 from X-Seti keith@ukscifi.net --- Updated wine version to wine-prefix-32 works with 3dsmax9 32bit, still having missing check / input boxes on the form.
Running ubuntu15.04 64bit. Wine1.6.2
https://bugs.winehq.org/show_bug.cgi?id=32316
--- Comment #10 from Austin English austinenglish@gmail.com --- (In reply to X-Seti from comment #9)
Updated wine version to wine-prefix-32 works with 3dsmax9 32bit, still having missing check / input boxes on the form.
Running ubuntu15.04 64bit. Wine1.6.2
1.6.2 is very old, please retest in 1.8-rc4 (or 1.8 when it's released, should be end of this week).
https://bugs.winehq.org/show_bug.cgi?id=32316
Aaron Franke arnfranke@yahoo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |arnfranke@yahoo.com
--- Comment #11 from Aaron Franke arnfranke@yahoo.com --- Is this still an issue in Wine 2.6?
https://bugs.winehq.org/show_bug.cgi?id=32316
joaopa jeremielapuree@yahoo.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jeremielapuree@yahoo.fr
--- Comment #12 from joaopa jeremielapuree@yahoo.fr --- No free download available. No answer from OP since 5 years. Can an administrator close this bug as ABANDONED?
https://bugs.winehq.org/show_bug.cgi?id=32316
Jeff Zaroyko jeffz@jeffz.name changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |CLOSED Resolution|--- |ABANDONED
--- Comment #13 from Jeff Zaroyko jeffz@jeffz.name --- No response from reporter. Feel free to reopen if still an issue with wine-5.5 or newer.
https://bugs.winehq.org/show_bug.cgi?id=32316
Jeff Zaroyko jeffz@jeffz.name changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|3dsmax 9 32bit |Autodesk 3ds Max 9 32bit | |exits unexpectedly after | |starting
https://bugs.winehq.org/show_bug.cgi?id=32316
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords|Abandoned? |download CC| |focht@gmx.net Status|CLOSED |REOPENED Component|-unknown |mscoree Summary|Autodesk 3ds Max 9 32bit |Autodesk 3ds Max 9 32-bit |exits unexpectedly after |exits silently or crashes |starting |on startup with Wine-Mono Resolution|ABANDONED |--- URL| |https://web.archive.org/web | |/20150724061434/http://file | |s.modacity.net/software/3ds | |max/3dsmax9.zip
--- Comment #14 from Anastasius Focht focht@gmx.net --- Hello folks,
confirming and reopening.
The silent exit which later became a crash on startup is Wine-Mono related. The app loads a plugin 'mxsdotnet.dlx' on startup which acts as .NET wrapper/host for managed plugins.
Wine 1.6.2 -> Wine-Mono 0.0.8 (part of Wine 1.5.16)
--- snip --- $ pwd /home/focht/.wine/drive_c/Program Files (x86)/Autodesk/3ds Max 9
$ WINEDEBUG=+seh,+loaddll WINE_MONO_TRACE=all wine ./3dsmax.exe ... [0000003C: 2.22335 6] LEAVE: <Module>:<CrtImplementationDetails>.ThisModule.ResolveMethod<void const * __clrcall(void)> (*())result=06537848 [0000003C: 2.22344 6] ENTER: <Module>:?A0x720ba6bd.??__E?A0x720ba6bd@kTriObjNormalXTCID@@YMXXZ ()() [0000003C: 2.22354 7] ENTER: (wrapper managed-to-native) <Module>:Class_ID.{ctor} (Class_ID*,uint,uint)(5B9CDA38, 1930048471, 656698453, ) [0000003C: 2.22369 7] LEAVE: (wrapper managed-to-native) <Module>:Class_ID.{ctor} (Class_ID*,uint,uint)result=0032E870 [0000003C: 2.22379 6] LEAVE: <Module>:?A0x720ba6bd.??__E?A0x720ba6bd@kTriObjNormalXTCID@@YMXXZ () [0000003C: 2.22386 6] ENTER: <Module>:<CrtImplementationDetails>.ThisModule.ResolveMethod<void const * __clrcall(void)> (*())(060000A2, ) [0000003C: 2.22397 7] ENTER: <Module>:<CrtImplementationDetails>.ThisModule.Handle ()(VALUERET:0032E934, ) [0000003C: 2.22409 8] ENTER: (wrapper managed-to-native) System.MonoType:get_Module (System.MonoType)([TYPE:<CrtImplementationDetails>.ThisModule], ) [0000003C: 2.22420 8] LEAVE: (wrapper managed-to-native) System.MonoType:get_Module (System.MonoType)[System.Reflection.Module:04759F50] [0000003C: 2.22430 7] LEAVE: <Module>:<CrtImplementationDetails>.ThisModule.Handle ()[f0,f8,e2,05,] [0000003C: 2.22449 7] ENTER: System.ModuleHandle:ResolveMethodHandle (int)(VALUERET:0032E934, value:0032E934, 100663458, ) [0000003C: 2.22465 8] ENTER: System.ModuleHandle:ResolveMethodHandle (int,System.RuntimeTypeHandle[],System.RuntimeTypeHandle[])(VALUERET:0032E934, value:0032E934, 100663458, 00000000, 00000000, ) [0000003C: 2.22486 9] ENTER: System.ModuleHandle:ptrs_from_handles (System.RuntimeTypeHandle[])(value:0032E934, 00000000, ) [0000003C: 2.22499 9] LEAVE: System.ModuleHandle:ptrs_from_handles (System.RuntimeTypeHandle[])result=00000000 [0000003C: 2.22508 9] ENTER: System.ModuleHandle:ptrs_from_handles (System.RuntimeTypeHandle[])(value:0032E934, 00000000, ) [0000003C: 2.22522 9] LEAVE: System.ModuleHandle:ptrs_from_handles (System.RuntimeTypeHandle[])result=00000000 [0000003C: 2.22531 9] ENTER: (wrapper managed-to-native) System.Reflection.Module:ResolveMethodToken (intptr,int,intptr[],intptr[],System.Reflection.ResolveTokenError&)(05E2F8F0, 100663458, 00000000, 00000000, [BYREF:0032E8C0], ) [0000003C: 2.22551 9] LEAVE: (wrapper managed-to-native) System.Reflection.Module:ResolveMethodToken (intptr,int,intptr[],intptr[],System.Reflection.ResolveTokenError&)result=99297888 [0000003C: 2.22560 8] LEAVE: System.ModuleHandle:ResolveMethodHandle (int,System.RuntimeTypeHandle[],System.RuntimeTypeHandle[])[f0,f8,e2,05,] [0000003C: 2.22582 7] LEAVE: System.ModuleHandle:ResolveMethodHandle (int)[f0,f8,e2,05,] [0000003C: 2.22602 7] ENTER: System.RuntimeMethodHandle:GetFunctionPointer ()(value:0032E930, ) [0000003C: 2.22613 8] ENTER: (wrapper managed-to-native) System.RuntimeMethodHandle:GetFunctionPointer (intptr)(05EB2A60, ) [0000003C: 2.22632 8] LEAVE: (wrapper managed-to-native) System.RuntimeMethodHandle:GetFunctionPointer (intptr)result=106133648 [0000003C: 2.22642 7] LEAVE: System.RuntimeMethodHandle:GetFunctionPointer ()result=106133648 [0000003C: 2.22651 6] LEAVE: <Module>:<CrtImplementationDetails>.ThisModule.ResolveMethod<void const * __clrcall(void)> (*())result=06537890 [0000003C: 2.22660 6] ENTER: <Module>:?A0xc387e308.??__EtheApp@@YMXXZ ()() [0000003C: 2.22675 7] ENTER: (wrapper managed-to-native) <Module>:CWinApp.{ctor} (CWinApp*,char*)(5B9D02F0, 00000000, ) trace:seh:raise_exception code=c0000005 flags=0 addr=(nil) ip=00000000 tid=003c trace:seh:raise_exception info[0]=00000000 trace:seh:raise_exception info[1]=00000000 trace:seh:raise_exception eax=00000001 ebx=060000a2 ecx=0032e880 edx=0000003b esi=00000001 edi=00000000 trace:seh:raise_exception ebp=0032e8b0 esp=0032e890 cs=0023 ds=002b es=002b fs=0063 gs=006b flags=00010202 trace:seh:call_stack_handlers calling handler at 0x783a5a4b code=c0000005 flags=0 fixme:dbghelp:elf_search_auxv can't find symbol in module fixme:mscoree:get_runtime_info unsupported runtimeinfo flags 50 trace:loaddll:load_builtin_dll Loaded L"KERNEL32.dll" at 0x7b810000: builtin trace:loaddll:load_native_dll Loaded L"C:\Program Files (x86)\Autodesk\3ds Max 9\SendDmp.exe" at 0x400000: native --- snip ---
Workaround: 'winetricks -q dotnet20'
Now checking all Wine-Mono releases up to most recent...
From my list: https://gist.github.com/rmi1974/a65b875934f87509b536a776347d007a
====
Using Wine-Mono 4.5.2 (part of Wine 1.7.8) gets a bit further and different crash:
--- snip --- ... [00000009: 2.20617 6] ENTER: <Module>:<CrtImplementationDetails>.ThisModule.ResolveMethod<void const * __clrcall(void)> (*())(060000BA, ) [00000009: 2.20632 7] ENTER: <Module>:<CrtImplementationDetails>.ThisModule.Handle ()(VALUERET:0032E8E4, ) [00000009: 2.20648 8] ENTER: (wrapper managed-to-native) System.MonoType:get_Module (System.MonoType)([TYPE:<CrtImplementationDetails>.ThisModule], ) [00000009: 2.20664 8] LEAVE: (wrapper managed-to-native) System.MonoType:get_Module (System.MonoType)[System.Reflection.Module:080018F8] [00000009: 2.20676 7] LEAVE: <Module>:<CrtImplementationDetails>.ThisModule.Handle ()[c8,97,ce,04,] [00000009: 2.20702 7] ENTER: System.ModuleHandle:ResolveMethodHandle (int)(VALUERET:0032E8E4, value:0032E8E4, 100663482, ) [00000009: 2.20723 8] ENTER: System.ModuleHandle:ResolveMethodHandle (int,System.RuntimeTypeHandle[],System.RuntimeTypeHandle[])(VALUERET:0032E8E4, value:0032E8E4, 100663482, 00000000, 00000000, ) [00000009: 2.20751 9] ENTER: System.ModuleHandle:ptrs_from_handles (System.RuntimeTypeHandle[])(value:0032E8E4, 00000000, ) [00000009: 2.20770 9] LEAVE: System.ModuleHandle:ptrs_from_handles (System.RuntimeTypeHandle[])result=00000000 [00000009: 2.20783 9] ENTER: System.ModuleHandle:ptrs_from_handles (System.RuntimeTypeHandle[])(value:0032E8E4, 00000000, ) [00000009: 2.20798 9] LEAVE: System.ModuleHandle:ptrs_from_handles (System.RuntimeTypeHandle[])result=00000000 [00000009: 2.20807 9] ENTER: (wrapper managed-to-native) System.Reflection.Module:ResolveMethodToken (intptr,int,intptr[],intptr[],System.Reflection.ResolveTokenError&)(04CE97C8, 100663482, 00000000, 00000000, [BYREF:0032E870], ) [00000009: 2.20828 9] LEAVE: (wrapper managed-to-native) System.Reflection.Module:ResolveMethodToken (intptr,int,intptr[],intptr[],System.Reflection.ResolveTokenError&)result=81110928 [00000009: 2.20839 8] LEAVE: System.ModuleHandle:ResolveMethodHandle (int,System.RuntimeTypeHandle[],System.RuntimeTypeHandle[])[c8,97,ce,04,] [00000009: 2.20859 7] LEAVE: System.ModuleHandle:ResolveMethodHandle (int)[c8,97,ce,04,] [00000009: 2.20880 7] ENTER: System.RuntimeMethodHandle:GetFunctionPointer ()(value:0032E8E0, ) [00000009: 2.20892 8] ENTER: (wrapper managed-to-native) System.RuntimeMethodHandle:GetFunctionPointer (intptr)(04D5A790, ) [00000009: 2.20925 8] LEAVE: (wrapper managed-to-native) System.RuntimeMethodHandle:GetFunctionPointer (intptr)result=152524424 [00000009: 2.20941 7] LEAVE: System.RuntimeMethodHandle:GetFunctionPointer ()result=152524424 [00000009: 2.20955 6] LEAVE: <Module>:<CrtImplementationDetails>.ThisModule.ResolveMethod<void const * __clrcall(void)> (*())result=09175688 [00000009: 2.20968 6] ENTER: <Module>:?A0x1e6a6792.??__E?A0x1e6a6792@postDllMain@@YMXXZ ()() [00000009: 2.21002 7] ENTER: <Module>:PostDllMain.{ctor} (PostDllMain*)(5B9D3398, ) [00000009: 2.21028 8] ENTER: (wrapper managed-to-native) <Module>:AfxIsModuleDll ()() [00000009: 2.21040 8] LEAVE: (wrapper managed-to-native) <Module>:AfxIsModuleDll ()result=1 [00000009: 2.21055 8] ENTER: (wrapper managed-to-native) <Module>:AfxGetInstanceHandleHelper ()() [00000009: 2.21065 8] LEAVE: (wrapper managed-to-native) <Module>:AfxGetInstanceHandleHelper ()result=00000000 [00000009: 2.21080 8] ENTER: (wrapper managed-to-native) <Module>:InternalDllMain (HINSTANCE__*,uint,void*)(00000000, 1, 00000000, ) [00000009: 2.21244 9] ENTER: (wrapper native-to-managed) <Module>:CSkeletonMFCApp.InitInstance (CSkeletonMFCApp*)(A6451B16, ) [00000009: 2.21277 10] ENTER: <Module>:CSkeletonMFCApp.InitInstance (CSkeletonMFCApp*)(A6451B16, ) [00000009: 2.21298 11] ENTER: (wrapper managed-to-native) <Module>:CWinApp.InitInstance (CWinApp*)(A6451B16, ) trace:seh:raise_exception code=c0000005 flags=0 addr=0x78347f73 ip=78347f73 tid=0009 trace:seh:raise_exception info[0]=00000000 trace:seh:raise_exception info[1]=a6451b16 trace:seh:raise_exception eax=00000000 ebx=00000000 ecx=a6451b16 edx=7e3c1130 esi=a6451b16 edi=a6451b16 trace:seh:raise_exception ebp=0032e7e8 esp=0032e7b8 cs=0023 ds=002b es=002b fs=0063 gs=006b flags=00210206 trace:seh:call_vectored_handlers calling handler at 0x6c421b30 code=c0000005 flags=0 trace:seh:call_vectored_handlers handler at 0x6c421b30 returned 0 trace:seh:call_stack_handlers calling handler at 0x5b97b0b9 code=c0000005 flags=0 trace:seh:call_stack_handlers handler at 0x5b97b0b9 returned 1 trace:seh:call_stack_handlers calling handler at 0x77d87b code=c0000005 flags=0 trace:seh:call_stack_handlers handler at 0x77d87b returned 1 trace:seh:call_stack_handlers calling handler at 0x77d0c9 code=c0000005 flags=0 fixme:dbghelp:elf_search_auxv can't find symbol in module fixme:mscoree:get_runtime_info unsupported runtimeinfo flags 50 trace:loaddll:load_builtin_dll Loaded L"KERNEL32.dll" at 0x7b810000: builtin trace:loaddll:load_native_dll Loaded L"C:\Program Files (x86)\Autodesk\3ds Max 9\SendDmp.exe" at 0x400000: native --- snip ---
Same with:
* Wine-Mono 4.5.4 | wine-1.7.32 * Wine-Mono 4.5.6 | wine-1.7.38 * Wine-Mono 4.6.0 | wine-1.9.5
====
Using Wine-Mono 4.6.2 (part of Wine 1.9.8) results in different crash and managed code backtrace from Wine-Mono as well.
--- snip --- [00000009: 2.29829 8] ENTER: (wrapper managed-to-native) <Module>:AfxIsModuleDll ()() [00000009: 2.29838 8] LEAVE: (wrapper managed-to-native) <Module>:AfxIsModuleDll ()result=1 [00000009: 2.29852 8] ENTER: (wrapper managed-to-native) <Module>:AfxGetInstanceHandleHelper ()() [00000009: 2.29861 8] LEAVE: (wrapper managed-to-native) <Module>:AfxGetInstanceHandleHelper ()result=5B960000 [00000009: 2.29875 8] ENTER: (wrapper managed-to-native) <Module>:InternalDllMain (HINSTANCE__*,uint,void*)(5B960000, 1, 00000000, ) [00000009: 2.30078 9] ENTER: (wrapper native-to-managed) <Module>:CSkeletonMFCApp.InitInstance (CSkeletonMFCApp*)(56F92E52, ) [00000009: 2.30096 10] ENTER: <Module>:CSkeletonMFCApp.InitInstance (CSkeletonMFCApp*)(56F92E52, ) [00000009: 2.30116 11] ENTER: (wrapper managed-to-native) <Module>:CWinApp.InitInstance (CWinApp*)(56F92E52, ) trace:seh:raise_exception code=c0000005 flags=0 addr=0x78347f73 ip=78347f73 tid=0009 trace:seh:raise_exception info[0]=00000000 trace:seh:raise_exception info[1]=56f92e52 trace:seh:raise_exception eax=0032e684 ebx=00000000 ecx=56f92e52 edx=7d940410 esi=56f92e52 edi=56f92e52 trace:seh:raise_exception ebp=0032e6a8 esp=0032e668 cs=0023 ds=002b es=002b fs=0063 gs=006b flags=00210216 trace:seh:call_vectored_handlers calling handler at 0x6c62d2b0 code=c0000005 flags=0 Stacktrace:
at <unknown> <0xffffffff> at (wrapper managed-to-native) <Module>.CWinApp.InitInstance (CWinApp*) <0xffffffff> at <Module>.CSkeletonMFCApp.InitInstance (CSkeletonMFCApp*) <0x00023> at (wrapper native-to-managed) <Module>.CSkeletonMFCApp.InitInstance (CSkeletonMFCApp*) <0xffffffff> at <unknown> <0xffffffff> at (wrapper managed-to-native) <Module>.InternalDllMain (HINSTANCE__*,uint,void*) <0xffffffff> at <Module>.PostDllMain.{ctor} (PostDllMain*) <0x00057> at <Module>.?A0x1e6a6792.??__E?A0x1e6a6792@postDllMain@@YMXXZ () <0x00023> at <Module>._initterm_m (*()*,*()*) <0x00039> at <Module>.<CrtImplementationDetails>.LanguageSupport.InitializePerProcess (<CrtImplementationDetails>.LanguageSupport*) <0x00073> at <Module>.<CrtImplementationDetails>.LanguageSupport._Initialize (<CrtImplementationDetails>.LanguageSupport*) <0x0027b> at <Module>.<CrtImplementationDetails>.LanguageSupport.Initialize (<CrtImplementationDetails>.LanguageSupport*) <0x0007f> at <Module>..cctor () <0x0003f> at (wrapper runtime-invoke) object.runtime_invoke_void (object,intptr,intptr,intptr) <0xffffffff> at <unknown> <0xffffffff>
================================================================= Got a SIGSEGV while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application. ================================================================= --- snip --
Same with:
* Wine-Mono 4.6.3 | wine-1.9.12 * Wine-Mono 4.6.4 | wine-2.0-rc1 * Wine-Mono 4.7.0 | wine-2.4 * Wine-Mono 4.7.1 | wine-2.14 * Wine-Mono 4.7.3 | wine-3.13 * Wine-Mono 4.7.5 | wine-4.0-rc6
====
Using Wine-Mono 4.8.0 (part of Wine 4.3) results in different crash and managed code backtrace from Wine-Mono as well.
--- snip --- [00000009: 0.04109 9] LEAVE: System.AppDomain:get_CurrentDomain ()[System.AppDomain:091F4120] [00000009: 0.04120 9] ENTER: System.AppDomain:IsDefaultAppDomain ()(this:091F4120[System.AppDomain mscorlib.dll], ) [00000009: 0.04134 10] ENTER: System.AppDomain:get_DefaultDomain ()() [00000009: 0.04144 10] LEAVE: System.AppDomain:get_DefaultDomain ()[System.AppDomain:091F4120] [00000009: 0.04157 9] LEAVE: System.AppDomain:IsDefaultAppDomain ()result=20840449 [00000009: 0.04168 9] ENTER: (wrapper managed-to-native) object:__icall_wrapper_mono_generic_class_init (intptr)(01461728, ) [00000009: 0.04182 9] LEAVE: (wrapper managed-to-native) object:__icall_wrapper_mono_generic_class_init (intptr) [00000009: 0.04201 9] ENTER: <Module>:<CrtImplementationDetails>.DoDllLanguageSupportValidation ()() [00000009: 0.04212 10] ENTER: System.AppDomain:get_CurrentDomain ()() [00000009: 0.04223 11] ENTER: string:memset (byte*,int,int)(0032DD40, 0, 68, ) [00000009: 0.04242 11] LEAVE: string:memset (byte*,int,int) [00000009: 0.04250 11] ENTER: (wrapper managed-to-native) System.AppDomain:getCurDomain ()() [00000009: 0.04262 11] LEAVE: (wrapper managed-to-native) System.AppDomain:getCurDomain ()[System.AppDomain:091F4120] [00000009: 0.04273 10] LEAVE: System.AppDomain:get_CurrentDomain ()[System.AppDomain:091F4120] [00000009: 0.04284 10] ENTER: System.AppDomain:IsDefaultAppDomain ()(this:091F4120[System.AppDomain mscorlib.dll], ) [00000009: 0.04298 11] ENTER: System.AppDomain:get_DefaultDomain ()() [00000009: 0.04309 11] LEAVE: System.AppDomain:get_DefaultDomain ()[System.AppDomain:091F4120] [00000009: 0.04320 10] LEAVE: System.AppDomain:IsDefaultAppDomain ()result=21365505 [00000009: 0.04331 9] LEAVE: <Module>:<CrtImplementationDetails>.DoDllLanguageSupportValidation () [00000009: 0.04350 9] ENTER: (wrapper managed-to-native) <Module>:_getFiberPtrId ()() mono_threads_enter_gc_safe_region_unbalanced Cannot transition thread 00000009 from STATE_BLOCKING with DO_BLOCKING
abnormal program termination 0009:trace:seh:MSVCRT_raise (22) ... 0009:trace:seh:raise_exception code=c0000005 flags=0 addr=0x412a3b ip=00412a3b tid=0009 0009:trace:seh:raise_exception info[0]=00000001 0009:trace:seh:raise_exception info[1]=00000008 0009:trace:seh:raise_exception eax=00000011 ebx=00000000 ecx=00861b40 edx=00000011 esi=0000004c edi=044f6750 0009:trace:seh:raise_exception ebp=00000000 esp=0032d924 cs=0023 ds=002b es=002b fs=0063 gs=006b flags=00010246 0009:trace:seh:call_vectored_handlers calling handler at 0x6c635c50 code=c0000005 flags=0
================================================================= Native Crash Reporting ================================================================= Got a SIGSEGV while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application. =================================================================
================================================================= Managed Stacktrace: ================================================================= at <unknown> <0xffffffff> at <Module>:_getFiberPtrId <0x00012> at <Module>:<CrtImplementationDetails>.LanguageSupport._Initialize <0x00187> at <Module>:<CrtImplementationDetails>.LanguageSupport.Initialize <0x001a3> at <Module>:.cctor <0x00117> at System.Object:runtime_invoke_void <0x0016e> at <unknown> <0xffffffff> at <Module>:<CrtImplementationDetails>.DoDllLanguageSupportValidation <0x00012> at <Module>:<CrtImplementationDetails>.LanguageSupport._Initialize <0x0017f> at <Module>:<CrtImplementationDetails>.LanguageSupport.Initialize <0x001a3> at <Module>:.cctor <0x00117> at System.Object:runtime_invoke_void <0x0016e> --- snip ---
Same with:
* Wine-Mono 4.8.1 | wine-4.6 * Wine-Mono 4.8.3 | wine-4.7
====
Using Wine-Mono 4.9.0 (part of Wine 4.11) results in different crash and managed code backtrace from Wine-Mono as well.
--- snip --- ... [00000009: 3.25658 5] ENTER: (wrapper alloc) object:AllocSmall (intptr,intptr)(00AB1DF0, 00000040, ) [00000009: 3.25674 5] LEAVE: (wrapper alloc) object:AllocSmall (intptr,intptr)[System.EventHandler:0B002D30] [00000009: 3.25700 5] ENTER: (wrapper managed-to-native) <Module>:<CrtImplementationDetails>.RegisterModuleUninitializer (System.EventHandler)([System.EventHandler:0B002D30], ) [00000009: 3.25722 6] ENTER: (wrapper managed-to-native) object:__icall_wrapper_mono_delegate_to_ftnptr (object)([System.EventHandler:0B002D30], ) [00000009: 3.25751 6] LEAVE: (wrapper managed-to-native) object:__icall_wrapper_mono_delegate_to_ftnptr (object)result=0C478EB8 [00000009: 3.25930 6] ENTER: (wrapper native-to-managed) <Module>:<CrtImplementationDetails>.RegisterModuleUninitializer (System.EventHandler)(0009:trace:seh:raise_exception code=c0000005 flags=0 addr=0x6c592930 ip=6c592930 tid=0009 0009:trace:seh:raise_exception info[0]=00000000 0009:trace:seh:raise_exception info[1]=53ec8b55 0009:trace:seh:raise_exception eax=53ec8b55 ebx=00000000 ecx=00000012 edx=0c478eb8 esi=00ab3280 edi=00a98d58 0009:trace:seh:raise_exception ebp=00a04664 esp=0033e600 cs=0023 ds=002b es=002b fs=0063 gs=006b flags=00010206 0009:trace:seh:call_vectored_handlers calling handler at 0x6c6363d0 code=c0000005 flags=0
================================================================= Native Crash Reporting ================================================================= Got a SIGSEGV while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application. =================================================================
================================================================= Managed Stacktrace: ================================================================= at <unknown> <0xffffffff> at <Module>:<CrtImplementationDetails>.RegisterModuleUninitializer <0x00012> at <Module>:<CrtImplementationDetails>.LanguageSupport.InitializeUninitializer <0x00167> at <Module>:<CrtImplementationDetails>.LanguageSupport._Initialize <0x003c3> at <Module>:<CrtImplementationDetails>.LanguageSupport.Initialize <0x001a3> at <Module>:.cctor <0x00117> at System.Object:runtime_invoke_void <0x0016e> ================================================================= --- snip ---
Same with:
* Wine-Mono 4.9.2 | wine-4.14 * Wine-Mono 4.9.3 | wine-4.17 * Wine-Mono 4.9.4 | wine-4.20
Using Wine-Mono 5.0.0 (part of Wine 5.7) results in different crash and no usable managed code backtrace.
--- snip --- ... 00b1:trace:loaddll:load_native_dll Loaded L"C:\windows\Microsoft.NET\Framework\v2.0.50727\fusion.dll" at 0xa990000: PE builtin 00b1:trace:loaddll:load_native_dll Loaded L"C:\windows\mono\mono-2.0\lib\mono\4.5\mscorlib.dll" at 0xa9c0000: native [000000B1: 0.00000 0] ENTER:c (wrapper runtime-invoke) <Module>:runtime_invoke_void__this___object (object,intptr,intptr,intptr)([System.OutOfMemoryException:09C00038], 0032E808, 0032E74C, 0AE40D48) [000000B1: 0.00023 1] ENTER:c System.OutOfMemoryException:.ctor (string)(this:09C00038[System.OutOfMemoryException mscorlib.dll], [STRING:09C00010:Out of memory]) [000000B1: 0.00046 2] ENTER:c System.SystemException:.ctor (string)(this:09C00038[System.OutOfMemoryException mscorlib.dll], [STRING:09C00010:Out of memory]) [000000B1: 0.00095 3] ENTER:c (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr)(00000000, 00000000, 0032E304, 0AE41830) [000000B1: 0.00113 4] ENTER:c System.Exception:.cctor ()() [000000B1: 0.00139 5] ENTER:c (wrapper alloc) object:AllocSmall (intptr,intptr)(032D8250, 00000008) [000000B1: 0.00151 5] LEAVE:c (wrapper alloc) object:AllocSmall (intptr,intptr)([System.Object:09C00098] [000000B1: 0.00165 5] ENTER:c object:.ctor ()(this:09C00098[System.Object mscorlib.dll]) [000000B1: 0.00173 5] LEAVE:c object:.ctor ()( [000000B1: 0.00180 4] LEAVE:c System.Exception:.cctor ()( ... [000000B1: 0.00686 5] ENTER:c System.Runtime.Serialization.SafeSerializationManager:.ctor ()(this:09C00268[System.Runtime.Serialization.SafeSerializationManager mscorlib.dll]) [000000B1: 0.00695 5] LEAVE:c System.Runtime.Serialization.SafeSerializationManager:.ctor ()( [000000B1: 0.00701 4] LEAVE:c System.Exception:Init ()( [000000B1: 0.00707 3] LEAVE:c System.Exception:.ctor (string)( [000000B1: 0.00712 3] ENTER:c System.Exception:set_HResult (int)(this:09C00220[System.StackOverflowException mscorlib.dll], -2146233087) [000000B1: 0.00727 3] LEAVE:c System.Exception:set_HResult (int)( [000000B1: 0.00733 2] LEAVE:c System.SystemException:.ctor (string)( [000000B1: 0.00740 2] ENTER:c System.Exception:set_HResult (int)(this:09C00220[System.StackOverflowException mscorlib.dll], -2147023895) [000000B1: 0.00754 2] LEAVE:c System.Exception:set_HResult (int)( [000000B1: 0.00760 1] LEAVE:c System.StackOverflowException:.ctor (string)( [000000B1: 0.00767 0] LEAVE:c (wrapper runtime-invoke) <Module>:runtime_invoke_void__this___object (object,intptr,intptr,intptr)([OBJECT:00000000] 00b1:err:mscoree:ReallyFixupVTable unable to fixup vtable, hr=0, status=1 Assertion failed: 0, file /home/focht/projects/wine/mainline-src-5.7/dlls/mscoree/corruntimehost.c, line 1307
00b1:trace:seh:MSVCRT_raise (22) ... 0009:trace:seh:raise_exception code=c0000005 flags=0 addr=0xf029de90 ip=f029de90 tid=0009 0009:trace:seh:raise_exception info[0]=00000000 0009:trace:seh:raise_exception info[1]=f029de90 0009:trace:seh:raise_exception eax=0032c36c ebx=00110098 ecx=0032bf14 edx=0032bf58 esi=00000000 edi=f029de90 0009:trace:seh:raise_exception ebp=0032c38c esp=0032c340 cs=0023 ds=002b es=002b fs=0063 gs=006b flags=00010216 0009:trace:seh:call_vectored_handlers calling handler at 0x6c631be0 code=c0000005 flags=0
================================================================= Native Crash Reporting ================================================================= Got a UNKNOWN while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application. =================================================================
================================================================= Managed Stacktrace: ================================================================= =================================================================
... 0009:err:seh:setup_exception_record stack overflow 816 bytes in thread 0009 eip f7c7f9b6 esp 00231000 stack 0x230000-0x231000-0x330000 --- snip ---
Same with:
* Wine-Mono 5.1.0 | wine-5.11 * Wine-Mono 5.1.1 | wine-5.19
Snippet from most recent Wine-Mono 5.1.1 (Wine 5.19) with +mscoree debug channel as well:
--- snip --- $ WINEDEBUG=+seh,+loaddll,+mscoree WINE_MONO_TRACE=all wine ./3dsmax.exe
log.txt 2>&1
... 02e4:trace:loaddll:build_module Loaded L"C:\windows\system32\mscoree.dll" at 0A2C0000: builtin 02e4:trace:loaddll:build_module Loaded L"C:\windows\winsxs\x86_microsoft.vc80.mfc_1fc8b3b9a1e18e3b_8.0.50727.42_none_deadbeef\mfcm80u.dll" at 0A290000: native 02e4:trace:loaddll:build_module Loaded L"C:\Program Files\Autodesk\3ds Max 9\stdplugs\mxsdotnet.dlx" at 5B960000: native 02e4:trace:mscoree:DllMain (0A2C0000, 1, 00000000) 02e4:trace:mscoree:_CorDllMain (0A290000, 1, 00000000) 02e4:trace:mscoree:FixupVTableEntry vtable_fixup->type=0x9 02e4:trace:mscoree:FixupVTableEntry vtable_fixup->type=0x9 02e4:trace:mscoree:FixupVTableEntry vtable_fixup->type=0x9 02e4:trace:mscoree:FixupVTableEntry vtable_fixup->type=0x9 02e4:trace:mscoree:FixupVTableEntry vtable_fixup->type=0x9 02e4:trace:mscoree:FixupVTableEntry vtable_fixup->type=0x9 ... 02e4:trace:mscoree:FixupVTableEntry vtable_fixup->type=0x9 02e4:trace:mscoree:FixupVTableEntry vtable_fixup->type=0x9 02e4:trace:mscoree:_CorDllMain (5B960000, 1, 00000000) 02e4:trace:mscoree:FixupVTableEntry vtable_fixup->type=0x9 02e4:trace:mscoree:FixupVTableEntry vtable_fixup->type=0x9 ... 02e4:trace:mscoree:FixupVTableEntry vtable_fixup->type=0x9 02e4:trace:mscoree:ReallyFixupVTable 0A5B6460,5B960000,L"C:\Program Files\Autodesk\3ds Max 9\stdplugs\mxsdotnet.dlx" 02e4:trace:mscoree:CreateConfigStream (L"C:\Program Files\Autodesk\3ds Max 9\stdplugs\mxsdotnet.dlx.config", 0031EB24) 02e4:warn:mscoree:get_runtime_info failed to parse config file L"C:\Program Files\Autodesk\3ds Max 9\stdplugs\mxsdotnet.dlx.config", hr=80070002 02e4:trace:mscoree:CLRMetaHost_GetVersionFromFile L"C:\Program Files\Autodesk\3ds Max 9\stdplugs\mxsdotnet.dlx" 0031ED58 0031EF60 02e4:trace:mscoree:CLRRuntimeInfo_QueryInterface 0A2DF0A8 {bd39d1d2-ba2f-486a-89b0-b4b0cb466891} 0031F1D8 ... 02e4:trace:loaddll:build_module Loaded L"C:\windows\mono\mono-2.0\bin\libmono-2.0-x86.dll" at 0DC30000: native 0370:trace:mscoree:_CorDllMain (0A290000, 2, 00000000) 0370:trace:mscoree:_CorDllMain (5B960000, 2, 00000000) 02e4:trace:mscoree:mono_assembly_preload_hook_fn "mscorlib.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" 02e4:trace:mscoree:LoadLibraryShim (0A2D3538 L"fusion", 00000000, 00000000, 0031E53C) 02e4:trace:mscoree:GetCORVersion (0031E300, 260, 0031E50C)! 02e4:trace:mscoree:CLRRuntimeInfo_QueryInterface 0A2DF0A8 {bd39d1d2-ba2f-486a-89b0-b4b0cb466891} 0031E510 02e4:trace:mscoree:CLRRuntimeInfo_GetVersionString 0A2DF0A8 0031E300 0031E50C 02e4:trace:loaddll:build_module Loaded L"C:\windows\Microsoft.NET\Framework\v2.0.50727\fusion.dll" at 0F2D0000: builtin 0370:trace:seh:NtSetInformationThread (0xfffffffe,38,0xeaafde0,8) 02e4:trace:loaddll:build_module Loaded L"C:\windows\mono\mono-2.0\lib\mono\4.5\mscorlib.dll" at 0F2F0000: native 02e4:trace:mscoree:_CorDllMain (0F2F0000, 1, 00000000) [000002E4: 0.00000 0] ENTER:c (wrapper runtime-invoke) <Module>:runtime_invoke_void__this___object (object,intptr,intptr,intptr)([System.OutOfMemoryException:0E400038], 0031E7BC, 0031E73C, 0F770D48) [000002E4: 0.00003 1] ENTER:c System.OutOfMemoryException:.ctor (string)(this:0E400038[System.OutOfMemoryException 3dsmax.exe], [STRING:0E400010:Out of memory]) [000002E4: 0.00009 2] ENTER:c System.SystemException:.ctor (string)(this:0E400038[System.OutOfMemoryException 3dsmax.exe], [STRING:0E400010:Out of memory]) [000002E4: 0.00033 3] ENTER:c (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr)(00000000, 00000000, 0031E368, 0F771830) [000002E4: 0.00035 4] ENTER:c System.Exception:.cctor ()() ... [000002E4: 0.00136 1] LEAVE:c System.StackOverflowException:.ctor (string)( [000002E4: 0.00137 0] LEAVE:c (wrapper runtime-invoke) <Module>:runtime_invoke_void__this___object (object,intptr,intptr,intptr)([OBJECT:00000000] 0374:trace:mscoree:_CorDllMain (0A290000, 2, 00000000) 0374:trace:mscoree:_CorDllMain (5B960000, 2, 00000000) 0374:trace:seh:NtSetInformationThread (0x438,3,0xf91fecc,4) 0374:trace:seh:NtSetInformationThread (0x438,38,0xf91fd4c,8) 02e4:trace:mscoree:CLRRuntimeInfo_GetRuntimeDirectory 0A2DF0A8 0031EB84 0031ED8C 02e4:trace:mscoree:CLRRuntimeInfo_GetVersionString 0A2DF0A8 0031E74C 0031EB60 02e4:trace:mscoree:RuntimeHost_GetDefaultDomain setting base_dir: C:\Program Files\Autodesk\3ds Max 9, config_path: C:\windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config 02e4:err:mscoree:ReallyFixupVTable unable to fixup vtable, hr=0, status=1 02e4:trace:seh:MSVCRT_raise (22) 02e4:trace:mscoree:_CorDllMain (0F2F0000, 0, 00000001) 02e4:trace:mscoree:_CorDllMain (5B960000, 0, 00000001) 02e4:fixme:msvcrt:__clean_type_info_names_internal (0x5b9d3068) stub 02e4:trace:mscoree:_CorDllMain (0A290000, 0, 00000001) 02e4:fixme:msvcrt:__clean_type_info_names_internal (0xa29fd2c) stub 02e4:trace:mscoree:DllMain (0A2C0000, 0, 00000001) 02e4:err:mscoree:expect_no_runtimes Process exited with a Mono runtime loaded. ... ================================================================= Native Crash Reporting ================================================================= Got a UNKNOWN while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application. =================================================================
================================================================= Managed Stacktrace: ================================================================= ================================================================= ... Assertion failed: 0, file /home/focht/projects/wine/mainline-src-5.19/dlls/mscoree/corruntimehost.c, line 1305 --- snip ---
$ sha1sum 3dsmax9.zip d04eeb0eeabbb7cedaf536170fb6879b2faf1a25 3dsmax9.zip
$ du -sh 3dsmax9.zip 590M 3dsmax9.zip
$ wine --version wine-6.0-rc2
Regards
https://bugs.winehq.org/show_bug.cgi?id=32316
--- Comment #15 from Bruni earns.61@gmail.com --- Anastasius, Microsoft says that debugging an app which requires a lot of memory (>800 MB), as such, may cause OutOfMemoryException:
https://docs.microsoft.com/en-us/archive/blogs/webtopics/troubleshooting-sys...
==quote==
There are two reasons why you might see an OOM condition.
Your process is using a lot of memory (typically over 800MB.) The virtual address space is fragmented, reducing the likelihood that a large, contiguous allocation will succeed. It's also possible to see an OOM condition due to a combination of 1 and 2.
Let's examine some of the common causes for each of these two reasons.
Common Causes of High Memory
When your worker process approaches 800MB in private bytes, your chances of seeing an OOM condition begin to increase simply because the chances of finding a large, contiguous piece of memory within the 2GB address space begin to decrease significantly. Therefore, you want to avoid these high memory conditions.
==quote==
When you're developing and debugging an application, you will typically run with the debug attribute in the web.config file set to true and your DLLs compiled in debug mode. However, before you deploy your application to test or to production, you should compile your components in release mode and set the debug attribute to false.
==quote==
https://bugs.winehq.org/show_bug.cgi?id=32316
--- Comment #16 from Bruni earns.61@gmail.com --- It seems here that all managed OOM exceptions were thrown from constructors.
Could you debug a call to any constructor please?
https://bugs.winehq.org/show_bug.cgi?id=32316
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |NEW
--- Comment #17 from Anastasius Focht focht@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.webbrowserb...
https://github.com/mono/mono/blob/master/mcs/class/System.Windows.Forms/Syst...
--- 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...
But that's just the public interface. The implementation is in 'mxsdotnet.dlx' mixed assembly (contains mixture of .NET and native C++ code).
Regards
https://bugs.winehq.org/show_bug.cgi?id=32316
--- Comment #18 from Anastasius Focht focht@gmx.net --- Hello folks,
--- snip --- [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 ---
Turns out the 'System.NotSupportedException' messages of Mono debug trace ought to be harmless, the exception is expected and *should* be handled in the end.
The relevant piece of code in mixed mode C++ assembly:
--- snip --- internal static unsafe void MXS_dotNet::DotNetObjectWrapper::CreateEventHandlerDelegates([In] DotNetObjectWrapper* obj0, object targetWrapper, MethodInfo mi) { ... try { DotNetObjectWrapper* netObjectWrapperPtr1 = obj0; object target = __calli((__FnPtr<object (IntPtr)>) *(int*) *(int*) netObjectWrapperPtr1)((IntPtr) netObjectWrapperPtr1); DotNetObjectWrapper* netObjectWrapperPtr2 = obj0; System.Type type1 = __calli((__FnPtr<System.Type (IntPtr)>) *(int*) (*(int*) netObjectWrapperPtr2 + 4))((IntPtr) netObjectWrapperPtr2); if (targetWrapper == null || (object) mi == null || (object) type1 == null) return;
System.Type type2 = targetWrapper.GetType(); System.Type returnType1 = mi.ReturnType; BindingFlags bindingAttr = BindingFlags.Static | BindingFlags.Public | BindingFlags.FlattenHierarchy; if (target != null) bindingAttr = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.FlattenHierarchy; foreach (EventInfo eventInfo in type1.GetEvents(bindingAttr)) { System.Type eventHandlerType = eventInfo.EventHandlerType; System.Type returnType2 = eventHandlerType.GetMethod("Invoke").ReturnType; ParameterInfo[] parameters = eventHandlerType.GetMethod("Invoke").GetParameters(); System.Type[] parameterTypes = new System.Type[parameters.Length + 1]; parameterTypes[0] = type2; int index1; for (int index2 = 0; index2 < parameters.Length; index2 = index1) { index1 = index2 + 1; parameterTypes[index1] = parameters[index2].ParameterType; } DynamicMethod dynamicMethod = new DynamicMethod(eventInfo.Name, returnType2, parameterTypes, type2); ILGenerator ilGenerator = dynamicMethod.GetILGenerator(); ilGenerator.Emit(OpCodes.Ldarg_0); ilGenerator.Emit(OpCodes.Ldstr, eventInfo.Name); LocalBuilder local = ilGenerator.DeclareLocal(typeof (object[])); ilGenerator.Emit(OpCodes.Ldc_I4, parameters.Length); ilGenerator.Emit(OpCodes.Newarr, typeof (object)); ilGenerator.Emit(OpCodes.Stloc, local); int num2; for (int index2 = 0; index2 < parameters.Length; index2 = num2) { ilGenerator.Emit(OpCodes.Ldloc, local); ilGenerator.Emit(OpCodes.Ldc_I4, index2); num2 = index2 + 1; ilGenerator.Emit(OpCodes.Ldarg, num2); ilGenerator.Emit(OpCodes.Stelem_Ref); } ilGenerator.Emit(OpCodes.Ldloc, local); ilGenerator.Emit(OpCodes.Callvirt, mi); if ((object) returnType1 == (object) typeof (void)) { if ((object) returnType2 != (object) typeof (void)) ilGenerator.Emit(OpCodes.Ldnull); } else if ((object) returnType2 == (object) typeof (void)) ilGenerator.Emit(OpCodes.Pop); else ilGenerator.Emit(OpCodes.Castclass, returnType2); ilGenerator.Emit(OpCodes.Ret); Delegate @delegate = dynamicMethod.CreateDelegate(eventHandlerType, targetWrapper); try { eventInfo.AddEventHandler(target, @delegate); __calli((__FnPtr<void (IntPtr, event_delegate_pair)>) *(int*) (*(int*) obj0 + 12))((event_delegate_pair) (IntPtr) obj0, (IntPtr) new event_delegate_pair(eventInfo.Name, @delegate)); } catch (Exception ex) { if ((object) ex.InnerException.GetType() != (object) typeof (NotSupportedException)) throw; } } } --- snip ---
The inner try() / catch() block around 'AddEventHandler' is supposed to swallow all exceptions of type 'NotSupportedException' and to rethrow any other.
Looking further we find:
--- snip --- ... [00000138: 1.32092 7] ENTER:c System.Exception:get_InnerException ()(this:0D015828[System.NotSupportedException 3dsmax.exe]) [00000138: 1.32094 7] LEAVE:c System.Exception:get_InnerException ()([OBJECT:00000000] 0138:trace:seh:dispatch_exception code=c0000005 flags=0 addr=0FFE246F ip=0ffe246f tid=0138 0138:trace:seh:dispatch_exception info[0]=00000000 0138:trace:seh:dispatch_exception info[1]=00000000 0138:trace:seh:dispatch_exception eax=00000000 ebx=00000010 ecx=0031de70 edx=00000000 esi=0e41c900 edi=0000005c 0138:trace:seh:dispatch_exception ebp=0031e168 esp=0031df60 cs=0023 ds=002b es=002b fs=0063 gs=006b flags=00010202 0138:trace:seh:call_vectored_handlers calling handler at 0CA303D0 code=c0000005 flags=0 0138:trace:seh:call_vectored_handlers handler at 0CA303D0 returned ffffffff [00000138: 1.32121 7] ENTER:c (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)([System.NullReferenceException:0D015928], 00000000, 0031DBE0, 104C7D58) [00000138: 1.32123 8] ENTER:c System.NullReferenceException:.ctor ()(this:0D015928[System.NullReferenceException 3dsmax.exe]) [00000138: 1.32124 9] ENTER:c System.SystemException:.ctor (string)(this:0D015928[System.NullReferenceException 3dsmax.exe], [STRING:0E3DC320:Object reference not set to an instance of an object.]) ... [00000138:] EXCEPTION handling: System.NullReferenceException: Object reference not set to an instance of an object [00000138: 1.32148 7] ENTER:c System.Runtime.InteropServices.Marshal:GetExceptionPointers ()() [00000138: 1.32154 8] ENTER:c (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)([System.NotImplementedException:0D015AA0], 00000000, 0031DB58, 104C84C8) [00000138: 1.32156 9] ENTER:c System.NotImplementedException:.ctor ()(this:0D015AA0[System.NotImplementedException 3dsmax.exe]) [00000138: 1.32157 10] ENTER:c System.SystemException:.ctor (string)(this:0D015AA0[System.NotImplementedException 3dsmax.exe], [STRING:0E3DC3A0:The method or operation is not implemented.]) --- snip ---
ex.InnerException.GetType() causes another exception 'System.NullReferenceException' because the inner exception object is null.
That one is caught by the outer try() / catch() block:
--- snip --- try { ... } catch (Exception ex1) when (Module.__CxxExceptionFilter((void*) Marshal.GetExceptionPointers(), (void*) &Module.FAVMAXScriptException, 8, (void*) 0) != 0) { uint num2 = 0; Module.__CxxRegisterExceptionObject((void*) Marshal.GetExceptionPointers(), (void*) num1); try { try { Module._CxxThrowException((void*) 0, (_s__ThrowInfo*) 0); return; } --- snip ---
Well, not really. Wine-Mono doesn't implement 'System.Runtime.InteropServices.Marshal.GetExceptionPointers' causing a another exception seen as 'System.NotImplementedException', leaking to the outside.
https://github.com/mono/mono/blob/85056b086f950799b79a8f999e9a3edd406b0785/m...
Related discussion in:
https://github.com/dotnet/standard/issues/870
But that's a follow-up/secondary problem which becomes a non-issue when the root cause is fixed.
---
The explanation why the sequence works with native .NET Framework is that there has to be another try() / catch() clause in between which wraps 'NotSupportedException' in another exception object to become the inner exception. Wine-Mono doesn't do this.
System.Reflection.EventInfo -> AddEventHandler System.Reflection.(Runtime)MethodInfo -> Invoke
https://github.com/mono/mono/blob/40372422e7bfa506e6a93fd06e9315513d9341c6/m...
--- snip --- public override Object Invoke (Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) { if (!IsStatic) { if (!DeclaringType.IsInstanceOfType (obj)) { if (obj == null) throw new TargetException ("Non-static method requires a target."); else throw new TargetException ("Object does not match target type."); } }
if (binder == null) binder = Type.DefaultBinder;
/*Avoid allocating an array every time*/ ParameterInfo[] pinfo = GetParametersInternal (); ConvertValues (binder, parameters, pinfo, culture, invokeAttr);
if (ContainsGenericParameters) throw new InvalidOperationException ("Late bound operations cannot be performed on types or methods for which ContainsGenericParameters is true.");
Exception exc; object o = null;
if ((invokeAttr & BindingFlags.DoNotWrapExceptions) == 0) { try { o = InternalInvoke (obj, parameters, out exc); } catch (ThreadAbortException) { throw; #if MOBILE } catch (MethodAccessException) { throw; #endif #if NETCORE } catch (Mono.NullByRefReturnException) { throw new NullReferenceException (); #endif } catch (OverflowException) { throw; } catch (Exception e) { throw new TargetInvocationException (e); } } else { #if NETCORE try { o = InternalInvoke (obj, parameters, out exc); } catch (Mono.NullByRefReturnException) { throw new NullReferenceException (); } #else o = InternalInvoke (obj, parameters, out exc); #endif }
if (exc != null) throw exc; return o; } --- snip ---
'InternalInvoke' is wrapped in try() / catch () block which wraps any non-critical exception in a 'TargetInvocationException'. It calls it with 'TargetInvocationException(System.Exception inner)' ctor which is exactly what is needed here.
Why isn't 'Invoke' getting called?
https://github.com/mono/mono/blob/f89fdf28a327e8c99e0110f47a1cc17c5bc5eebb/m...
--- snip --- public virtual void AddEventHandler (object target, Delegate handler) { // this optimization cause problems with full AOT // see bug https://bugzilla.xamarin.com/show_bug.cgi?id=3682 #if FULL_AOT_RUNTIME MethodInfo add = GetAddMethod (); if (add == null) throw new InvalidOperationException (SR.InvalidOperation_NoPublicAddMethod); if (target == null && !add.IsStatic) throw new TargetException ("Cannot add a handler to a non static event with a null target"); add.Invoke (target, new object [] {handler}); #else if (cached_add_event == null) { MethodInfo add = GetAddMethod (); if (add == null) throw new InvalidOperationException (SR.InvalidOperation_NoPublicAddMethod);
if (add.DeclaringType.IsValueType) { if (target == null && !add.IsStatic) throw new TargetException ("Cannot add a handler to a non static event with a null target"); add.Invoke (target, new object [] {handler}); return; } cached_add_event = CreateAddEventDelegate (add); } //if (target == null && is_instance) // throw new TargetException ("Cannot add a handler to a non static event with a null target"); cached_add_event (target, handler); #endif } --- snip ---
We are in the "else" part (not FULL_AOT_RUNTIME), and 'CreateAddEventDelegate' gets called which doesn't do any further exception wrapping on its own.
--- quote --- The idea behing this optimization is to use a pair of delegates to simulate the same effect of doing a reflection call. The first delegate performs casting and boxing, the second dispatch to the add_... method. --- quote ---
That's about it.
Regards
https://bugs.winehq.org/show_bug.cgi?id=32316
--- Comment #19 from Bruni earns.61@gmail.com --- Anastasius Thank you for your hard work!
Got a working test case.
The essense is that the bug can be unvealed by detecting the method name which threw exceptions when AddEventHandler was called with null target parameter.
There is clear difference between Mono and .NET behavior - the former throw Exception in CreateAddEventDelegate whereas the latter do it in Invoke method.
Compiled with Microsoft csc.exe, it prints "testcase passed" Compiled and run by means of Mono, it prints "testcase failed" and stops running.
using System; using System.Text; using System.Reflection; using System.Diagnostics;
namespace AddEventHandlerTestCase { class Program { public event Func<string> TestEvent;
public string TestMethod() { return "Hello World"; }
public void Test() { if (TestEvent != null) Console.WriteLine(TestEvent()); }
static void Main(string[] args) { var p = new Program(); EventInfo eventInfo = p.GetType().GetEvent("TestEvent"); var methodInfo = p.GetType().GetMethod("TestMethod"); Delegate handler = Delegate.CreateDelegate(eventInfo.EventHandlerType, p, methodInfo); try { eventInfo.AddEventHandler(null, handler);
} catch (Exception e) { if (!e.StackTrace.Contains("System.Reflection.RuntimeMethodInfo.Invoke")) { Console.WriteLine("testcase failed"); Debugger.Break(); } else { Console.WriteLine("testcase passed"); Console.ReadLine(); } } } } }
https://bugs.winehq.org/show_bug.cgi?id=32316
--- Comment #20 from Esme Povirk madewokherd@gmail.com --- Uh, doing a string check on a stack trace is just checking implementation details. It's a different implementation, so that sort of thing is expected. An actual test case would show the important difference in behavior.
https://bugs.winehq.org/show_bug.cgi?id=32316
--- Comment #21 from Bruni earns.61@gmail.com --- Esme, please take a look at a new testcase. It passes on native .NET but fails on Mono
Thanks!
using System; using System.Reflection; using System.Diagnostics;
namespace AddEventHandlerTestCase { class Program { private MulticastDelegate m_MulticastDelegate = null; public delegate void DelegateFunction(int iValue); public event DelegateFunction EventSource { add { throw new NotSupportedException(); } remove { } }
public void TestMethod(int i) { }
static void Main(string[] args) { var p = new Program(); EventInfo eventInfo = p.GetType().GetEvent("EventSource"); var methodInfo = p.GetType().GetMethod("TestMethod"); Delegate handler = Delegate.CreateDelegate(eventInfo.EventHandlerType, p, methodInfo);
try { eventInfo.AddEventHandler(p, handler); } catch (NotSupportedException e) { Console.WriteLine("Testcase failed"); Console.WriteLine("NotSupportedException has been catched and it is not wrapped by "); Console.WriteLine("TargetInvocationException"); Console.WriteLine("TargetInvocationException was expected as NotSupportedException "); Console.WriteLine("was thrown in an event accessor method invoked through reflection."); Console.WriteLine("See ");
Console.WriteLine("docs.microsoft.com/en-us/search/?terms=TargetInvocationException"); Console.WriteLine("Stacktrace:" + e.StackTrace.ToString()); Debugger.Break(); } catch (TargetInvocationException e) { Console.WriteLine("Testcase passed"); string eInnerExceptionText = e.InnerException.ToString(); string[] exceptionlines = eInnerExceptionText.Split(new[] { Environment.NewLine }, StringSplitOptions.None);
Console.WriteLine("TargetInvocationException has been catched and has inner exception."); Console.WriteLine("Inner exception has a type of " + e.InnerException.GetType()); Console.WriteLine("Inner exception object was created by:" + exceptionlines[1]); Console.WriteLine("Stacktrace:" + e.StackTrace.ToString()); Console.ReadLine(); } } } }
https://bugs.winehq.org/show_bug.cgi?id=32316
--- Comment #22 from Esme Povirk madewokherd@gmail.com --- Taking a fresh look at this; there's a lot here and I've been having trouble finding the important parts.
So, it sounds like the problem isn't necessarily which codepath we take, or really the optimization. The problem is that the optimized codepath in EventInfo.AddEventHandler doesn't wrap exceptions as an actual Invoke would.
RuntimePropertyInfo.GetValue appears to be a similar situation, where they have the same sort of optimization, with a try/catch to wrap exceptions. So presumably we can fix this upstream in a similar way.
https://bugs.winehq.org/show_bug.cgi?id=32316
--- Comment #23 from Bruni earns.61@gmail.com ---
So presumably we can fix this upstream in a similar way.
Thank you.
It looks like there is a need to report the issue on Mono github bug tracker with the second test case or they stay unaware of this problem.
Will you open a corresponding bug on the Mono side?
https://bugs.winehq.org/show_bug.cgi?id=32316
--- Comment #24 from Esme Povirk madewokherd@gmail.com --- I have made a pull request to Mono which should fix this behavior: https://github.com/mono/mono/pull/20688
https://bugs.winehq.org/show_bug.cgi?id=32316
--- Comment #25 from Bruni earns.61@gmail.com --- AddHandlerShouldWrapExceptions test seems fragile.
Look at Assert.AreEqual (typeof (Exception), e.InnerException.GetType ());
If Mono (extremally unlikely, but nonotheless) raises inner system exception during this test it will be considered passed.
Maybe it's worth using more specific exception class?
https://bugs.winehq.org/show_bug.cgi?id=32316
--- Comment #26 from Esme Povirk madewokherd@gmail.com --- Any exception raised by the runtime should be more specific than just Exception.
https://bugs.winehq.org/show_bug.cgi?id=32316
--- Comment #27 from Bruni earns.61@gmail.com ---
Any exception raised by the runtime should be more specific than just Exception.
Yes, hence `catch (Exception ex)` won't ignore RuntimeException and will handle it like it's a normal-execution-flow (of course, this isn't the case).
Perhaps it's expedient to replace `Exception` with `ArgumentException` in the lines Nos. 115 and 188 in your patch.
BTW, could you please remove the lines Nos. 106-110 from your patch to EventInfo.cs and bring the line no. 102 back, so that we see the result against Mono testbox?
Those lines are seemingly not under test.
https://bugs.winehq.org/show_bug.cgi?id=32316
--- Comment #28 from Bruni earns.61@gmail.com ---
Yes, hence `catch (Exception ex)` won't ignore RuntimeException and will handle it like it's a normal-execution-flow (of course, this isn't the case).
My bad.
e.InnerException.GetType will only match pure Exception class, you're right here.
https://bugs.winehq.org/show_bug.cgi?id=32316
--- Comment #29 from Esme Povirk madewokherd@gmail.com --- This should be fixed in Wine 6.10 with Wine Mono 6.2.0 and could use a retest.
https://bugs.winehq.org/show_bug.cgi?id=32316
--- Comment #30 from Esme Povirk madewokherd@gmail.com --- Retested, still doesn't start. With Wine 6.10/Wine Mono 6.2.0, I get an assertion failure:
* Assertion at /vagrant/mono/mono/metadata/cominterop.c:608, condition `MONO_HANDLE_GETVAL (obj, iunknown)' not met
Followed by a managed stacktrace: at <unknown> <0xffffffff> at System.Object:__icall_wrapper_cominterop_get_interface <0x00012> at IDispatch:Invoke <0x00033> at IDispatch:Invoke <0x0006f> at ActiveXImpl:GetAmbientProperty <0x0019f> at ActiveXImpl:SetClientSite <0x0022f> at ActiveXImpl:SetClientSite <0x00073> at System.Windows.Forms.Control:System.Windows.Forms.UnsafeNativeMethods.IOleObject.SetClientSite <0x00037> at IOleObject:SetClientSite <0x0005f> at IOleObject:SetClientSite <0x00123> at <unknown> <0xffffffff> at <Module>:COleControlSite.CreateOrLoad <0x00012> at <Module>:Microsoft.VisualC.MFC.CWinFormsControlSite.CreateOrLoad <0x00277> at <Module>:Microsoft.VisualC.MFC.CWinFormsControlSite.CreateOrLoad <0x0004b> at <unknown> <0xffffffff> at <Module>:COleControlSite.CreateControlCommon <0x00012> at <Module>:Microsoft.VisualC.MFC.CWinFormsControlSite.CreateControlCommon <0x00073> at <Module>:Microsoft.VisualC.MFC.CWinFormsControlSite.CreateControlCommon <0x00093> at <unknown> <0xffffffff> at <Module>:CWnd.CreateControl <0x00012> at <Module>:Microsoft.VisualC.MFC.CWinFormsControlSystem::Windows::Forms::Control.CreateManagedControl <0x002b7> at <Module>:MXS_dotNet.CDotNetHostWnd.Create <0x0060b> at <Module>:MXS_dotNet.CDotNetHostWnd.Create <0x00087>
https://bugs.winehq.org/show_bug.cgi?id=32316
--- Comment #31 from Esme Povirk madewokherd@gmail.com --- Before the crash, we get a NullReferenceException in System.Windows.Forms.Control/ActiveXImpl.SetClientSite. It turns out this is caused by an attempt to cast a null object to bool. The null object comes from GetAmbientProperty, which gets it from winforms' UnsafeNativeMethods.IDispatch interface, which uses this:
6936 [Out, MarshalAs(UnmanagedType.LPArray)] 6937 object[] pVarResult,
So, I'm guessing this should marshal as a VARIANT array, and Mono is getting it wrong somehow.
https://bugs.winehq.org/show_bug.cgi?id=32316
--- Comment #32 from Esme Povirk madewokherd@gmail.com --- I made a winforms update to work around the object[] marshaling failure: https://github.com/madewokherd/winforms/commit/4f8a74382d9d1b79445350a1fa57f...
Then it asserted because winforms does something nonsensical, so I pushed another work-around: https://github.com/madewokherd/winforms/commit/f2ba6171aef54d8897baba0e0cb23...
With these changes, the program starts for me.
https://bugs.winehq.org/show_bug.cgi?id=32316
--- Comment #33 from Esme Povirk madewokherd@gmail.com --- If anyone still cares about this, an MSI build will be available at https://github.com/madewokherd/wine-mono/actions/runs/916221102 once the automated build finishes.
https://bugs.winehq.org/show_bug.cgi?id=32316
--- Comment #34 from Bruni earns.61@gmail.com --- (In reply to Esme Povirk from comment #32)
I made a winforms update to work around the object[] marshaling failure: https://github.com/madewokherd/winforms/commit/ 4f8a74382d9d1b79445350a1fa57f098df45e1ec [...]
Thank you.
I didn't run it under debugger, it looks like this failure is also cured with the patch by g-insn from https://github.com/mono/mono/pull/20876/files
https://bugs.winehq.org/show_bug.cgi?id=32316
Aaron Franke arnfranke@yahoo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC|arnfranke@yahoo.com |
https://bugs.winehq.org/show_bug.cgi?id=32316
--- Comment #35 from Esme Povirk madewokherd@gmail.com --- That PR was already applied in Wine Mono, it only implements marshaling object arrays as inputs to pinvokes, for this we need outputs.
https://bugs.winehq.org/show_bug.cgi?id=32316
Esme Povirk madewokherd@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |451a54bc7a77b8b816f28ad1c61 | |5745e650586ae Status|NEW |RESOLVED Resolution|--- |FIXED
--- Comment #36 from Esme Povirk madewokherd@gmail.com --- Fixed in Wine Mono 6.3.0.
https://bugs.winehq.org/show_bug.cgi?id=32316
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #37 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 6.14.