https://bugs.winehq.org/show_bug.cgi?id=49634
Bug ID: 49634 Summary: .NET Framework exe crashes on DllImport on Wine 5.13, works on 5.0.1 Product: Wine Version: 5.13 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: critical Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: tijs@familiebeek.eu Distribution: ---
Created attachment 67826 --> https://bugs.winehq.org/attachment.cgi?id=67826 Checks OS version
When running "VersionCheckerPlus.exe" which uses code from https://github.com/northwood-studios/NorthwoodLib/pull/9, wine crashes with this message:
https://media.discordapp.net/attachments/727217050807828550/7380226161741660...
https://bugs.winehq.org/show_bug.cgi?id=49634
tijs@familiebeek.eu changed:
What |Removed |Added ---------------------------------------------------------------------------- Severity|critical |major
https://bugs.winehq.org/show_bug.cgi?id=49634
--- Comment #1 from Esme Povirk madewokherd@gmail.com --- This might be bug 49626. Can you get a log with WINEDEBUG=+loaddll,+module?
https://bugs.winehq.org/show_bug.cgi?id=49634
Esme Povirk madewokherd@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |madewokherd@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=49634
Jactry Zeng jactry92@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jactry92@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=49634
--- Comment #2 from tijs@familiebeek.eu --- Created attachment 67827 --> https://bugs.winehq.org/attachment.cgi?id=67827 Debugging of VersionTesterPlus.exe
https://bugs.winehq.org/show_bug.cgi?id=49634
Esme Povirk madewokherd@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |DUPLICATE
--- Comment #3 from Esme Povirk madewokherd@gmail.com --- 0024:trace:loaddll:build_module Loaded L"Z:\home\tijs\Downloads\ntdll.dll" at 022E0000: builtin
Loading ntdll from somewhere other than system32 means it's the same bug.
*** This bug has been marked as a duplicate of bug 49626 ***
https://bugs.winehq.org/show_bug.cgi?id=49634
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #4 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- Closing Duplicate.
https://bugs.winehq.org/show_bug.cgi?id=49634
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|.NET Framework exe crashes |VersionCheckerPlus (.NET |on DllImport on Wine 5.13, |4.0 app) crashes with |works on 5.0.1 |'NorthwoodLib.OperatingSyst | |em threw an exception. | |Could not load type | |System.Runtime.InteropServi | |ces.OSPlatform' since Wine | |5.12 Version|5.13 |5.12 Regression SHA1| |8a169390c9ef4d8a43b604558c4 | |194a052473c0c Keywords| |dotnet, regression CC| |focht@gmx.net Severity|major |normal Component|-unknown |ntdll
--- Comment #5 from Anastasius Focht focht@gmx.net --- Hello folks,
filling some fields.
The regression was introduced by commit https://source.winehq.org/git/wine.git/commitdiff/8a169390c9ef4d8a43b604558c... ("ntdll: Build with msvcrt.").
Tested with example app from attachment.
--- snip --- $ wine --version wine-5.11-235-g8a169390c9e
$ wine ./VersionTesterPlus.exe ... 0024:err:eventlog:ReportEventW L"Application: VersionTesterPlus.exe\nFramework Version: v4.0.30319\nDescription: The process was terminated due to an unhandled exception.\nException Info: System.TypeInitializationException\nStack:\n at VersionTester.Program.Main(System.String[])\n" 0024:fixme:advapi:DeregisterEventSource (0xcafe4242) stub
Unhandled Exception: System.TypeInitializationException: The type initializer for 'NorthwoodLib.OperatingSystem' threw an exception. ---> System.TypeLoadException: Could not load type 'System.Runtime.InteropServices.OSPlatform' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. at NorthwoodLib.OperatingSystem..cctor() --- End of inner exception stack trace --- at VersionTester.Program.Main(String[] args) wine: Unhandled exception 0xe0434352 in thread 24 at address 7B00E9E1 (thread 0024), starting debugger... --- snip ---
Regards
https://bugs.winehq.org/show_bug.cgi?id=49634
nyanpasu64@tuta.io changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |nyanpasu64@tuta.io
--- Comment #6 from nyanpasu64@tuta.io --- This bug is not fixed. On Wine 7.0 with .NET 4.7.2 (I think) installed, I get an identical error:
Unhandled Exception: 0164:fixme:ver:GetCurrentPackageId (000000000011A440 0000000000000000): stub Unhandled Exception: System.TypeInitializationException: The type initializer for 'NorthwoodLib.OperatingSystem' threw an exception. ---> System.TypeLoadException: Could not load type 'System.Runtime.InteropServices.OSPlatform' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. at NorthwoodLib.OperatingSystem..cctor() --- End of inner exception stack trace --- at VersionTester.Program.Main(String[] args) wine: Unhandled exception 0xe0434352 in thread 164 at address 000000007B0123AE (thread 0164), starting debugger... ... Backtrace: =>0 0x000000007b0123ae AccessCheckByTypeAndAuditAlarmW+0x113ae() in kernelbase (0x000000000011f000) 1 0x0000000000fc043a EntryPoint+0x19a8da() in clr (0x000000000011f000) 2 0x0000000000ff99db EntryPoint+0x1d3e7b() in clr (0x000000000011f000) 3 0x0000000000ff9a34 EntryPoint+0x1d3ed4() in clr (0x000000000011f000) 4 0x0000000001199675 EntryPoint+0x373b15() in clr (0x000000000011f000) 5 0x0000000000fa0066 EntryPoint+0x17a506() in clr (0x000000000011f000) 0x000000007b0123ae kernelbase+0x123ae: nop
AccessCheckByTypeAndAuditAlarmW+0x113ae looks like a large enough offset that the actual code causing the crash is unrelated to AccessCheckByTypeAndAuditAlarmW.
----
This error message is also causing msbuild to crash on startup, also at AccessCheckByTypeAndAuditAlarmW+0x113ae:
C:\Program Files (x86)\Microsoft Visual Studio\Installer>msbuild MSBUILD : error MSB1025: An internal failure occurred while running MSBuild. System.TypeLoadException: Could not load type 'System.Runtime.InteropServices.OSPlatform' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. at Microsoft.Build.Shared.BuildEnvironmentHelper.get_Instance() at Microsoft.Build.Utilities.Traits.get_Instance() at Microsoft.Build.CommandLine.MSBuildApp.Execute(String commandLine)
Unhandled Exception: System.TypeLoadException: Could not load type 'System.Runtime.InteropServices.OSPlatform' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. at Microsoft.Build.Shared.BuildEnvironmentHelper.get_Instance() at Microsoft.Build.Utilities.Traits.get_Instance() at Microsoft.Build.Shared.Debugging.DebugUtils..cctor() Unhandled exception: 0xe0434352 in 64-bit code (0x000000007b0123ae). ... Backtrace: =>0 0x000000007b0123ae AccessCheckByTypeAndAuditAlarmW+0x113ae() in kernelbase (0x000000000041ef00) 1 0x0000000000f12105 EntryPoint+0x20665() in clr (0x000000000041ef00) 2 0x000000000105d796 EntryPoint+0x16bcf6() in clr (0x000000000041ef00) 0x000000007b0123ae kernelbase+0x123ae: nop
A bug report is at https://github.com/paleozogt/MSVCDocker/issues/13, but it doesn't mention the stack trace.
----
Sidenote: what's the recommended .NET version for running managed apps on Wine? Wine Mono, .NET 4.{6,7,8}, or .NET Core?