http://bugs.winehq.org/show_bug.cgi?id=37076
Bug ID: 37076 Summary: Silent Hunter 5 crashes after showing the intro video with Wine Mono Product: Wine Version: 1.7.24 Hardware: x86 OS: Linux Status: NEW Severity: normal Priority: P2 Component: mscoree Assignee: wine-bugs@winehq.org Reporter: gyebro69@gmail.com
Created attachment 49276 --> http://bugs.winehq.org/attachment.cgi?id=49276 terminal output
Game version is v1.2, installed on Steam, the game uses Ubisoft Game Launcher (Uplay). Dwrite.dll and Steam gameoverlayrenderer disabled, native d3dx9_42 and d3dcompiler_43 are installed to work around an early crash on launch.
After showing the intro movies the game throws an exception:
Unhandled Exception: System.InvalidProgramException: Invalid IL code in<Module>:ScriptedEntityHelper.LoadScriptFromFile (ScriptedEntityHelper*,sScriptedEntity*,sbyte*,sbyte*): IL_0040: ret at (wrapper native-to-managed) <Module>.ScriptedEntityHelper.LoadScriptFromFile (ScriptedEntityHelper*,sScriptedEntity*,sbyte*,sbyte*) <0x0003b>
[ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidProgramException: Invalid IL code in <Module>:ScriptedEntityHelper.LoadScriptFromFile (ScriptedEntityHelper*,sScriptedEntity*,sbyte*,sbyte*): IL_0040: ret at (wrapper native-to-managed) <Module>.ScriptedEntityHelper.LoadScriptFromFile (ScriptedEntityHelper*,sScriptedEntity*,sbyte*,sbyte*) <0x0003b>
'winetricks dotnet20' is sufficient to get rid of the crash and the game loads fine to the menu.
http://bugs.winehq.org/show_bug.cgi?id=37076
--- Comment #1 from Béla Gyebrószki gyebro69@gmail.com --- Created attachment 49277 --> http://bugs.winehq.org/attachment.cgi?id=49277 +mscoree log
https://bugs.winehq.org/show_bug.cgi?id=37076
--- Comment #2 from Vincent Povirk madewokherd@gmail.com --- MS's Managed C++ compiler has been known to generate unreachable ret instructions with the stack empty, which is technically invalid but .NET copes with it. I don't know if that's the case here. We have a hack for this in Wine Mono, but it may be incomplete.
The code from that method might be useful, but I don't know an easy way to extract it.
https://bugs.winehq.org/show_bug.cgi?id=37076
Béla Gyebrószki gyebro69@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Depends on| |38134
https://bugs.winehq.org/show_bug.cgi?id=37076 Bug 37076 depends on bug 38134, which changed state.
Bug 38134 Summary: Uplay v5.x: can't log in (Uplay hangs with the login screen) https://bugs.winehq.org/show_bug.cgi?id=38134
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED
https://bugs.winehq.org/show_bug.cgi?id=37076
--- Comment #3 from Béla Gyebrószki gyebro69@gmail.com --- Still present in 1.8-rc1 and Wine Mono 4.5.6 installed.
https://bugs.winehq.org/show_bug.cgi?id=37076
--- Comment #4 from Béla Gyebrószki gyebro69@gmail.com --- The problem remains in wine-1.9.11-185-gf426ece and Wine Mono 4.6.3 installed.
https://bugs.winehq.org/show_bug.cgi?id=37076
mo78@abv.bg changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mo78@abv.bg
--- Comment #5 from mo78@abv.bg --- With Wine 4.14 updated Mono engine the bug is still here.
https://bugs.winehq.org/show_bug.cgi?id=37076
--- Comment #6 from Vincent Povirk madewokherd@gmail.com --- Tried with Proton and Wine Mono from master branch (not the 4.9 branch). I didn't see the InvalidProgramException, but the patcher complained a lot to OutputDebugString, and the game didn't start.
https://bugs.winehq.org/show_bug.cgi?id=37076
--- Comment #7 from Vincent Povirk madewokherd@gmail.com --- It seems I'm just running into unrelated issues getting uplay to start the game.
https://bugs.winehq.org/show_bug.cgi?id=37076
--- Comment #8 from Vincent Povirk madewokherd@gmail.com --- Created attachment 65091 --> https://bugs.winehq.org/attachment.cgi?id=65091 IL disassembly
I was able to reproduce the crash. Attaching disassembled IL code for reference.
https://bugs.winehq.org/show_bug.cgi?id=37076
--- Comment #9 from Vincent Povirk madewokherd@gmail.com --- It seems to me that IL_0040 is reachable and the branches to it have an empty stack, as they should, but the stack is not empty when reached via the previous instruction. I guess .NET must accept this code, and since it's a void function I guess it can just return, but it may be difficult to make Mono's JIT accept this.
https://bugs.winehq.org/show_bug.cgi?id=37076
--- Comment #10 from Vincent Povirk madewokherd@gmail.com --- Fix pushed: https://github.com/madewokherd/mono/commit/4cd5acad93692f011e6040f2233dd4d94...
This gets it to the menu, but now it crashes when starting a campaign.
================================================================= Managed Stacktrace: ================================================================= at <unknown> <0xffffffff> at <Module>:sprintf_s <0x00012> at <Module>:AllocString <0x000db> at SimExternalData.CUserProfileCareerHistory_Wrap:HasPlayerPlayedCampaign <0x00023>
Some varargs-related issue perhaps.
https://bugs.winehq.org/show_bug.cgi?id=37076
--- Comment #11 from Vincent Povirk madewokherd@gmail.com --- sprintf_s is a vararg cdecl pinvoke function.
https://bugs.winehq.org/show_bug.cgi?id=37076
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |z.figura12@gmail.com
--- Comment #12 from Zebediah Figura z.figura12@gmail.com --- (In reply to Vincent Povirk from comment #10)
Fix pushed: https://github.com/madewokherd/mono/commit/ 4cd5acad93692f011e6040f2233dd4d940189abc
This also helps PUBG Lite Launcher under wine-mono.
================================================================= Managed Stacktrace: ================================================================= at <unknown> <0xffffffff> at <Module>:sprintf_s <0x00012> at <Module>:AllocString <0x000db> at SimExternalData.CUserProfileCareerHistory_Wrap:HasPlayerPlayedCampaign <0x00023>
Some varargs-related issue perhaps.
I'll file a new bug for this, unless you object.
https://bugs.winehq.org/show_bug.cgi?id=37076
--- Comment #13 from Esme Povirk madewokherd@gmail.com --- Did we ever get a new bug for the sprintf_s crash? Wine Mono 6.2.0 has a fix for varargs pinvoke methods, which may help here, but I had trouble retesting because uplay.
https://bugs.winehq.org/show_bug.cgi?id=37076
Neko-san nekoNexus@protonmail.ch changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |nekoNexus@protonmail.ch
https://bugs.winehq.org/show_bug.cgi?id=37076
Esme Povirk madewokherd@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |madewokherd@gmail.com