I have a program that uses the openssl
crate (via reqwest
). I was building and running it in a Docker container based on Alpine, and found that it would exit with status 139 (indicating SIGSEGV) when setting up the OpenSSL methods. I've put together a minimal reproduction case at
and
As you can see from the Dockerfile, if I build on Buster, or if I build statically on Alpine, things work fine. So clearly there is some problem with loading the dynamic library in the Alpine image. How do I debug this further?
I've confirmed that, inside the Alpine container, libssl does exist and the binary is configured to link it:
# ldd target/debug/openssl-crash
/lib/ld-musl-x86_64.so.1 (0x7faca41c3000)
libssl.so.1.1 => /lib/libssl.so.1.1 (0x7faca40e8000)
libcrypto.so.1.1 => /lib/libcrypto.so.1.1 (0x7faca3e69000)
# ls -l /lib/libssl.so.1.1
-rwxr-xr-x 1 root root 523728 Apr 21 2020 /lib/libssl.so.1.1