box64 icon indicating copy to clipboard operation
box64 copied to clipboard

wine: could not load kernel32.dll, status c0000135

Open olevenets2 opened this issue 3 years ago • 21 comments

Hi, all!

i installed two versions (i386 and x86_64) of wine stable 7.0, it works very well with box86, but when i try to make prefix a 64bit application in box64 i get error:

pi@raspberrypi:~ $ WINEPREFIX=~/.wine64 WINEARCH=win64 wine winecfg
Box86 with Dynarec v0.2.5 ca850b3d built on Mar 19 2022 23:02:46
Box86 with Dynarec v0.2.5 ca850b3d built on Mar 19 2022 23:02:46
Dynarec for ARM64, with extension: ASIMD CRC32 PageSize:4096
Box64 with Dynarec v0.1.7 5a563f1 built on Mar 19 2022 23:22:43
Using default BOX64_LD_LIBRARY_PATH: ./:lib/:lib64/:x86_64/:bin64/:libs64/
Using default BOX64_PATH: ./:bin/
Counted 51 Env var
Looking for /home/pi/wine/bin/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) librt.so.1
wine: could not load ntdll.so: Cannot dlopen("/home/pi/wine/bin/../lib64/wine/x86_64-unix/ntdll.so"/0xa06e40e0, 2)

0024:err:environ:run_wineboot failed to start wineboot c00000e5
wine: could not load kernel32.dll, status c0000135

can i fix this error somehow or now Wine x86_64 doesn't work correctly on 64bit RPI OS?

olevenets2 avatar Mar 30 '22 10:03 olevenets2

not sure what is happening. Try to update both box86 and box64 first, as a lot of wine/proton work as been done lately. It might just fix the issue.

ptitSeb avatar Mar 30 '22 11:03 ptitSeb

i updated box86 and box64 but still getting the same error

olevenets2 avatar Mar 30 '22 12:03 olevenets2

This seems to be related to wineprefix issue, when mixing 32bits and 64bits version. have you tried to remove your .wine64 prefix?

ptitSeb avatar Mar 30 '22 12:03 ptitSeb

yes, rm -rf .wine64 gives nothing

olevenets2 avatar Mar 30 '22 13:03 olevenets2

you don't need to use WINEARCH, at least, I don't use it on my side, and it works fine. Try to run with BOX86_LOG=1 to have more detail with box86.

ptitSeb avatar Mar 30 '22 13:03 ptitSeb

pi@raspberrypi:~ $ BOX86_LOG=1 WINEPREFIX=~/.wine64 WINEARCH=win64 wine winecfg
Debug level is 1
Dynarec for ARMv8, with extension: HALF FAST_MULT EDSP NEON VFPv4 IDIVA PageSize:4096
Box86 with Dynarec v0.2.5 dc461d4d built on Mar 30 2022 15:41:49
BOX86: Wine detected, WINEPRELOADRESERVE=""
Using default BOX86_LD_LIBRARY_PATH: ./:lib/:lib32/:x86/:i686/
Using default BOX86_PATH: ./:bin/
Counted 51 Env var
Looking for /usr/local/bin/wine
argv[1]="winecfg"
Using native(wrapped) libdl.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux.so.2
Using native(wrapped) librt.so.1
Using emulated /home/pi/wine/bin/../lib/wine/i386-unix/ntdll.so
Debug level is 1
Dynarec for ARMv8, with extension: HALF FAST_MULT EDSP NEON VFPv4 IDIVA PageSize:4096
Box86 with Dynarec v0.2.5 dc461d4d built on Mar 30 2022 15:41:49
BOX86: Wine detected, WINEPRELOADRESERVE=""
Using default BOX86_LD_LIBRARY_PATH: ./:lib/:lib32/:x86/:i686/
Using default BOX86_PATH: ./:bin/
Counted 52 Env var
Looking for /home/pi/wine/bin/wine
argv[1]="winecfg"
Using native(wrapped) libdl.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux.so.2
Using native(wrapped) librt.so.1
Using emulated /home/pi/wine/bin/../lib/wine/i386-unix/ntdll.so
Dynarec for ARM64, with extension: ASIMD CRC32 PageSize:4096
Box64 with Dynarec v0.1.7 3f641c2 built on Mar 30 2022 16:07:04
Using default BOX64_LD_LIBRARY_PATH: ./:lib/:lib64/:x86_64/:bin64/:libs64/
Using default BOX64_PATH: ./:bin/
Counted 53 Env var
Looking for /home/pi/wine/bin/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) librt.so.1
Using emulated /home/pi/wine/lib/wine/i386-unix/libwine.so.1
wine: could not load ntdll.so: Cannot dlopen("/home/pi/wine/bin/../lib64/wine/x86_64-unix/ntdll.so"/0x6ae32210, 2)

0024:err:environ:run_wineboot failed to start wineboot c00000e5
Error loading needed lib /home/pi/wine/lib/wine/i386-unix/start.so
Warning: Cannot dlopen("/home/pi/wine/lib/wine/i386-unix/start.so"/0x64930faf, 2)
wine: could not load kernel32.dll, status c0000135

olevenets2 avatar Mar 30 '22 13:03 olevenets2

Are you sure your 64bits version of wine is complete? the last error wine: could not load ntdll.so: Cannot dlopen("/home/pi/wine/bin/../lib64/wine/x86_64-unix/ntdll.so"/0x6ae32210, 2) seems to indicate box64 cannot find the file. Does it exist?

Also, it load Using emulated /home/pi/wine/lib/wine/i386-unix/libwine.so.1 for wineserver wich should be a 64bits process there, and that is suspiocious!

ptitSeb avatar Mar 30 '22 13:03 ptitSeb

hmm, ntdll.so is ok

pi@raspberrypi:~ $ find ~/wine/ -name ntdll.so
/home/pi/wine/lib64/wine/x86_64-unix/ntdll.so
/home/pi/wine/lib/wine/i386-unix/ntdll.so

and also libwine.so.1

pi@raspberrypi:~ $ find ~/wine/ -name libwine.so.1
/home/pi/wine/lib64/wine/x86_64-unix/libwine.so.1
/home/pi/wine/lib/wine/i386-unix/libwine.so.1

how can i force when calling wine64 to use x86_64 libraries?

olevenets2 avatar Mar 30 '22 13:03 olevenets2

You can't. It's automatic. Can you do file /home/pi/wine/lib/wine/i386-unix/libwine.so.1 and file /home/pi/wine/lib64/wine/x86_64-unix/ntdll.so

ptitSeb avatar Mar 30 '22 14:03 ptitSeb

Mmm I think the 32bits llibwine loding message is just from box86, not the box64 there. So the question is why box64 doesn't load that lib. Try to run with BOX64.LOG=2 to have more details on box64 side.

ptitSeb avatar Mar 30 '22 14:03 ptitSeb

file

pi@raspberrypi:~ $ file /home/pi/wine/lib/wine/i386-unix/libwine.so.1
/home/pi/wine/lib/wine/i386-unix/libwine.so.1: symbolic link to libwine.so.1.0
pi@raspberrypi:~ $ file /home/pi/wine/lib64/wine/x86_64-unix/ntdll.so
/home/pi/wine/lib64/wine/x86_64-unix/ntdll.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=5131c1e09591cd6c00e1ae55d9373396685f29e9, stripped

BOX64.LOG

https://paste.ee/p/tyqi7

olevenets2 avatar Mar 30 '22 17:03 olevenets2

I don't see anything wrong in those logs. And logs from box86 and box64 are mixed, making it difficult to follow. Did you try to run without the WINEARCH=win64 (I never need to use that on my side)?

ptitSeb avatar Mar 30 '22 17:03 ptitSeb

yes, it's the same error with ntdll.so

https://paste.ee/p/MH3SI

olevenets2 avatar Mar 30 '22 17:03 olevenets2

ok, because I don't see what's is happening, you need to use BOX86_LOG=1 BOX86_TRACE_FILE=$(pwd)/trace-%pid.txt BOX64_LOG=1 BOX64_TRACE_FILE=$(pwd)/trace-%pid.txt to launch your program. It will generate 1 trace file per process, so things will not get mixed up!

ptitSeb avatar Mar 30 '22 18:03 ptitSeb

Or maybe use LOG=2, to get even more details

ptitSeb avatar Mar 30 '22 18:03 ptitSeb

ok i hope this helps

https://www.sendspace.com/file/6tyx8y https://www.sendspace.com/file/e6swgp

olevenets2 avatar Mar 30 '22 18:03 olevenets2

Did these logs help? Did you manage to fix the issue?

olevenets2 avatar Apr 11 '22 22:04 olevenets2

The only thing I see is the missing libunwind.so.8. You need to put x86_64 version of that lib in a place where box64 can find it.

It's not the first time I see this lib needed, I'll probably have to do somethng about it later.

ptitSeb avatar Apr 12 '22 06:04 ptitSeb

It works, thanks! It's not bad to add this somehow to box64 itself so as not to clutter the system with libraries from x86

olevenets2 avatar Apr 12 '22 08:04 olevenets2

NOTE I don't know if you figured this out yet, but i noticed you were running the 32bit version of wine, and attempting to create a 64 bit prefix on BOX86. While the command wine will default to 32 bit prefixes unless specified, box determines it x86 due to how the 32-bit wine command is programmed. But when you try to make a 64 bit prefix, box86 already started instead of box64 for 64 bit programs due to how wine is 32-bit normally and then runs 64 libraries (this is my understanding of wine).

SOLUTION:

Instead of running the 32-bit wine command for running a 64-bit prefix (due to running 64bit AFTER 32bit started up), instead run the wine64 command and it will automatically start in 64 and box will recognize that its main library's are 64 bit.

25hawkeye avatar Aug 05 '23 04:08 25hawkeye