ptitSeb / box64

Box64 - Linux Userspace x86_64 Emulator with a twist, targeted at ARM64 Linux devices
https://box86.org
MIT License
3.87k stars 280 forks source link

Box64 segfaults with Arch Linux Wine package, while it does run Debian Wine package #1393

Open EuphoricCatface opened 7 months ago

EuphoricCatface commented 7 months ago

Setup:

Referring to the manual, I have managed to run wine64 on this system, by manually extracting the contents of the two needed packages into a folder. It was working well in a random folder under the home folder, and also after moving the folder under ~/.local/opt.

The kernel provided by ChromeOS seems to disallow binfmt, so the experience is not 100% seamless, but it is still manageable. I think mixing 32-bit Wine in is nearly impossible, but for 64-bit applications, I could first run x64 Bash with Box64, and then run whatever application I want with wine64. So it goes something like this:

$ box64 bash_x64
# box64 is at /usr/sbin/box64, bash_x64 is at ~/.local/bin/bash_x64 (which is from tests/bash of this repo)
$ uname -m
x86_64  # Now we know we've activated Box64
$ wine64 ~/path/to/win64/app.exe
# wine64 is at ~/.local/opt/wine9.5_devel_deb/bin/wine64, symlinked to ~/.local/bin/wine64

Now, I found it tedious to locate the .deb packages, download, extract, and move the folder, every time Wine updates. So, for the next step, I tried to use the official Arch package. However, regardless of where I install the package, it would always end up giving a segmentation fault. I tried extracting the package under the home folder, and then I also tried installing it system-wide using pacman. It always gives this output:

$ wine64
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 PageSize:4096 Running on Kryo-4XX-Silver Kryo-4XX-Gold with 8 Cores
Will use Hardware counter measured at 19.2 MHz emulating 614 MHz
Params database has 61 entries
Box64 with Dynarec v0.2.7 68d710cd built on Mar 30 2024 05:45:30
BOX64: Wine64 detected, WINEPRELOADRESERVE=""
BOX64: Didn't detect 48bits of address space, considering it's 39bits
Counted 49 Env var
BOX64 LIB PATH: ./:lib/:lib64/:x86_64/:bin64/:libs64/:/lib/x86_64-linux-gnu/:/usr/lib/x86_64-linux-gnu/
BOX64 BIN PATH: ./:bin/:/home/username/.local/bin/:/home/username/.local/bin/:/home/username/.nix-profile/bin/:/nix/var/nix/profiles/default/bin/:/usr/local/sbin/:/usr/local/bin/:/usr/local/games/:/usr/sbin/:/usr/bin/:/usr/games/:/sbin/:/bin/:/usr/lib/jvm/default/bin/:/usr/bin/site_perl/:/usr/bin/vendor_perl/:/usr/bin/core_perl/:/usr/lib/rustup/bin/
Looking for /usr/sbin/wine64
Apply RC params for wine64
Applying BOX64_MAXCPU=64
Rename process to "wine64"
Using native(wrapped) libdl.so.2
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) libutil.so.1
Using native(wrapped) libresolv.so.2
Using native(wrapped) librt.so.1
Using native(wrapped) libbsd.so.0
FillBlock triggered a segfault at 0x1350 from 0x3504aa14
FillBlock at 0x1350 triggered a segfault, canceling
12364|SIGSEGV @0x35008778 (???(/usr/sbin/wine64+0x808778)) (x64pc=0x1350/???:"???", rsp=0x7f88a0f5a8, stack=0x7f88210000:0x7f88a10000 own=(nil) fp=0x7f88a0f5b0), for accessing 0x1350 (code=1/prot=87), db=(nil)((nil):(nil)/(nil):(nil)/???:clean, hash:0/0) handler=(nil)
RSP-0x20:0x0000000000000000 RSP-0x18:0x0000000000000000 RSP-0x10:0x0000000000000000 RSP-0x08:0x0000000000000000
RSP+0x00:0x0000000000010080 RSP+0x08:0x0000000000000000 RSP+0x10:0x0000000100001285 RSP+0x18:0x0000007f88a0f5c8
RAX:0x0000000000000000 RCX:0x0000000000000000 RDX:0x0000007f88a0f5e0 RBX:0x0000000000000000 
RSP:0x0000007f88a0f5a8 RBP:0x0000007f88a0f5b0 RSI:0x0000007f88a0f5d0 RDI:0x0000000000000001 
 R8:0x0000000000000000  R9:0x0000000000010080 R10:0x0000000000000000 R11:0x0000000000000000 
R12:0x0000000000000000 R13:0x0000000000000000 R14:0x0000000000000000 R15:0x0000000000000000 
ES:0x002b CS:0x0033 SS:0x002b DS:0x002b FS:0x0043 GS:0x0053 
Segmentation fault (core dumped)

When installing wine via pacman, I could confirm I have all the dependencies except for lib32 ones and optional ones.

Thanks for reading. (and also for the cool project)

mio-19 commented 6 months ago

Could I ask how to force install the foreign architecture package on archlinux arm with lib32 packages missing with pacman?

EuphoricCatface commented 6 months ago

You mean how I installed the official wine package from x86_64 Arch Linux, right? This is the command I used: # pacman -U ./wine-9.5-1-x86_64.pkg.tar.zst -dd --arch=x86_64 As the help message states, -dd skips all dependency checks. Pacman will still show warning messages, so I made sure only the lib32 packages were missing. I believe lib32 packages shouldn't be needed if I use only wine64 and not wine.

(Posted again because I posted this with a wrong account)

thw26 commented 4 months ago

I am running on Arch Linux ARM and I was seeing this same problem. I did install 9.12 from the repo using pacman -U and I am not seeing the error now, though when I tell it to run --version I am told it is version 8.21. I am seeing the error still.

EDIT: I had an old symlink in place for wine-8.21 when I last tried this.

Here is the successful wine 8.21 run:

Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL SHA1 SHA2 PageSize:4096 Running on Cortex-A55 with 4 Cores
Params database has 38 entries
Box64 with Dynarec v0.2.6 ddd62a1 built on Jan  2 2024 15:24:27
BOX64: Wine64 detected, WINEPRELOADRESERVE=""
BOX64: Detected 48bits at least of address space
Counted 74 Env var
BOX64 LIB PATH: ./:lib/:lib64/:x86_64/:bin64/:libs64/:/lib/x86_64-linux-gnu/:/usr/lib/x86_64-linux-gnu/
BOX64 BIN PATH: ./:bin/:/home/thwright/bin/:/usr/local/sbin/:/usr/local/bin/:/usr/bin/:/var/lib/flatpak/exports/bin/:/usr/lib/jvm/default/bin/:/usr/bin/site_perl/:/usr/bin/vendor_perl/:/usr/bin/core_perl/:/var/lib/snapd/snap/bin/:/home/thwright/.local/bin/:/home/thwright/bin/
Looking for ./.local/usr/bin/wine64
argv[1]="--version"
Rename process to "wine64"
Using native(wrapped) libdl.so.2
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) libutil.so.1
Using native(wrapped) libresolv.so.2
Using native(wrapped) librt.so.1
Using native(wrapped) libbsd.so.0
Using emulated /home/thwright/.local/usr/bin/../lib/wine/x86_64-unix/ntdll.so
Using emulated /lib/x86_64-linux-gnu/libunwind.so.8
Using native(wrapped) liblzma.so.5
wine-8.21