Skip to content

Trying to ping anything returns "System error" #418

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
El-Virus opened this issue Mar 23, 2023 · 2 comments
Closed

Trying to ping anything returns "System error" #418

El-Virus opened this issue Mar 23, 2023 · 2 comments

Comments

@El-Virus
Copy link

Hi,
I've just compiled toybox and ran scripts/mkroot.sh.
Trying to ping or wget anything returns a system error:

$ ping landley.net
ping: landley.net: System error
$ wget http://landley.net
wget: landley.net:80: System error

Trying to ping an IP will work, and when running host landley.net will return its IP.

Am I missing something?

@landley
Copy link
Owner

landley commented Mar 23, 2023

Yeah, it's a known glibc bug the developers refuse to fix. The FAQ mentions it here: https://landley.net/toybox/faq.html#:~:text=dlopen

It's a widely known issue with glibc:
haskell/haskell-language-server#2431
https://news.ycombinator.com/item?id=9317211
https://www.reddit.com/r/C_Programming/comments/x3il6t/comment/impxc2a/?utm_source=reddit&utm_medium=web2x&context=3

That's why all the prebuilt binaries I ship are linked against musl-libc. Bionic does not have this problem either, nor did uClibc, nor do the C libraries on freebsd or macos... it's a unique failing of glibc due to extremely poor design decisions in the history of glibc development.

In theory I have a "dynamic" package in scripts/root that tries to build a dynamically linked mkroot instead of a statically linked one (copying all the toolchain's shared libraries into the target), but it's bit-rotted a bit since I last tried it a couple OS upgrades ago. (For one thing it's not handling symlinks with absolute paths properly.)

I'll try to fix it up this afternoon, then you can probably do "scripts/mkroot.sh dynamic" and get a working host build?

Or you could grab an alpine VM (or any other musl based system) and it should work out of the box. Or use one of the musl cross compilers on the website. Or the Android NDK might work as a cross compiler with the extra symlink in the FAQ? (There was an issue with booting as PID 1 under QEMU but Elliott fixed that upstream a while back and it shouldn't apply to chroots)...

@El-Virus
Copy link
Author

Thanks!
I completely missed that paragraph (just searched for "System error", "ping", "network" & "get").
If you could get dynamic working that'd be sublime. (In the meantime I'll use musl-libc)
Thank you again!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants