https://bugs.winehq.org/show_bug.cgi?id=48700
Bug ID: 48700 Summary: Wolcen: Lords of Mayhem - there's a blob around the character's head. Product: Wine Version: 5.3 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: mo78@abv.bg Distribution: ---
Created attachment 66575 --> https://bugs.winehq.org/attachment.cgi?id=66575 Wolcen Lords of Mayhem Wine log
There's an "afro" blob around the character's head. I tried different settings and different Wine versions, with or without DXVK to no avail. Please tell me what kind of logs do you need and I'll provide them. Thank you.
https://i.imgur.com/0dhoxKt.png https://i.imgur.com/mTz2PPL.png https://i.imgur.com/525jisv.png https://i.imgur.com/zYObSAU.png https://i.imgur.com/qTXGVeu.png
https://bugs.winehq.org/show_bug.cgi?id=48700
Pekka Helenius fincer89@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |fincer89@hotmail.com
https://bugs.winehq.org/show_bug.cgi?id=48700
--- Comment #1 from Pekka Helenius fincer89@hotmail.com --- Thanks for adding the bug issue.
Happens here, too.
Related GitHub discussion: https://github.com/ValveSoftware/Proton/issues/496#issuecomment-586411984
https://bugs.winehq.org/show_bug.cgi?id=48700
yaogen winehq@yaogen.se changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |winehq@yaogen.se
--- Comment #2 from yaogen winehq@yaogen.se --- I can confirm that this happens for me as well.
$ uname -a Linux ... 5.4.10-arch1-1 #1 SMP PREEMPT ... x86_64 GNU/Linux
Related DXVK issue (that rules out DXVK) https://github.com/doitsujin/dxvk/issues/1452
https://bugs.winehq.org/show_bug.cgi?id=48700
Paul Gofman gofmanp@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |gofmanp@gmail.com
--- Comment #3 from Paul Gofman gofmanp@gmail.com --- Created attachment 66590 --> https://bugs.winehq.org/attachment.cgi?id=66590 POC patch (introduces memory leak by refusing to free small memory blocks)
I've tested the game.
The game seems to do good old use after free on some pointers. The attached proof of concept tweak fixes the issues for me (tested on initial character creation screen only). Please note that the patch just skips the free of small sized memory blocks and thus introduces stable memory leak.
This doesn't look like something triggered by Wine specifics as exactly the same graphical issue is reproducible on Windows if to run program with Windows debug heap. E. g., if the program is started from any debugger, the same glitch is in place. If to set _NO_DEBUG_HEAP environment variable the glitch is not there even if the program is started from debugger, so it looks like it is debug heap that makes the difference on Windows.
The problem doesn't look fixable under Wine, Wine heap implementation is different from Windows in details and Wine is unlikely going to ever reproduce the Windows heap layout and allocate / free algorithms exactly.
Maybe game developers would fix the use after free in game, as it is something I guess they definitely want to fix even if this happens to work now on currently supported Windows versions. I suppose running the program under something like Valgrind or just build with MSVC debug heap would immediately reproduce the glitch and possibly allow to pinpoint use after free location.
https://bugs.winehq.org/show_bug.cgi?id=48700
mo78@abv.bg changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mo78@abv.bg
--- Comment #4 from mo78@abv.bg --- Thank you Mr. Gofman! How severe is the memory leak?
https://bugs.winehq.org/show_bug.cgi?id=48700
--- Comment #5 from Paul Gofman gofmanp@gmail.com --- (In reply to mo78 from comment #4)
How severe is the memory leak?
No idea how often it is going to allocate small memory blocks through HeapAlloc during gameplay. There are endless possibilities to improve this terrible hack to make it more usable with this game, but frankly I am not much interested to do that as it doesn't look it will result in an acceptable fix regardless.
Maybe it worth to file a bug to game's bug tracker or support explaining the issue, I suppose if it gets noticed by any developer there it will get attention as the problem looks unfortunate absolutely regardless of Linux / Wine, even if it did not detected as a problem for Windows users yet. No programmer wants to keep use after free in his program as it may fire in some unexpected and hard to debug way.
https://bugs.winehq.org/show_bug.cgi?id=48700
--- Comment #6 from mo78@abv.bg --- Thank you very much once again :)
https://bugs.winehq.org/show_bug.cgi?id=48700
--- Comment #7 from yaogen winehq@yaogen.se --- Thank you so much for your efforts Paul. At least we can now rule out another question mark. Wasn't aware of the same glitch on Windows. Seems (as you suggest) the fix have to come from the developers of the game itself. (sometimes time constraints force developers to cut too many corners, eh?) :-)
https://bugs.winehq.org/show_bug.cgi?id=48700
--- Comment #8 from mo78@abv.bg --- I filed a bug, so we'll wait devs to fix this problem.
https://bugs.winehq.org/show_bug.cgi?id=48700
--- Comment #9 from yaogen winehq@yaogen.se --- I tried to as well, but it didn't show up. Where is your bug report?
https://bugs.winehq.org/show_bug.cgi?id=48700
--- Comment #10 from mo78@abv.bg --- Here it is:
https://wolcengame.com/forum/bugs-issues/bug-reports/free-bug-in-the-game-co...
https://bugs.winehq.org/show_bug.cgi?id=48700
--- Comment #11 from Paul Gofman gofmanp@gmail.com --- (In reply to yaogen from comment #7)
Wasn't aware of the same glitch on Windows.
Please don’t get me wrong, there is no same glitch on Windows I could reproduce if to run the game normally. There are special means how you can trigger that behaviour on Windows and I described that details for an indication that the mentioned use after free is unlikely originates from some Wine code or triggered by some Wine code. Looks like it works on Windows (without forcing the use of debug heap in some way) because the consequent allocations happen not to touch the freed memory block long enough. That’s impossible with debug heap as it intentionally fills the memory with special values on free. Wine does not clear the freed memory but heap allocation algorithm is different and it may result in memory being overwritten sooner.
https://bugs.winehq.org/show_bug.cgi?id=48700
hash HASH.DuOrden@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |HASH.DuOrden@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=48700
--- Comment #12 from mo78@abv.bg --- Hello Paul, I can't compile Wine with this patch. I can compile vanilla Wine, Wine-Staging, Wine with other patches but with this one it fails. It happens for the first time to me. Can you help with any advice or prepped build with Vulkan support?
https://bugs.winehq.org/show_bug.cgi?id=48700
--- Comment #13 from mo78@abv.bg --- The error is always:
../../dlls/winecrt0/libwinecrt0.a ../../libs/port/libwine_port.a -lpthread -lunwind /usr/bin/ld: heap.o: in function `RtlFreeHeap': /home/mozo/wine64/dlls/ntdll/../../../wine-git/dlls/ntdll/heap.c:1783: undefined reference to `leave_critical_section' collect2: error: ld returned 1 exit status winegcc: /usr/bin/gcc failed make[1]: *** [Makefile:1222: ntdll.dll.so] Error 2 make[1]: Leaving directory '/home/mozo/wine64/dlls/ntdll' make: *** [Makefile:8831: dlls/ntdll] Error 2
https://bugs.winehq.org/show_bug.cgi?id=48700
maniikarabera@protonmail.ch changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |maniikarabera@protonmail.ch
https://bugs.winehq.org/show_bug.cgi?id=48700
Paul Gofman gofmanp@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #66590|0 |1 is obsolete| |
--- Comment #14 from Paul Gofman gofmanp@gmail.com --- Created attachment 66602 --> https://bugs.winehq.org/attachment.cgi?id=66602 POC patch
(In reply to mo78 from comment #13)
/usr/bin/ld: heap.o: in function `RtlFreeHeap': /home/mozo/wine64/dlls/ntdll/../../../wine-git/dlls/ntdll/heap.c:1783: undefined reference to `leave_critical_section'
Yes, sorry, you are building tmainstream Wine (which is ok) but my patch was based on top of Staging, and I missed that there is the difference.
I am attaching updated version which should compile ok with both mainstream and Staging. Since I was already there I changed this terrible hack a bit in a way that it looks even more terrible now but should not introduce a memory leak, just delay the freeing of small pointers, so it is supposingly usable to workaround the issue in this game. I still strongly discourage anyone from including this hack in any more or less universal build. I tested that it still fixes the issue for me at least in character creation screen and probably at the very beginning of the game (but not sure about the beginning as the character is in helmet there).
https://bugs.winehq.org/show_bug.cgi?id=48700
--- Comment #15 from mo78@abv.bg --- Sometime it croses my mind to try Staging but I didn't believed it will fix the problem :)
With the new patch everything is alright. Thank you very much!
https://bugs.winehq.org/show_bug.cgi?id=48700
--- Comment #16 from mo78@abv.bg --- Mr. Gofman, The second patch is working only in a clean prefix. If you exit the game and try to start it again, the game will stuck on the loading screen. DXVK HUD shows changing FPS but the game will never load.
https://bugs.winehq.org/show_bug.cgi?id=48700
--- Comment #17 from Paul Gofman gofmanp@gmail.com --- Created attachment 66624 --> https://bugs.winehq.org/attachment.cgi?id=66624 Another tweak
(In reply to mo78 from comment #16)
The second patch is working only in a clean prefix. If you exit the game and try to start it again, the game will stuck on the loading screen. DXVK HUD shows changing FPS but the game will never load.
It was working for me without cleaning prefixes. I run with Wine and Wine Staging (with Windows Steam version), maybe "protonified" build breaks with it or there is some other difference in your case. All that is quite possible, this was very quick and reckless tweak which can break a lot of things.
Here is another tweak which works for me also, this one is probably less invasive but adds some extra bytes for each allocation (which are freed in a normal way, i.e., memory consumption is increased a bit but no leak). The patch based upon mainstream Wine and needs formal rebase for Staging, but can also be applied to Staging with 'patch -p1 < patch_file' which successfully applies it with fuzz.
But please note that I am not really up to polishing these hacks, so if the the very first simplest patch works good enough maybe that's what can be used as a game specific workaround.
https://bugs.winehq.org/show_bug.cgi?id=48700
--- Comment #18 from mo78@abv.bg --- Thank you for your time, it's appreciared :)
I don't use TkG but compile it myself :) I'll try the newes patch.
https://bugs.winehq.org/show_bug.cgi?id=48700
--- Comment #19 from mo78@abv.bg --- The new patch is working fine. Thank you!
https://bugs.winehq.org/show_bug.cgi?id=48700
mo78@abv.bg changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|UNCONFIRMED |RESOLVED
--- Comment #20 from mo78@abv.bg --- They fixed it in 1.0.10 patch. Thank you once again, Paul :)
https://bugs.winehq.org/show_bug.cgi?id=48700
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #21 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 5.5.
https://bugs.winehq.org/show_bug.cgi?id=48700
--- Comment #22 from Nikolay Sivov bunglehead@gmail.com --- I was fixed in game update as I understand, so NOTOURBUG is more fitting.
https://bugs.winehq.org/show_bug.cgi?id=48700
--- Comment #23 from mo78@abv.bg --- Yes, they fixed it in patch 1.0.10 :)