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
Segfault in argv::iter when linked with musl #3
Comments
Based on golang/go#13492, musl appears to believe that libraries don't get access to argv/argc, and the equivalent of |
Thanks! I published 0.1.3 with a fix. |
Thanks, that was quick. Please can you also publish a new version of gflags that bumps the argv dependency (which is currently pinned to 1.1.1). |
dtolnay
added a commit
to dtolnay/gflags
that referenced
this issue
Oct 7, 2020
Done. |
That is great -- thanks again. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
argv
segfaults in unsafe code when compiled using musl instead of glibc.Reproduction code
Cargo.toml
:src/main.rs
:Results
Works: On a Mac:
Works: In the official Rust docker container:
Note: Run
docker
from the crate's root, this will mount the crate's files at/crate
in the container.Fails: Static linking against musl
Still in the docker container from the previous step, follow the instructions at https://doc.rust-lang.org/edition-guide/rust-2018/platform-and-target-support/musl-support-for-fully-static-binaries.html to add the musl target
Then try and build and run that target.
Setting
RUST_BACKTRACE=full
doesn't work, you need to installgdb
and run it under there, so:This obviously affects anything that tries to use
argv
, includinggflags
.The text was updated successfully, but these errors were encountered: