Botspot / pi-apps

Raspberry Pi App Store for Open Source Projects
GNU General Public License v3.0
2.02k stars 205 forks source link

Wine installation "succeeds" but running wine segfaults #400

Closed dimag0g closed 3 years ago

dimag0g commented 3 years ago

Installing Wine on my system goes through (the installation log is here), but one can see a segfault near the end of the log. Subsequent calls to wine also result in a segfault:

pi@raspberrypi:~ $ winecfg
/usr/local/bin/wine: line 2: 15171 Segmentation fault      setarch linux32 -L /home/pi/wine/bin/wine "$@"
pi@raspberrypi:~ $ wine explorer
/usr/local/bin/wine: line 2: 15174 Segmentation fault      setarch linux32 -L /home/pi/wine/bin/wine "$@"

Details about the files implementing the wine command:

pi@raspberrypi:~ $ cat /usr/local/bin/wine
#!/bin/bash
setarch linux32 -L /home/pi/wine/bin/wine "$@"
pi@raspberrypi:~ $ shasum /home/pi/wine/bin/wine
6e65d7b1a96f09a765e36bb9c7c08abd3f140ca3  /home/pi/wine/bin/wine
pi@raspberrypi:~ $ shasum /usr/local/bin/box86 
65755489b723a3747c1d10a3eac3111e2d7e859d  /usr/local/bin/box86
Itai-Nelken commented 3 years ago

maybe try to compile box86? a lot of people that had problems with wine solved them by reinstalling or recompiling box86.

dimag0g commented 3 years ago

@Itai-Nelken Box86 is working as far as I can tell, at least, I can run cpuid inside an old Debian i386 image:

pi@raspberrypi:/opt/exagear/images/debian-8/usr $ BOX86_LD_LIBRARY_PATH=lib/i386-linux-gnu/ box86 cpuid | head -n 10
Box86 with Dynarec v0.2.1 db176ad3 built on Feb 15 2021 00:05:11
CPU 0:
   vendor_id = "GenuineIntel"
   version information (1/eax):
      processor type  = primary processor (0)
      family          = Intel Pentium Pro/II/III/Celeron/Core/Core 2/Atom, AMD Athlon/Duron, Cyrix M2, VIA C3 (6)
      model           = 0x0 (0)
      stepping id     = 0x1 (1)
      extended family = 0x0 (0)
      extended model  = 0x0 (0)

I tried reinstalling both Wine and Box86, rebooting, and wiping the ~/.wine folder before installation, but the problem is still there.

Itai-Nelken commented 3 years ago

did you try compiling box86? or you are sing the pi-apps install script (for box86)?

dimag0g commented 3 years ago

@Itai-Nelken I installed box86 from pi-apps.

Itai-Nelken commented 3 years ago

@Itai-Nelken I installed box86 from pi-apps.

@dimag0g try compiling box86, instructions are here: https://github.com/ptitSeb/box86/blob/master/docs/COMPILE.md

Botspot commented 3 years ago

but the problem is still there.

This is very perplexing.

It works fine for me on a fresh 32-bit RPiOS install, but when it fails on other's systems, it can be very challenging to determine what's going wrong. (And especially hard when you throw in emulation and Wine together. So many places where something could be broken)

dimag0g commented 3 years ago

I finally found the problem. There were two emulators active on my system at the same time, and box86 wasn't the default choice:

pi@raspberrypi:/etc $ ls /proc/sys/fs/binfmt_misc/
jar                    python2.7  register  x86
llvm-7-runtime.binfmt  python3.7  status    x86_guest
pi@raspberrypi:/etc $ cat /proc/sys/fs/binfmt_misc/x86
enabled
interpreter /usr/local/bin/box86
flags:
offset 0
magic 7f454c4601010100000000000000000002000300
mask ffffffffffffff00fffffffffffffffffeffffff
pi@raspberrypi:/etc $ cat /proc/sys/fs/binfmt_misc/x86_guest
enabled
interpreter /opt/exagear/bin/ubt_wrapper_suid
flags: POC
offset 0
magic 7f454c4601010100000000000000000002000300
mask fffffffffffffffcfffffffffffffffffcffffff

Removing x86_guest with update-binfmts allowed wine to run OK.

I don't see a way to catch such issues automatically, short of checking binfmt entries one by one. So I suppose we can close this.

PS. As an off-topic: wine + box86 have amazing performance, faster than Exagear. Unfortunately, they seem to be not as stable, for instance, I can't get HoMM3 game running, whereas it runs fine under Exagear. Still, it's clearly a way to the future, since Exagear is commercial and essentially abandoned, so it will likely stop working in a couple of years.