Closed fredrik-jansson-se closed 3 years ago
Could be reproduced w/o tokio and rusoto.
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x00007feec771380e in native_tls::imp::TlsConnector::new ()
#2 0x00007feec7713573 in native_tls::TlsConnector::new ()
#3 0x00007feec7713254 in native_tls_segfault::main ()
#4 0x00007feec77131d3 in std::sys_common::backtrace::__rust_begin_short_backtrace ()
#5 0x00007feec77131e9 in std::rt::lang_start::{{closure}} ()
#6 0x00007feec772a618 in core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once ()
at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/core/src/ops/function.rs:259
#7 std::panicking::try::do_call () at library/std/src/panicking.rs:373
#8 std::panicking::try () at library/std/src/panicking.rs:337
#9 std::panic::catch_unwind () at library/std/src/panic.rs:379
#10 std::rt::lang_start_internal () at library/std/src/rt.rs:51
#11 0x00007feec7713402 in main ()
Alpine libraries link dynamically to musl libc, while rustc statically links to it by default. The conflict there somehow causes the libssl dynamic library to not link in properly at runtime. If you set RUSTFLAGS=-Ctarget-feature=-crt-static
to configure rustc to dynamically link to musl as well, things appear to work.
If you want a fully statically linked binary, you'll need to build openssl from source configured to statically link to musl as well. You can enable the vendored
Cargo feature to have that happen automatically for you.
Awesome, that worked perfectly, thank you!!
Just ran into this as well, could this maybe be noted in README.md
?
Hi,
I'm trying to use rusoto_ec2 in an alpine Docker image, but run into a segfault that seems to originate in native_tls.
Please let me know if there is anything I can provide to shed some more light on this issue.
I've added the code here: https://github.com/fredrik-jansson-se/tls-segfault
I reproduce by this: