-
-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loader could not find fstat
#923
Comments
When running in fully emulated mode, it crashes with SIGSEGV
And the similar issue with symbol loading when running in prefer-emulated mode:
Note that I don't use bundled |
I figured out how to add wrapping symbols to libc. @ptitSeb, do I understand correctly that right now the linker does not respect symvers for wrapped libraries, that's why there are checks for glibc version? I see the version checks in the loader itself (for emulated libraries), but not in the wrappers. |
There is some limited support for |
So, right now I've just uncommented these box86/src/wrapped/wrappedlibc_private.h Lines 2268 to 2273 in 027605e
Not sure how to fix this properly as this apparently would break Steam userspace you're targeting. These symbols were wrapped via |
A |
getting this error trying to run bash with > export LD_LIBRARY_PATH="$(for lib in ncurses glibc; do nix-build '<nixpkgs>' -A pkgsCross.armv7l-hf-multiplatform.${lib} --no-out-link; done | xargs -I {} echo -n {}/lib: | sed 's/:$//')"
> box86 /nix/store/3c54hwp1zji0h8yl66860cp8zp2vsrzv-bash-5.2p26/bin/bash 16:21:41
Box86 with Dynarec v0.3.6 nogit built on Jan 1 1980 00:00:00
Error: PltResolver: Symbol __isoc23_strtoimax(ver 10: __isoc23_strtoimax@GLIBC_2.38) not found, cannot apply R_386_JMP_SLOT 0x813ec88 (0x805d2e6) in /nix/store/3c54hwp1zji0h8yl66860cp8zp2vsrzv-bash-5.2p26/bin/bash
> BOX86_DLSYM_ERROR=1 BOX86_LOG=1 BOX86_PREFER_EMULATED=1 BOX86_EMULATED_LIBS=libc.so.6 BOX86_DYNAREC=0 BOX86_SHOWSEGV=1 BOX86_SHOWBT=1 box86 /nix/store/3c54hwp1zji0h8yl66860cp8zp2vsrzv-bash-5.2p26/bin/bash
Debug level is 1
Dynarec is off
Shows details of dlopen / dlsym /dlclose : Yes
Show Segfault signal even if a signal handler is present
Show Backtrace for signals
Running on Neoverse-N1 with 4 Cores
Box86 with Dynarec v0.3.6 nogit built on Jan 1 1980 00:00:00
Using default BOX86_LD_LIBRARY_PATH: ./:lib/:lib32/:x86/:i686/
BOX86 will force the used of emulated libs for libc.so.6
Using default BOX86_PATH: ./:bin/
BOX86: Prefer Emulated libs
Counted 107 Env var
Looking for /nix/store/3c54hwp1zji0h8yl66860cp8zp2vsrzv-bash-5.2p26/bin/bash
bash detected, disabling banner
Rename process to "bash"
Using native(wrapped) libdl.so.2
Using emulated /nix/store/756q2acnjgi6ym709gw1f3jp0ciqwib1-glibc-2.39-52/lib/libc.so.6
Redirecting overridden malloc function for /nix/store/756q2acnjgi6ym709gw1f3jp0ciqwib1-glibc-2.39-52/lib/libc.so.6
Using emulated /nix/store/756q2acnjgi6ym709gw1f3jp0ciqwib1-glibc-2.39-52/lib/ld-linux.so.2
Warning, don't know of to handle rel #2 type: 0x2a (unknown) (0x60432b00) for
Warning, don't know of to handle rel #91 type: 0x2a (unknown) (0x60227c74) for
Warning, don't know of to handle rel #19 type: 0x2a (unknown) (0x60227e74) for
Warning, don't know of to handle rel #20 type: 0x2a (unknown) (0x60227e6c) for
Warning, don't know of to handle rel #21 type: 0x2a (unknown) (0x60227e64) for
Warning, don't know of to handle rel #22 type: 0x2a (unknown) (0x60227e58) for
Warning, don't know of to handle rel #23 type: 0x2a (unknown) (0x60227e34) for
Warning, don't know of to handle rel #24 type: 0x2a (unknown) (0x60227e30) for
Warning, don't know of to handle rel #25 type: 0x2a (unknown) (0x60227e24) for
1531240|SIGSEGV @0x62aace58 (???(/nix/store/3c54hwp1zji0h8yl66860cp8zp2vsrzv-bash-5.2p26/bin/bash/0x62aace58)) (x86pc=0x24ab0/???:"???", esp=0x41a601fc, stack=0x41269000:0x41a69000 own=(nil) fp=(nil)), for accessing 0x24ab0 (code=1/prot=0), db=(nil)((nil):(nil)/(nil):(nil)/???:clean, hash:0/0)
ESP-0x10:0x00000000 ESP-0x0c:0x00000000 ESP-0x08:0x00000000 ESP-0x04:0x00000000
ESP+0x00:0x40a70010 ESP+0x04:0x00000001 ESP+0x08:0x41a60210 ESP+0x0c:0x41a60218
Native bactrace:
/nix/store/3c54hwp1zji0h8yl66860cp8zp2vsrzv-bash-5.2p26/bin/bash() [0x628fb2a4]
/nix/store/176g0h9j5vmkil0k8zb5h4a8iac06qcb-glibc-armv7l-unknown-linux-gnueabihf-2.39-52/lib/libc.so.6(__default_rt_sa_restorer+0) [0x40866cb0]
/nix/store/3c54hwp1zji0h8yl66860cp8zp2vsrzv-bash-5.2p26/bin/bash() [0x62aace58]
/nix/store/3c54hwp1zji0h8yl66860cp8zp2vsrzv-bash-5.2p26/bin/bash() [0x629057f8]
/nix/store/3c54hwp1zji0h8yl66860cp8zp2vsrzv-bash-5.2p26/bin/bash() [0x629059c8]
/nix/store/3c54hwp1zji0h8yl66860cp8zp2vsrzv-bash-5.2p26/bin/bash() [0x6282eed0]
/nix/store/3c54hwp1zji0h8yl66860cp8zp2vsrzv-bash-5.2p26/bin/bash() [0x628d1ce8]
/nix/store/3c54hwp1zji0h8yl66860cp8zp2vsrzv-bash-5.2p26/bin/bash() [0x628d1eb0]
/nix/store/3c54hwp1zji0h8yl66860cp8zp2vsrzv-bash-5.2p26/bin/bash() [0x6281c5dc]
/nix/store/176g0h9j5vmkil0k8zb5h4a8iac06qcb-glibc-armv7l-unknown-linux-gnueabihf-2.39-52/lib/libc.so.6(+0x238cc) [0x4084f8cc]
/nix/store/176g0h9j5vmkil0k8zb5h4a8iac06qcb-glibc-armv7l-unknown-linux-gnueabihf-2.39-52/lib/libc.so.6(__libc_start_main+0x98) [0x4084f9c0]
1531240|Double SIGSEGV (code=1, pc=0x62aace58, addr=0x24ab0)! Using a glibc version older than |
This is a completly different issue: it's the relocation type "0x2a" that is not handled by box86. This need to be in a new ticket, not here. |
Ok, thanks, I'll make a new ticket then, but you said it is not handled by box86, I'm trying to test the package for nixOS, is it possible that it's a problem on the packaging then? |
Nope. It's a box86 iisue. Well, I guess the bash you have is built on NixOS itself and is fairly recent, compared to the one in the box86 repo.... |
yeah, using the one in the repo would require a bunch of patching to work in a system like nixOS where libraries are never where programs usually expect them to be :v, I'll open another issue and maybe try to play around with the bash versioning a bit, if I figure anything out I'll put it there, thanks a lot 🙏 EDIT: made a new issue, also tried running with bash version > export LD_LIBRARY_PATH="$(for lib in ncurses glibc; do nix-build '<nixpkgs>' -A pkgsCross.armv7l-hf-multiplatform.${lib} --no-out-link; done | xargs -I {} echo -n {}/lib: | sed 's/:$//')"
> echo $LD_LIBRARY_PATH 18:26:24
/nix/store/74gp2wabmv0cqwhpsjmglpzlwvyvd2r5-ncurses-armv7l-unknown-linux-gnueabihf-6.4/lib:/nix/store/176g0h9j5vmkil0k8zb5h4a8iac06qcb-glibc-armv7l-unknown-linux-gnueabihf-2.39-52/lib
> box86 /nix/store/9cf3kcqal0v4sj78kmfkdkplpifs1piv-bash-5.1-p16/bin/bash 18:33:59
Box86 with Dynarec v0.3.6 nogit built on Jan 1 1980 00:00:00
# (exits with bash error code 255)
> BOX86_DLSYM_ERROR=1 BOX86_LOG=1 BOX86_PREFER_EMULATED=1 BOX86_EMULATED_LIBS=libc.so.6 BOX86_DYNAREC=0 BOX86_SHOWSEGV=1 BOX86_SHOWBT=1 box86 /nix/store/9cf3kcqal0v4sj78kmfkdkplpifs1piv-bash-5.1-p16/bin/bash
Debug level is 1
Dynarec is off
Shows details of dlopen / dlsym /dlclose : Yes
Show Segfault signal even if a signal handler is present
Show Backtrace for signals
Running on Neoverse-N1 with 4 Cores
Box86 with Dynarec v0.3.6 nogit built on Jan 1 1980 00:00:00
Using default BOX86_LD_LIBRARY_PATH: ./:lib/:lib32/:x86/:i686/
BOX86 will force the used of emulated libs for libc.so.6
Using default BOX86_PATH: ./:bin/
BOX86: Prefer Emulated libs
Counted 107 Env var
Looking for /nix/store/9cf3kcqal0v4sj78kmfkdkplpifs1piv-bash-5.1-p16/bin/bash
bash detected, disabling banner
Rename process to "bash"
Redirecting overridden malloc function for /nix/store/9cf3kcqal0v4sj78kmfkdkplpifs1piv-bash-5.1-p16/bin/bash
Using native(wrapped) libdl.so.2
Using emulated /nix/store/0wr8hawrkjxp9bygcdisdg4kj2irqqyb-glibc-2.35-163/lib/libc.so.6
Redirecting overridden malloc function for /nix/store/0wr8hawrkjxp9bygcdisdg4kj2irqqyb-glibc-2.35-163/lib/libc.so.6
Using emulated /nix/store/0wr8hawrkjxp9bygcdisdg4kj2irqqyb-glibc-2.35-163/lib/ld-linux.so.2
Warning, don't know of to handle rel #145 type: 0x2a (unknown) (0x60436b18) for
Warning, don't know of to handle rel #1356 type: 0x2a (unknown) (0x60221cb4) for
Warning, don't know of to handle rel #17 type: 0x2a (unknown) (0x60221e8c) for
Warning, don't know of to handle rel #18 type: 0x2a (unknown) (0x60221e64) for
Warning, don't know of to handle rel #19 type: 0x2a (unknown) (0x60221e5c) for
Warning, don't know of to handle rel #20 type: 0x2a (unknown) (0x60221e4c) for
1708800|SIGSEGV @0x62aae070 (???(/nix/store/9cf3kcqal0v4sj78kmfkdkplpifs1piv-bash-5.1-p16/bin/bash/0x62aae070)) (x86pc=0x600213dc//nix/store/0wr8hawrkjxp9bygcdisdg4kj2irqqyb-glibc-2.35-163/lib/libc.so.6:"???", esp=0x41a601c0, stack=0x41269000:0x41a69000 own=(nil) fp=(nil)), for accessing 0x50 (code=1/prot=0), db=(nil)((nil):(nil)/(nil):(nil)/???:clean, hash:0/0)
ESP-0x10:0x40a70010 ESP-0x0c:0x00000000 ESP-0x08:0x00000000 ESP-0x04:0x00000000
ESP+0x00:0x00000000 ESP+0x04:0x00000000 ESP+0x08:0x00000000 ESP+0x0c:0x00000000
Native bactrace:
/nix/store/9cf3kcqal0v4sj78kmfkdkplpifs1piv-bash-5.1-p16/bin/bash() [0x628fb2a4]
/nix/store/176g0h9j5vmkil0k8zb5h4a8iac06qcb-glibc-armv7l-unknown-linux-gnueabihf-2.39-52/lib/libc.so.6(__default_rt_sa_restorer+0) [0x40866cb0]
/nix/store/9cf3kcqal0v4sj78kmfkdkplpifs1piv-bash-5.1-p16/bin/bash() [0x62aae070]
/nix/store/9cf3kcqal0v4sj78kmfkdkplpifs1piv-bash-5.1-p16/bin/bash() [0x629057f8]
/nix/store/9cf3kcqal0v4sj78kmfkdkplpifs1piv-bash-5.1-p16/bin/bash() [0x6281c68c]
/nix/store/176g0h9j5vmkil0k8zb5h4a8iac06qcb-glibc-armv7l-unknown-linux-gnueabihf-2.39-52/lib/libc.so.6(+0x238cc) [0x4084f8cc]
/nix/store/176g0h9j5vmkil0k8zb5h4a8iac06qcb-glibc-armv7l-unknown-linux-gnueabihf-2.39-52/lib/libc.so.6(__libc_start_main+0x98) [0x4084f9c0]
1708800|Double SIGSEGV (code=1, pc=0x62aae070, addr=0x50)! |
Trying to study the code to understand why
fstat
symbol could not be found in the wrapped libc. It seems to be wrapped, and wrapper generator complains if I explicitly add the definition as under#ifdef ANDROID
insrc/wrapped/wrappedlibc_private.h
, but it still complains.Do I understand correctly that the wrappers were written to a specific base userspace libraries (Steam's Ubuntu I guess?) and won't work if the library such as libc gets updated?
I'm running Debian 12 armhf with i386 libraries (also Debian 12, glibc 2.36-9+deb12u3).
The text was updated successfully, but these errors were encountered: