https://bugs.winehq.org/show_bug.cgi?id=55007
Bug ID: 55007 Summary: Multiple applications fail to run if Wine is compiled with CFLAGS="O2" (PlayOnline Viewer, Steam). Product: Wine Version: unspecified Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: msvcrt Assignee: wine-bugs@winehq.org Reporter: chiitoo@gentoo.org Distribution: ---
If Wine is compiled with CFLAGS="-O2" after 62173699c38 [1], PlayOnline Viewer (used to launch Final Fantasy XI Online) crashes right when the main window should appear with:
nhandled exception: page fault on read access to 0xffffffff in 32-bit code (0x69ec3194).
at
Backtrace: =>0 0x69ec3194 in ddraw (+0x3194) (0x0069e334) 1 0x00417b0a in pol (+0x17b0a) (0x0069e668) 2 0x00417dcb in pol (+0x17dcb) (0x0069e7bc) 3 0x00000001 (0x00000000) 0x69ec3194 ddraw+0x3194: vmovdqa %xmm0, -0x318(%ebp)
This does /not/ happen when building with -O1 for example.
This seems to also affect at least Steam (did not have time to test anything else so far):
=>0 0x6d489493 in secur32 (+0x9493) (0x0058e094) 1 0x6d48a58f in secur32 (+0xa58f) (0x0058e0f4) 2 0x6d49140a in secur32 (+0x1140a) (0x0058e154) 3 0x6c13491f in wininet (+0x3491f) (0x0058e3b4) 4 0x6c136058 in wininet (+0x36058) (0x0058e3d4) 5 0x6c121494 in wininet (+0x21494) (0x0058f464) 6 0x6c125206 in wininet (+0x25206) (0x0058f4b4) 7 0x00404490 in steamerrorreporter (+0x4490) (0x6c128360) 8 0x8b24ec83 (0x53e58955) 0x6d489493 secur32+0x9493: vmovdqa %xmm0, -0x38(%ebp)
1. https://source.winehq.org/git/wine.git/commit/62173699c38453777c7d5638ed2e77...
https://bugs.winehq.org/show_bug.cgi?id=55007
Chiitoo chiitoo@gentoo.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Distribution|--- |Gentoo Keywords| |regression Regression SHA1| |62173699c38453777c7d5638ed2 | |e779790506b75
https://bugs.winehq.org/show_bug.cgi?id=55007
Fabian Maurer dark.shadow4@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dark.shadow4@web.de
https://bugs.winehq.org/show_bug.cgi?id=55007
Zeb Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |z.figura12@gmail.com
--- Comment #1 from Zeb Figura z.figura12@gmail.com --- There was some discussion in #winehackers about this, but this seems a bit suspicious. i386 gcc should align the stack when using SSE registers even without force_align_arg_ptr, and I see that locally. (I also see unaligned movdqu even though the stack is clearly aligned at that point, but whatever).
FWIW, Chiitoo is also using some unusual compilation flags, namely "-march=znver4 -O2 -g -fomit-frame-pointer -pipe -mindirect-branch=thunk", but even with that I don't see the vmovdqa in ddraw.
https://bugs.winehq.org/show_bug.cgi?id=55007
--- Comment #2 from Chiitoo chiitoo@gentoo.org --- I do believe I tried with just '-O2' as well, but yeah, I'll dig into the toolchain some more as time permits, since it happens with runtime-11, binutils-2.40, and gcc-13, but not with binutils-2.39 and gcc-12.
Thanks again!
https://bugs.winehq.org/show_bug.cgi?id=55007
Chiitoo chiitoo@gentoo.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Version|unspecified |8.10 Resolution|--- |INVALID
--- Comment #3 from Chiitoo chiitoo@gentoo.org --- I forgot we normally strip CFLAGS for our Wine builds on Gentoo, so my actual usual CFLAGS are changed to:
-march=znver4 -O2 -pipe -mindirect-branch=thunk
In any case, this definitely doesn't seem to be as simple as it first seemed.
That is, it's not just related to -O2 or so from the looks of it, as I'm getting the crashes with -O1 as well now, and -znver* seems more likely to have more effect towards the crashes (GCC probably chose znver4 automagically even when I did not set it, though not sure what it set for mingw-toolchain GCC <12.3.0 or so which I think is around when it first got 'znver4').
Gone through around 300 builds with different settings, including '-march=x86-64', which with I don't remember getting the crash yet even when manually adding the other instructions znver activates per GCC documention, and I also didn't see the crashes with -march=bdver4 (although as discussed, that might not even be that interesting to chase, and may be inconsistent).
Then again, I forget if I replicated the issue with a plain build from git VS our package manager, even though I'm using the same flags there.
I suppose in the end this is a GCC bug, so perhaps this should be closed here, and I'll look into reporting this to the appropriate people.
I'll include the backtrace snippets with symbols, which I didn't quite have enough time to get for the initial report, in case someone bumps into the exact same issue.
Thank you!
https://bugs.winehq.org/show_bug.cgi?id=55007
--- Comment #4 from Chiitoo chiitoo@gentoo.org --- Created attachment 74609 --> https://bugs.winehq.org/attachment.cgi?id=74609 Symbolic Backtraces
https://bugs.winehq.org/show_bug.cgi?id=55007
Zeb Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|INVALID |NOTOURBUG
https://bugs.winehq.org/show_bug.cgi?id=55007
--- Comment #5 from Chiitoo chiitoo@gentoo.org --- (In reply to Chiitoo from comment #3)
Then again, I forget if I replicated the issue with a plain build from git VS our package manager, even though I'm using the same flags there.
Regarding this bit, I eventually noticed that I had not been passing CFLAGS properly to the MinGW parts of the build, meaning now I can replicate things outside Portage as well.
https://bugs.winehq.org/show_bug.cgi?id=55007
Chiitoo chiitoo@gentoo.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|Multiple applications fail |Multiple applications fail |to run if Wine is compiled |to run if Wine is compiled |with CFLAGS="O2" |with CFLAGS="-march=znver4" |(PlayOnline Viewer, Steam). |(PlayOnline Viewer, Steam).
--- Comment #6 from Chiitoo chiitoo@gentoo.org --- Adjusted the title a bit, and here's a link to the GCC bug for anyone who wants to follow along:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110260
https://bugs.winehq.org/show_bug.cgi?id=55007
Zeb Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |audvare@gmail.com
--- Comment #7 from Zeb Figura z.figura12@gmail.com --- *** Bug 55134 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=55007
--- Comment #8 from Zeb Figura z.figura12@gmail.com --- *** Bug 55036 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=55007
--- Comment #9 from Zeb Figura z.figura12@gmail.com --- Created attachment 75168 --> https://bugs.winehq.org/attachment.cgi?id=75168 add -mincoming-stack-boundary=2
This may get fixed upstream, but I think we should probably work around it in Wine regardless. Does the attached patch work?
https://bugs.winehq.org/show_bug.cgi?id=55007
--- Comment #10 from Chiitoo chiitoo@gentoo.org --- I do not seem to get dropped into the case at all ("$host" is 'linux-gnu' here).
If I add 'linux-gnu' to the condition, and see
checking whether the compiler supports -mpreferred-stack-boundary=2... yes
the thing unfortunately is still being as crashy as before.
That said, I don't actually see the option in CFLAGS during the most recent build, while in another test I saw it only in 'x86_64-pc-linux-gnu-gcc' parts, not in 'i686-w64-mingw32-gcc'... though I may have tweaked things a bit too much since it seems this should only affect the 32-bit side considering(?):
case $host_cpu in *i[3456789]86*)
I may have done something wrong. Will try again and look into it more at a better time.
Thank you!
https://bugs.winehq.org/show_bug.cgi?id=55007
Zeb Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #75168|0 |1 is obsolete| |
--- Comment #11 from Zeb Figura z.figura12@gmail.com --- Created attachment 75172 --> https://bugs.winehq.org/attachment.cgi?id=75172 use -mpreferred-stack-boundary=2, take 2
Sorry, I messed up multiple things with that patch. Try this version, please?
https://bugs.winehq.org/show_bug.cgi?id=55007
--- Comment #12 from Chiitoo chiitoo@gentoo.org --- No sorries!
PlayOnline Viewer seems to work as usual so far (it starts up) with take 2 (tested both without the patch to see that it fails to run and with the patch to see that they it does not fail).
Steam is acting a bit odd in that I did see a crash with the Wine dialog and all first, but then after it just kind of stops without saying anything.
If I start it up with Wine compiled without this issue affecting it, it starts OK and all, and I close it, then try again with this build I see the log-in window for a moment, and I see "Looks like steam didn't shutdown cleanly, scheduling immediate update check" and it kind of stops after "Manifest download: waiting for download to finish". No processes left around.
If I then run it again a process does get left around, but nothing seems to happen after.
I'll try that more after sleep for sure.
Many thanks again!
https://bugs.winehq.org/show_bug.cgi?id=55007
--- Comment #13 from Chiitoo chiitoo@gentoo.org --- Apologies for the delay on getting back to this.
I don't know what was up with Steam that time, but does seems to be okay now as well, with the patch.
Again, thank you!
https://bugs.winehq.org/show_bug.cgi?id=55007
Alex Henrie alexhenrie24@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.winehq.org/sho | |w_bug.cgi?id=55899
https://bugs.winehq.org/show_bug.cgi?id=55007
Béla Gyebrószki gyebro69@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |gyebro69@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=55007
Gabriel Ravier gabravier@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |gabravier@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=55007
Alex Henrie alexhenrie24@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.winehq.org/sho | |w_bug.cgi?id=45289