ptitSeb / box64

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

Pi5 16K pagesize unable to run Wine Processes #999

Open theofficialgman opened 1 year ago

theofficialgman commented 1 year ago

I currently have a developer that has a Pi5 help me test for compatibility issues with the 16K pages kernel option.

box64 page16 builds do work for some tested applications (eg: geekbench x86_64) but wine fails to start when attempting to run any application.

wine --version does work

ross@crouton:~ $ wine --version
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS PageSize:16384 Running on Cortex-A76 with 4 Cores
Params database has 27 entries
Box64 with Dynarec v0.2.5 cb85a8f5 built on Sep 29 2023 06:23:48
BOX64: Wine64 detected, WINEPRELOADRESERVE=""
Counted 25 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/:/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin/:/bin/:/usr/local/games/:/usr/games/
Looking for /usr/local/bin/wine
argv[1]="--version"
Rename process to "wine"
Using native(wrapped) libdl.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) libutil.so.1
Using native(wrapped) librt.so.1
Using emulated /opt/wine-8.17/bin/../lib/wine/x86_64-unix/ntdll.so
Using native(wrapped) libunwind.so.8
wine-8.17

but anything else fails with a wineboot error

ross@crouton:~/npp-x64 $ BOX64_LOG=1 wine ./notepad++.exe 
Debug level is 1
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS PageSize:16384 Running on Cortex-A76 with 4 Cores
Params database has 27 entries
Box64 with Dynarec v0.2.5 cb85a8f5 built on Sep 29 2023 06:23:48
BOX64: Wine64 detected, WINEPRELOADRESERVE=""
Counted 51 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/:/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin/:/bin/:/usr/local/games/:/usr/games/
Looking for /usr/local/bin/wine
argv[1]="./notepad++.exe"
Rename process to "wine"
Using native(wrapped) libdl.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) libutil.so.1
Using native(wrapped) librt.so.1
Using emulated /opt/wine-8.17/bin/../lib/wine/x86_64-unix/ntdll.so
Using native(wrapped) libunwind.so.8
Debug level is 1
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS PageSize:16384 Running on Cortex-A76 with 4 Cores
Params database has 27 entries
Box64 with Dynarec v0.2.5 cb85a8f5 built on Sep 29 2023 06:23:48
BOX64: Wine preloader detected, loading "/opt/wine-8.17/bin/wine" directly
BOX64: Wine64 detected, WINEPRELOADRESERVE=""
Counted 53 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/:/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin/:/bin/:/usr/local/games/:/usr/games/
Looking for /opt/wine-8.17/bin/wine
argv[1]="./notepad++.exe"
Rename process to "wine"
Using native(wrapped) libdl.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) libutil.so.1
Using native(wrapped) librt.so.1
Using emulated /opt/wine-8.17/bin/../lib/wine/x86_64-unix/ntdll.so
Using native(wrapped) libunwind.so.8
Debug level is 1
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS PageSize:16384 Running on Cortex-A76 with 4 Cores
Params database has 27 entries
Box64 with Dynarec v0.2.5 cb85a8f5 built on Sep 29 2023 06:23:48
Counted 53 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/:/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin/:/bin/:/usr/local/games/:/usr/games/
Looking for /opt/wine-8.17/bin/wineserver
Rename process to "wineserver"
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) librt.so.1
wine: failed to start L"C:\\windows\\system32\\wineboot.exe"
0024:err:environ:run_wineboot failed to start wineboot c000007b
wine: failed to load start.exe: c000007b

Testing of the 4K kernel with a 4K pagesize build of box64 does work on the same OS just to rule out potential OS/driver issues.

click to show 4K pagesize successful run ``` ross@crouton:~/npp-x64 $ BOX64_LOG=1 wine ./notepad++.exe Debug level is 1 Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS PageSize:4096 Running on Cortex-A76 with 4 Cores Params database has 27 entries Box64 with Dynarec v0.2.5 cb85a8f5 built on Sep 29 2023 06:18:43 BOX64: Wine64 detected, WINEPRELOADRESERVE="" Counted 51 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/:/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin/:/bin/:/usr/local/games/:/usr/games/ Looking for /usr/local/bin/wine argv[1]="./notepad++.exe" Rename process to "wine" Using native(wrapped) libdl.so.2 Using native(wrapped) libpthread.so.0 Using native(wrapped) libc.so.6 Using native(wrapped) ld-linux-x86-64.so.2 Using native(wrapped) libutil.so.1 Using native(wrapped) librt.so.1 Using emulated /opt/wine-8.17/bin/../lib/wine/x86_64-unix/ntdll.so Using native(wrapped) libunwind.so.8 Debug level is 1 Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS PageSize:4096 Running on Cortex-A76 with 4 Cores Params database has 27 entries Box64 with Dynarec v0.2.5 cb85a8f5 built on Sep 29 2023 06:18:43 BOX64: Wine preloader detected, loading "/opt/wine-8.17/bin/wine" directly BOX64: Wine64 detected, WINEPRELOADRESERVE="" Counted 53 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/:/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin/:/bin/:/usr/local/games/:/usr/games/ Looking for /opt/wine-8.17/bin/wine argv[1]="./notepad++.exe" Rename process to "wine" Using native(wrapped) libdl.so.2 Using native(wrapped) libpthread.so.0 Using native(wrapped) libc.so.6 Using native(wrapped) ld-linux-x86-64.so.2 Using native(wrapped) libutil.so.1 Using native(wrapped) librt.so.1 Using emulated /opt/wine-8.17/bin/../lib/wine/x86_64-unix/ntdll.so Using native(wrapped) libunwind.so.8 Debug level is 1 Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS PageSize:4096 Running on Cortex-A76 with 4 Cores Params database has 27 entries Box64 with Dynarec v0.2.5 cb85a8f5 built on Sep 29 2023 06:18:43 Counted 53 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/:/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin/:/bin/:/usr/local/games/:/usr/games/ Looking for /opt/wine-8.17/bin/wineserver Rename process to "wineserver" 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) librt.so.1 002c:fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0) 0054:fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0) 004c:fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0) 0054:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hr 0x80004002 0054:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, hr 0x80004002 0054:err:ole:apartment_get_local_server_stream Failed: 0x80004002 004c:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hr 0x80004002 004c:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, hr 0x80004002 004c:err:ole:apartment_get_local_server_stream Failed: 0x80004002 0054:err:ole:start_rpcss Failed to open RpcSs service 0090:err:localspl:process_attach failed to load symbol cupsCreateJob 0090:fixme:file:NtLockFile I/O completion on lock not implemented yet 0090:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION 0098:err:environ:init_peb starting L"Z:\\opt\\wine-8.17\\share\\wine\\mono\\wine-mono-8.0.0\\support\\removeuserinstalls-x86.exe" in experimental wow64 mode 00a0:err:environ:init_peb starting L"Z:\\opt\\wine-8.17\\share\\wine\\mono\\wine-mono-8.0.0\\support\\installinf-x86.exe" in experimental wow64 mode 0090:fixme:msi:internal_ui_handler internal UI not implemented for message 0x0b000000 (UI level = 1) 0090:fixme:msi:internal_ui_handler internal UI not implemented for message 0x0b000000 (UI level = 1) 00f8:err:environ:init_peb starting L"C:\\windows\\syswow64\\rundll32.exe" in experimental wow64 mode 00f8:err:localspl:process_attach failed to load symbol cupsCreateJob 0100:err:environ:init_peb starting L"C:\\windows\\syswow64\\iexplore.exe" in experimental wow64 mode 0128:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005 0128:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005 0128:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005 0128:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005 wine: configuration in L"/home/ross/.wine" has been updated. Debug level is 1 Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS PageSize:4096 Running on Cortex-A76 with 4 Cores Params database has 27 entries Box64 with Dynarec v0.2.5 cb85a8f5 built on Sep 29 2023 06:18:43 BOX64: Wine preloader detected, loading "/opt/wine-8.17/bin/wine" directly BOX64: Wine64 detected, WINEPRELOADRESERVE="000400000-000494000" Counted 55 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/:/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin/:/bin/:/usr/local/games/:/usr/games/ Looking for /opt/wine-8.17/bin/wine argv[1]="C:\windows\system32\conhost.exe" argv[2]="--unix" argv[3]="--width" argv[4]="139" argv[5]="--height" argv[6]="43" argv[7]="--server" argv[8]="0x10" Rename process to "wine" Using native(wrapped) libdl.so.2 Using native(wrapped) libpthread.so.0 Using native(wrapped) libc.so.6 Using native(wrapped) ld-linux-x86-64.so.2 Using native(wrapped) libutil.so.1 Using native(wrapped) librt.so.1 Using emulated /opt/wine-8.17/bin/../lib/wine/x86_64-unix/ntdll.so Using native(wrapped) libunwind.so.8 Using emulated /opt/wine-8.17/lib/wine/x86_64-unix/win32u.so Using native(wrapped) libm.so.6 Using native(wrapped) libfreetype.so.6 Using native(wrapped) libfontconfig.so.1 Using emulated /opt/wine-8.17/lib/wine/x86_64-unix/win32u.so Using native(wrapped) libm.so.6 Using native(wrapped) libfreetype.so.6 Using native(wrapped) libfontconfig.so.1 Using emulated /opt/wine-8.17/lib/wine/x86_64-unix/winex11.so Using native(wrapped) libXext.so.6 Using native(wrapped) libX11.so.6 Using native(wrapped) libxcb.so.1 Using native(wrapped) libXau.so.6 Using native(wrapped) libXdmcp.so.6 Using native(wrapped) libXinerama.so.1 Using native(wrapped) libXxf86vm.so.1 Using native(wrapped) libXrender.so.1 Using native(wrapped) libXrandr.so.2 Using native(wrapped) libXcomposite.so.1 Using native(wrapped) libXi.so.6 Using native(wrapped) libXcursor.so.1 Using emulated /opt/wine-8.17/lib/wine/x86_64-unix/bcrypt.so Using native(wrapped) libgnutls.so.30 Using emulated /opt/wine-8.17/lib/wine/x86_64-unix/crypt32.so Using emulated /opt/wine-8.17/lib/wine/x86_64-unix/ws2_32.so Using emulated /opt/wine-8.17/lib/wine/x86_64-unix/winspool.so Using native(wrapped) libcups.so.2 0024:fixme:win:SetWindowCompositionAttribute (0000000000010114, 0000000102B0D8C8): stub 0024:fixme:win:SetWindowCompositionAttribute (0000000000010154, 0000000102B0C7F8): stub 0024:fixme:win:SetWindowCompositionAttribute (0000000000010154, 0000000102B0D048): stub 0024:fixme:win:SetWindowCompositionAttribute (000000000001016A, 0000000102B0C7F8): stub 0024:fixme:win:SetWindowCompositionAttribute (000000000001016A, 0000000102B0D048): stub 0024:fixme:win:SetWindowCompositionAttribute (0000000000010178, 0000000102B0C7F8): stub 0024:fixme:win:SetWindowCompositionAttribute (0000000000010178, 0000000102B0D048): stub 0024:fixme:win:SetWindowCompositionAttribute (0000000000010188, 0000000102B0C7F8): stub 0024:fixme:win:SetWindowCompositionAttribute (0000000000010188, 0000000102B0D048): stub 0024:fixme:win:SetWindowCompositionAttribute (000000000003031C, 0000000102B0C878): stub 0024:fixme:win:SetWindowCompositionAttribute (000000000003031C, 0000000102B0D2B8): stub 0024:fixme:win:NtUserLockWindowUpdate (0x10114), partial stub! 0024:fixme:win:NtUserLockWindowUpdate ((nil)), partial stub! 0024:fixme:msg:ChangeWindowMessageFilterEx 0000000000010114 4a 1 0000000000000000 0024:fixme:msg:ChangeWindowMessageFilterEx 0000000000010114 447 1 0000000000000000 0024:fixme:win:SetWindowCompositionAttribute (00000000000B032E, 0000000102B08778): stub 0024:fixme:win:SetWindowCompositionAttribute (00000000000B032E, 0000000102B091B8): stub ```

maybe this issue can be replicated on other 16K pagesize systems (eg: asahi linux) that you have available? in any case this is the wine build from pi-apps currently in use https://github.com/Pi-Apps-Coders/files/releases/download/large-files/wine-8.17.tar.gz

ptitSeb commented 1 year ago

I need to check what is happening. I'll try on an M1 with Asahi, that is also on 16K page size.

bryce-happel-walton commented 1 year ago

I need to check what is happening. I'll try on an M1 with Asahi, that is also on 16K page size.

Wine does not work on M1 Asahi due to lack of x86 support, which WINE needs. This appears to be the same issue you are having with the Pi5. Unfortunately there is not pure x64 support for WINE, it needs both x86 and x64.

ptitSeb commented 1 year ago

I need to check what is happening. I'll try on an M1 with Asahi, that is also on 16K page size.

Wine does not work on M1 Asahi due to lack of x86 support, which WINE needs. This appears to be the same issue you are having with the Pi5. Unfortunately there is not pure x64 support for WINE, it needs both x86 and x64.

There is an experimental mode of wine, called Wow64, that allow 32bits to run on 64bits only system.

CodeRunner5235 commented 1 year ago

There is a thread on the winehq site somewhere about 16k pages being a thing that breaks wine. Im also using asahi linux and my error is almost identical to this one when trying to run wine with wow64

theofficialgman commented 1 year ago

There is a thread on the winehq site somewhere about 16k pages being a thing that breaks wine. Im also using asahi linux and my error is almost identical to this one when trying to run wine with wow64

Were aren't running the ARM64 build of wine directly which is what that winehq bug report is for.

This is for running the x86_64 build of wine (with wow64 mode) on arm with 16k pages through box64 with 16k pages support. box64 should be able to handle this as it covers the 16k arm pages -> 4k x86_64 pages translation.

CodeRunner5235 commented 1 year ago

Huh. Missed that tidbit. So box64 covers the 16k -> 4k conversion? Ill have to compile box64 and wine x86_64 with wow64 again to compare then.

theofficialgman commented 1 year ago

Huh. Missed that tidbit. So box64 covers the 16k -> 4k conversion? Ill have to compile box64 and wine x86_64 with wow64 again to compare then.

You can use the wine x86_64 with WOW64 that I have prebuilt if you want. It is linked a couple of posts up.

CodeRunner5235 commented 1 year ago

Huh. Missed that tidbit. So box64 covers the 16k -> 4k conversion? Ill have to compile box64 and wine x86_64 with wow64 again to compare then.

You can use the wine x86_64 with WOW64 that I have prebuilt if you want. It is linked a couple of posts up.

As it seems cross compilation wants to be a pain, ill have to take you up on your offer

edit I found your wine builds and I do have the same error. Any attempt to do run winecfg or any application errors with “failed to start L”C:\windows\system32\wineboot.exe” Failed to load start.exe c000007b” When I copy the same wine install into a krunvm that is running a 4k page size, it works perfectly

m1m1k4tz commented 1 year ago

I think this is the same issue I’m having in #487