[Bug 52715] New: wine segfaults on asahi linux (apple M1 hardware, linux kernel/userland)
https://bugs.winehq.org/show_bug.cgi?id=52715 Bug ID: 52715 Summary: wine segfaults on asahi linux (apple M1 hardware, linux kernel/userland) Product: Wine Version: 7.4 Hardware: aarch64 OS: Linux Status: NEW Keywords: source Severity: blocker Priority: P2 Component: -unknown Assignee: wine-bugs(a)winehq.org Reporter: austinenglish(a)gmail.com Distribution: Debian The GCC Compile Farm has a m1 machine running asahi linux, so I tried building wine. While it compiles (note: most optional deps and freetype were missing), the resulting binary segfaults, even for --version/--help: austin(a)gcc103:~/wine$ file loader/wine loader/wine: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, BuildID[sha1]=c47e4c565e49cc68efce4887d600f06d749670e0, for GNU/Linux 3.7.0, with debug_info, not stripped austin(a)gcc103:~/wine$ ./loader/wine --version Segmentation fault austin(a)gcc103:~/wine$ ./loader/wine --help Segmentation fault austin(a)gcc103:~/wine$ uname -a Linux gcc103.fsffrance.org 5.17.0-rc7-asahi-next-20220310-g4a4f4ec03834 #1 SMP PREEMPT Sat Mar 12 18:16:45 UTC 2022 aarch64 GNU/Linux austin(a)gcc103:~/wine$ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/11/lto-wrapper Target: aarch64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian 11.2.0-18' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=aarch64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=4 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 11.2.0 (Debian 11.2.0-18) austin(a)gcc103:~/wine$ ~/llvm-mingw-20211002-ucrt-ubuntu-18.04-aarch64/bin/aarch64-w64-mingw32-gcc --version clang version 13.0.0 (https://github.com/llvm/llvm-project.git d7b669b3a30345cfcdb2fde2af6f48aa4b94845d) Target: aarch64-w64-windows-gnu Thread model: posix InstalledDir: /home/austin/llvm-mingw-20211002-ucrt-ubuntu-18.04-aarch64/bin Note that the machine uses a 16k stack size instead of 4k, which may be at fault: https://github.com/AsahiLinux/docs/wiki/Software-known-to-have-issues-with-1... -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52715 Fabian Maurer <dark.shadow4(a)web.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dark.shadow4(a)web.de -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52715 --- Comment #1 from Fabian Maurer <dark.shadow4(a)web.de> --- This is indeed due to the page size. The "wine" binary is compiled with "-Wl,-z,max-page-size=0x1000". Remove that, and it doesn't segfault. It doesn't work still, but at least it doesn't crash instantly. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52715 Fabian Maurer <dark.shadow4(a)web.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |52934 --- Comment #2 from Fabian Maurer <dark.shadow4(a)web.de> --- Added follow up bug 52934. Might also be dependent on 16k pages, not not, I don't know. Although I'm not sure how useful it is to try and make wine work on 16k pages. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52715 Dustin Hacker <ldhacker2(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ldhacker2(a)gmail.com --- Comment #3 from Dustin Hacker <ldhacker2(a)gmail.com> --- I was able to get it not to segfault by changing every instance of -max-page-size=0x1000 to -max-page-size=0x4000 in the ./configure script. Also, I changed a few instances of the page zero size to 0x4000 as well. The ./configure setup that I use is: ./configure --host=aarch64-linux-gnu host_alias=aarch64-linux-gnu --without-freetype --without-x --enable-win64 I got the ./configure info from https://wiki.winehq.org/ARM64 aand modified it to be for aarch64. Now it runs without segfault, but I get he following error on trying to run an .exe: wine: failed to load /usr/local/lib/wine/aarch64-windows/ntdll.dll error c000007b 0024:err:environ:run_wineboot failed to start wineboot c00000e5 wine: failed to load /usr/local/lib/wine/aarch64-windows/ntdll.dll error c000007b -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52715 André H. <nerv(a)dawncrow.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nerv(a)dawncrow.de --- Comment #4 from André H. <nerv(a)dawncrow.de> --- For reference, this is what I did for 64k pages on PowerPC64le: https://github.com/AndreRH/wine/commit/8db73261d4a18b50cd9aa3f0ccb6cadb985d3... Or simply recompile the kernel for 4k pages :) -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52715 Teoh Han Hui <teohhanhui(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |teohhanhui(a)gmail.com -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52715 Neko-san <nekoNexus(a)protonmail.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nekoNexus(a)protonmail.ch -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52715 dofficialgman(a)gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dofficialgman(a)gmail.com --- Comment #5 from dofficialgman(a)gmail.com --- Hi, Raspberry pi 5 will release in about a month and the pi foundation is experimenting with using 16K pages by default. https://github.com/geerlingguy/sbc-reviews/issues/21#issuecomment-1740279618 It would be great if this issue could be fixed before that device releases and users start submitting bug reports. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52715 --- Comment #6 from Austin English <austinenglish(a)gmail.com> --- Created attachment 75212 --> https://bugs.winehq.org/attachment.cgi?id=75212 use 16k stack size on aarch64 I tried forcing 16k, which didn't improve the situation. Attaching the patch for reference. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52715 Austin English <austinenglish(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #75212|use 16k stack size on |use 16k page size on description|aarch64 |aarch64 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52715 --- Comment #7 from Austin English <austinenglish(a)gmail.com> --- Created attachment 75213 --> https://bugs.winehq.org/attachment.cgi?id=75213 try 64k pages 64k doesn't work either -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52715 --- Comment #8 from Fabian Maurer <dark.shadow4(a)web.de> --- Created attachment 75726 --> https://bugs.winehq.org/attachment.cgi?id=75726 16k page hacks Attaching the hacks I used to get 16k pages working. Environment: - Asahi Linux Fedora on M1 Mac Mini - llvm-mingw-20231128 You'll also need to set 16k pages for the PE binaries: export CROSSLDFLAGS="-Wl,-section-alignment=16384" -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52715 --- Comment #9 from Fabian Maurer <dark.shadow4(a)web.de> --- *** Bug 52934 has been marked as a duplicate of this bug. *** -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52715 Fabian Maurer <dark.shadow4(a)web.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|wine segfaults on asahi |wine segfaults on asahi |linux (apple M1 hardware, |linux due to 16k pages |linux kernel/userland) |(apple M1 hardware, linux | |kernel/userland) --- Comment #10 from Fabian Maurer <dark.shadow4(a)web.de> --- I'll work on a less hacky solution soon. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52715 --- Comment #11 from Austin English <austinenglish(a)gmail.com> --- (In reply to Fabian Maurer from comment #8)
Created attachment 75726 [details] 16k page hacks
Attaching the hacks I used to get 16k pages working.
Environment: - Asahi Linux Fedora on M1 Mac Mini - llvm-mingw-20231128
You'll also need to set 16k pages for the PE binaries: export CROSSLDFLAGS="-Wl,-section-alignment=16384"
Thanks. These also work for me using debian on m1. FWIW, I tried winetest afterward: 72 failures (a significant number of those are related to missing gecko/mono, bug 43938). -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52715 --- Comment #12 from Fabian Maurer <dark.shadow4(a)web.de> --- Created attachment 76032 --> https://bugs.winehq.org/attachment.cgi?id=76032 updated 64k hack Attaching an updated minimal 64k pages hack. You also need to revert 0900d919e2fd5ce12e02375cfcbfa5ab7c283515 otherwise it just hangs. Alexandre said Wine must be able to load 4k binaries so that part of the hack will never be accepted. Currently no idea how to do that though. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52715 m1m1k4tz <m1m1k4tz(a)protonmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m1m1k4tz(a)protonmail.com --- Comment #13 from m1m1k4tz <m1m1k4tz(a)protonmail.com> --- A way to get this working with good performance could be to use box64 and drm native context but that throws an error the last time I tested it out. It could be different but I would have to reinstall Asahi linux and I'm probably just gonna wait until it has Vulkan support so there's a chance for decent performance with the new wow64 mode. It might work with FEX Emu but I haven't tested it out so it could just be an error with box64 https://sinrega.org/2023-10-06-using-microvms-for-gaming-on-fedora-asahi/ -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52715 --- Comment #14 from m1m1k4tz <m1m1k4tz(a)protonmail.com> --- Created attachment 76099 --> https://bugs.winehq.org/attachment.cgi?id=76099 krunvm -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52715 --- Comment #15 from Fabian Maurer <dark.shadow4(a)web.de> --- While that might work, I think Wine should also be able to support 16k pages natively. Not sure if there's anything that would prevent this from working, but it certainly isn't easy. Especially since there is probably more than one way it could be approached. If only a knew the exe format and the wine loader code better... -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52715 --- Comment #16 from m1m1k4tz <m1m1k4tz(a)protonmail.com> --- That's true and it would make my life a lot easier instead of trying to track down what bug it is in 3 different pieces of software lol -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52715 --- Comment #17 from Fabian Maurer <dark.shadow4(a)web.de> --- Note: For testing you need to run autoreconf after applying the patch (I tend to forget that part) Hack still works, and you still need to revert 0900d919e2fd5ce12e02375cfcbfa5ab7c283515 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52715 Tomáš Bžatek <bugs(a)bzatek.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bugs(a)bzatek.net -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52715 Fabian Maurer <dark.shadow4(a)web.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |cdfrosty(a)gmail.com --- Comment #18 from Fabian Maurer <dark.shadow4(a)web.de> --- *** Bug 57417 has been marked as a duplicate of this bug. *** -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52715 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #19 from Alexandre Julliard <julliard(a)winehq.org> --- This should work now. It's not perfect, and can't be perfect by design, so feel free to file new bugs for remaining issues. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=52715 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #20 from Alexandre Julliard <julliard(a)winehq.org> --- Closing bugs fixed in 10.5. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla