https://bugs.winehq.org/show_bug.cgi?id=43516
Bug ID: 43516 Summary: GCC march=native Flag Causes "Unhandled Pagefault on Write" Product: Wine Version: 2.14 Hardware: x86 OS: Linux Status: NEW Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: ben@xnode.org Distribution: ---
I've run into a specific crash that only happens with using the "-march=native" GCC flag at build time (usage of -O3 or -O2 don't affect it). Removing "march" entirely stops the crash from occurring.
This is on a Intel Broadwell i7-5775C using GCC 7.1.1.
Triggering the crash is unfortunately a bit specific: The crash occurs when loading Mario Kart 8 in CEmu (1.8) under a 64bit Wine prefix. The exact moment it happens is once the game's splash screen appears - pressing A should then take you to the menu, but instead if Wine has been built with march=native, it'll throw an Unhandled Pagefault at this point instead:
"wine: Unhandled page fault on write access to 0x7f7fda6f0080 at address 0x1400e1867 (thread 005f), starting debugger..."
According to GCC, the flags it activates when using march=native on this platform are: -march=broadwell -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mmovbe -maes -mno-sha -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -mno-sgx -mbmi2 -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mrtm -mhle -mrdrnd -mf16c -mfsgsbase -mrdseed -mprfchw -madx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mno-clflushopt -mno-xsavec -mno-xsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi -mno-avx5124fmaps -mno-avx5124vnniw -mno-clwb -mno-mwaitx -mno-clzero -mno-pku -mno-rdpid --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -mtune=broadwell -fPIE -fstack-check=specific -fstack-protector-strong (in case any of those stand out as being an issue when used with Wine)
https://bugs.winehq.org/show_bug.cgi?id=43516
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |austinenglish@gmail.com, | |julliard@winehq.org
--- Comment #1 from Austin English austinenglish@gmail.com --- I'm on mobile, so can't find a quick reference (which also means we need to better document it), but afaik, march CFLAGS are known to cause issues, particularly with DRM, and are not supported by Wine. Arguably, we should filter it out like we do fortify, IMO.
AJ, would you care to chime in?
https://bugs.winehq.org/show_bug.cgi?id=43516
--- Comment #2 from Alexandre Julliard julliard@winehq.org --- There's no reason that it couldn't be supported, assuming that it's really a Wine issue and not a gcc bug. It's clearly not a priority though, so you'll most likely have to debug it yourself.
https://bugs.winehq.org/show_bug.cgi?id=43516
--- Comment #3 from Benjamin Hodgetts ben@xnode.org --- Yeah, I did some pretty extensive searching around and could only find maybe 2 references over the last 10 years or so mentioning CFLAGs affecting copy protection, but nothing that ever mentioned the march flag at all which made me suspicious.
The official build guide doesn't seem to mention any specific issues with flags either - https://wiki.winehq.org/Building_Wine#Compiler_Optimizations_.26_Call-Stacks
As AJ said, this could even be a GCC 7 bug rather than a Wine bug.
https://bugs.winehq.org/show_bug.cgi?id=43516
Celeste Liu coelacanthus@outlook.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |coelacanthus@outlook.com