-
-
Notifications
You must be signed in to change notification settings - Fork 749
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
Segmentation fault when initializing tls on 1.51.0-x86_64-unknown-linux-musl #1462
Comments
fn main() {
match std::env::args().nth(1).as_deref() {
Some("0") => {
let _ = openssl::ssl::SslMethod::tls();
}
Some("1") => {
let _ = openssl::ssl::select_next_proto(&[0, 1], &[1, 2]);
}
Some("2") => {
let s = openssl::ssl::cipher_name("DUMMY");
assert_eq!(s, "(NONE)");
}
_ => {}
}
}
I tried this code, and |
The system-installed copy of OpenSSL dynamically links to the system MUSL, but Rust will by default statically link to a bundled MUSL, and that causes things to break when calling into OpenSSL. You should either build an OpenSSL that also statically links to MUSL (e.g. with the vendored cargo feature), or tell Rust to also dynamically link to the system musl by setting |
This is probably interesting in this context: |
For reference, this was likely due to a bug with |
First, add this
Dockerfile
:Then, create a new binary with
$ cargo new bugtest
, and add the following contents:src/main.rs
:Cargo.toml
:Finally, invoke
$ docker build -f Dockerfile -t bug:latest .
and see the output containing the seg-fault:The text was updated successfully, but these errors were encountered: