https://bugs.winehq.org/show_bug.cgi?id=47918
Bug ID: 47918 Summary: Blur: cars have no wheels when Wine is compiled with Ryzen optimisations Product: Wine Version: 4.17 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: felixhaedicke@web.de Distribution: ---
Created attachment 65415 --> https://bugs.winehq.org/attachment.cgi?id=65415 Screenshot: Blur shows car without wheels
Recompiled Wine with the following CFLAGS: "-O2 -march=znver2", and noticed that in Blur, the cars (shown in the menus and in the game) are rendered without wheels. Before, I had compiled Wine compiled with "-O2 -march=ivybridge", and the wheels are rendered correctly.
It does not make a difference, if I use wined3d, d9vk or wine-nine-standalone. But it makes a difference, if Wine's msvcr90, or Microsoft's MSVC runtime DLLs are used - wheels are always shown correctly with MSVC runtime DLLs.
https://bugs.winehq.org/show_bug.cgi?id=47918
--- Comment #1 from Felix Hädicke felixhaedicke@web.de --- Created attachment 65416 --> https://bugs.winehq.org/attachment.cgi?id=65416 Screenshot: Blur shows car with wheels
https://bugs.winehq.org/show_bug.cgi?id=47918
Felix Hädicke felixhaedicke@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |msvcrt
--- Comment #2 from Felix Hädicke felixhaedicke@web.de --- Analyzed the problem further. Compiled msvcr90 with and without Ryzen optimisations. Then changed the optimisation settings for specific files.
Found out that it is enough to disable -march=znver2 for wcs.c to make it work. Then I found out that it is enough to disable optimisations for the function puts_clbk_str() in printf.h. Used __attribute__((optimize("O0"))) for this function.
https://bugs.winehq.org/show_bug.cgi?id=47918
--- Comment #3 from Felix Hädicke felixhaedicke@web.de --- This function uses memcpy(). But behaviour of memcpy() is undefinied, if memory areas overlap. And this rule is violated (to check this, I added an assertion to check this, and did run the msvcrt printf tests).
Replacing memcpy() with memmove() makes it work with Ryzen optimisations.
There is another function: puts_clbk_str_c99_a(), implemented in wcs.c, which looks very similar.
https://bugs.winehq.org/show_bug.cgi?id=47918
Fabian Maurer dark.shadow4@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dark.shadow4@web.de
https://bugs.winehq.org/show_bug.cgi?id=47918
--- Comment #4 from Felix Hädicke felixhaedicke@web.de --- https://github.com/felixhaedicke/wine/commit/fda8ccd79d2eef5f074e7450cc73f0a...
https://bugs.winehq.org/show_bug.cgi?id=47918
Fabian Maurer dark.shadow4@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |fda8ccd79d2eef5f074e7450cc7 | |3f0a081aa84f6 Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED
--- Comment #5 from Fabian Maurer dark.shadow4@web.de --- Marking fixed.
https://bugs.winehq.org/show_bug.cgi?id=47918
Gijs Vermeulen gijsvrm@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|FIXED |--- Status|RESOLVED |UNCONFIRMED
--- Comment #6 from Gijs Vermeulen gijsvrm@gmail.com --- (In reply to Fabian Maurer from comment #5)
Marking fixed.
That commit is in a fork, not upstream yet, reopening.
https://bugs.winehq.org/show_bug.cgi?id=47918
--- Comment #7 from Fabian Maurer dark.shadow4@web.de --- Sorry, thought that was upstream - my bad.
https://bugs.winehq.org/show_bug.cgi?id=47918
Matteo Bruni matteo.mystral@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|UNCONFIRMED |RESOLVED Fixed by SHA1|fda8ccd79d2eef5f074e7450cc7 |90e520b418dcedae6fbfdd56b79 |3f0a081aa84f6 |1ba50652f2ee6
--- Comment #8 from Matteo Bruni matteo.mystral@gmail.com --- Now really fixed by https://source.winehq.org/git/wine.git/commitdiff/90e520b418dcedae6fbfdd56b791ba50652f2ee6. Thank you Felix!
https://bugs.winehq.org/show_bug.cgi?id=47918
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #9 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 4.18.
https://bugs.winehq.org/show_bug.cgi?id=47918
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |4.0.x
https://bugs.winehq.org/show_bug.cgi?id=47918
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|4.0.x |---
--- Comment #10 from Michael Stefaniuc mstefani@winehq.org --- Removing the 4.0.x milestone from bug fixes included in 4.0.4.