Skip to content
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

libwebrtc-sys conflicting with openssl-sys #89

Open
jyelloz opened this issue Jun 16, 2023 · 13 comments
Open

libwebrtc-sys conflicting with openssl-sys #89

jyelloz opened this issue Jun 16, 2023 · 13 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@jyelloz
Copy link

jyelloz commented Jun 16, 2023

Hi, I have been using this SDK recently, though after testing it a bit further a problem was encountered where an application depending on the SDK crashes while attempting to initialize OpenSSL when running in Ubuntu 22.04. It works fine on my Fedora 38 system, however.

I found that this is caused by libwebrtc-sys statically linking in BoringSSL code which conflicts with the dynamically linked OpenSSL symbols that other crates in the same application depend on. Furthermore, attempting to enable the various "vendored" features in other TLS provider crates will result in the application failing to link due to conflicting symbol names. I was able to get around the problem by modifying libwebrtc's build in a few places to prevent it from building any BoringSSL code, allowing for openssl-sys to fill that dependency. Are there any plans to un-bundle the TLS library from libwebrtc-sys or prevent the private symbols in libwebrtc from reaching outside of the libwebrtc-sys crate?

@theomonnom
Copy link
Member

Hey, this is definitely a tricky issue, thanks for the report!

Multiple things here:

  • Are you sure this is coming from BoringSSL and not one of the TLS features here?
  • Is it possible to get a minimal reproducible example on a repository somewhere? Can you give me an example of a library that conflicts with webrtc-sys? (e.g: is reqwest one of them?)
  • Can you give me more details about what you did when modifying libwebrtc to improve things?

@theomonnom theomonnom added good first issue Good for newcomers bug Something isn't working labels Jun 16, 2023
@theomonnom
Copy link
Member

theomonnom commented Jun 16, 2023

@jyelloz
Copy link
Author

jyelloz commented Jun 20, 2023

Hey, this is definitely a tricky issue, thanks for the report!

Multiple things here:

* Are you sure this is coming from BoringSSL and not one of the TLS features [here](https://github.com/livekit/client-sdk-rust/blob/33dfcb27b083b7d07389174feec010b3e3873d79/livekit/Cargo.toml#L9)?

My current setup does not have any of those flags set, so most likely it is not related to the livekit crate's feature set.

* Is it possible to get a minimal reproducible example on a repository somewhere? Can you give me an example of a library that conflicts with webrtc-sys? (e.g: is `reqwest` one of them?)

Yes, reqwest is one of the libraries that will conflict with it. I put together a minimal modification of the basic_room example that exhibits the behavior. I have tested it on my local Gentoo linux system with OpenSSL 3.0.9 as well as a Ubuntu 22.04 environment. The backtrace I have seen on multiple systems is:

>>> bt                                                                                                                                                     
#0  0x00007ffff74b6df0 in pthread_rwlock_wrlock () from /usr/lib64/libc.so.6                                                                               
#1  0x00005555556700c9 in CRYPTO_STATIC_MUTEX_lock_write ()                                                                                                
#2  0x0000555555681cb3 in CRYPTO_get_ex_new_index ()                                                                                                       
#3  0x00005555558e0cc5 in openssl::ssl::get_new_ssl_idx (f=0x5555558dfaa0 <openssl::ssl::free_data_box<openssl::ssl::SslContext>>) at src/ssl/mod.rs:4092  
#4  0x00005555558e0671 in openssl::ssl::Ssl::new_ex_index<openssl::ssl::SslContext> () at src/ssl/mod.rs:2210                                              
...
* Can you give me more details about what you did when modifying libwebrtc to improve things?

Sure, the basic idea is:

  • Remove all references to BoringSSL from the libwebrtc build scripts.
  • Try to set some build options in libwebrtc to use an external OpenSSL library and link to it dynamically.

See this patch for what I have done locally to the build of libwebrtc. There's currently something missing from that patch since there are 2 undefined symbols when building but I can fix it up later if it helps. Either way, this was just a proof of concept and it would probably be the better option if the build of BoringSSL into libwebrtc could be adjusted so that it doesn't interfere with other SSL libraries.

@theomonnom
Copy link
Member

Hey, I just tested your example, and I couldn't reproduce the issue. I had to modify the dependencies to use a vendored version. (It seems to only happen when using vendored versions).
reqwest = { version = "0.11.18", features = ["native-tls-vendored"] }

@theomonnom
Copy link
Member

theomonnom commented Jun 20, 2023

I think using BoringSSL and OpenSSL in the same binary is bad practice. IMO the best way to fix this would be to use custom webrtc builds with these arguments:

rtc_build_ssl=false
rtc_ssl_root="path/to/openssl/"

This will make WebRTC uses OpenSSL instead of BoringSSL

@jyelloz
Copy link
Author

jyelloz commented Jun 21, 2023

Hey, I just tested your example, and I couldn't reproduce the issue. I had to modify the dependencies to use a vendored version. (It seems to only happen when using vendored versions). reqwest = { version = "0.11.18", features = ["native-tls-vendored"] }

There might be something differing between our configurations. Here's a Containerfile that I put together that builds my branch demonstrating the conflict:

FROM ubuntu:22.04 as builder

RUN apt-get update
RUN apt-get install -y \
    build-essential \
    cpio \
    git \
    grpc-proto \
    libgl-dev \
    libprotobuf-dev \
    libssl-dev \
    libx11-dev \
    libxext-dev \
    ninja-build \
    pkg-config \
    protobuf-compiler \
    python-all-dev \
    python3 \
    python3-setuptools \
    wget \
    ''

RUN useradd -ms /bin/bash builder
USER builder

RUN wget https://sh.rustup.rs -O - | sh -s -- -y
ENV PATH="/home/builder/.cargo/bin:/usr/bin:/bin:/usr/sbin:/sbin"

WORKDIR /build

RUN git clone https://github.com/jyelloz/livekit-client-sdk-rust.git
WORKDIR livekit-client-sdk-rust
RUN git checkout openssl-boringssl-conflict
RUN git submodule update --init

WORKDIR /build/livekit-client-sdk-rust/examples/basic_room
RUN cargo build

FROM ubuntu:22.04
COPY --from=builder /build/livekit-client-sdk-rust/examples/target/debug/basic_room /
CMD ["/basic_room"]

If you build with something like podman build -t openssl-boringssl-conflict -f Containerfile .
And run with podman run --rm -it openssl-boringssl-conflict:latest the program should crash immediately.

@oshoemaker
Copy link

I believe that I am having the same issue.

Host: M1 MacOS
Container: Ubuntu 22.04.3 LTS

I cleared by crates/cargo cache, pulled down a fresh clone of the "client-sdk-rust" repo and attempted a "cargo build" and run of the bin.

Bin is too big to attach. I have attached a full BT zipped up.

I am not entirely clear on the process for working around this issue. Any additional details would be appreciated.

(gdb) core-file core
[New LWP 18964]
[New LWP 18965]
[New LWP 18967]
[New LWP 18972]
[New LWP 18966]
[New LWP 18969]
[New LWP 18974]
[New LWP 18975]
[New LWP 18971]
[New LWP 18968]
[New LWP 18970]
[New LWP 18973]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
Core was generated by `./basic_room'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000ffffa93d3c9c in __pthread_rwlock_wrlock_full64 (abstime=0x0, clockid=0, rwlock=0x0) at ./nptl/pthread_rwlock_common.c:603
603	./nptl/pthread_rwlock_common.c: No such file or directory.
[Current thread is 1 (Thread 0xffffa9ccb020 (LWP 18964))]
(gdb) where
#0  0x0000ffffa93d3c9c in __pthread_rwlock_wrlock_full64 (abstime=0x0, clockid=0, rwlock=0x0) at ./nptl/pthread_rwlock_common.c:603
#1  ___pthread_rwlock_wrlock (rwlock=0x0) at ./nptl/pthread_rwlock_wrlock.c:26
#2  0x0000aaaae3d43104 in CRYPTO_STATIC_MUTEX_lock_write ()
#3  0x0000aaaae3da4f5c [PAC] in CRYPTO_get_ex_new_index ()
#4  0x0000aaaae454ec68 [PAC] in openssl::ssl::get_new_ssl_idx (f=0xaaaae454dbfc <openssl::ssl::free_data_box<openssl::ssl::SslContext>>) at src/ssl/mod.rs:4144
#5  0x0000aaaae454e72c in openssl::ssl::Ssl::new_ex_index<openssl::ssl::SslContext> () at src/ssl/mod.rs:2227
#6  0x0000aaaae4557988 in core::ops::function::FnOnce::call_once<fn() -> core::result::Result<openssl::ex_data::Index<openssl::ssl::Ssl, openssl::ssl::SslContext>, openssl::error::ErrorStack>, ()> ()
    at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/ops/function.rs:250
#7  0x0000aaaae454fff8 in once_cell::imp::{impl#4}::initialize::{closure#0}<openssl::ex_data::Index<openssl::ssl::Ssl, openssl::ssl::SslContext>, fn() -> core::result::Result<openssl::ex_data::Index<openssl::ssl::Ssl, openssl::ssl::SslContext>, openssl::error::ErrorStack>, openssl::error::ErrorStack> () at /home/owen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/once_cell-1.18.0/src/imp_std.rs:72
#8  0x0000aaaae46480dc in core::ops::function::impls::{impl#3}::call_mut<(), dyn core::ops::function::FnMut<(), Output=bool>> (self=0xffffc4e7d1b0, args=()) at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/ops/function.rs:294
#9  0x0000aaaae4649a2c in once_cell::imp::initialize_or_wait (queue=0xaaaae4fb0030 <openssl::ssl::SESSION_CTX_INDEX>, init=...) at src/imp_std.rs:196
#10 0x0000aaaae454ff8c in once_cell::imp::OnceCell<openssl::ex_data::Index<openssl::ssl::Ssl, openssl::ssl::SslContext>>::initialize<openssl::ex_data::Index<openssl::ssl::Ssl, openssl::ssl::SslContext>, fn() -> core::result::Result<openssl::ex_data::Index<openssl::ssl::Ssl, openssl::ssl::SslContext>, openssl::error::ErrorStack>, openssl::error::ErrorStack> (self=0xaaaae4fb0030 <openssl::ssl::SESSION_CTX_INDEX>, f=0xaaaae4fb003000)
    at /home/owen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/once_cell-1.18.0/src/imp_std.rs:68
#11 0x0000aaaae45502e8 in once_cell::sync::OnceCell<openssl::ex_data::Index<openssl::ssl::Ssl, openssl::ssl::SslContext>>::get_or_try_init<openssl::ex_data::Index<openssl::ssl::Ssl, openssl::ssl::SslContext>, fn() -> core::result::Result<openssl::ex_data::Index<openssl::ssl::Ssl, openssl::ssl::SslContext>, openssl::error::ErrorStack>, openssl::error::ErrorStack> (self=0xaaaae4fb0030 <openssl::ssl::SESSION_CTX_INDEX>, f=0xffffc4e7dae000)
    at /home/owen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/once_cell-1.18.0/src/lib.rs:1163
#12 0x0000aaaae454dbf4 in openssl::ssl::try_get_session_ctx_index () at src/ssl/mod.rs:549
#13 0x0000aaaae454e7dc in openssl::ssl::Ssl::new (ctx=0xaaab06012b58) at src/ssl/mod.rs:2254
#14 0x0000aaaae454f290 in openssl::ssl::connector::SslConnector::configure (self=0xffffc4ea5688) at src/ssl/connector.rs:97
#15 0x0000aaaae4320f54 in native_tls::imp::TlsConnector::connect<tokio_native_tls::AllowStd<tokio::net::tcp::stream::TcpStream>> (self=0xffffc4ea5688, domain="test-s08fz2ro.livekit.cloud", stream=<error reading variable: Cannot access memory at address 0x20>)
    at /home/owen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/native-tls-0.2.11/src/imp/openssl.rs:338
#16 0x0000aaaae433d648 in native_tls::TlsConnector::connect<tokio_native_tls::AllowStd<tokio::net::tcp::stream::TcpStream>> (self=0xffffc4ea5688, domain="test-s08fz2ro.livekit.cloud", stream=<error reading variable: Cannot access memory at address 0x20>)
    at /home/owen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/native-tls-0.2.11/src/lib.rs:515
#17 0x0000aaaae42f4098 in tokio_native_tls::{impl#12}::connect::{async_fn#0}::{closure#0}<tokio::net::tcp::stream::TcpStream> (s=<error reading variable: Cannot access memory at address 0x20>)
    at /home/owen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-native-tls-0.3.1/src/lib.rs:311
#18 0x0000aaaae42f3410 in tokio_native_tls::{impl#11}::poll<tokio_native_tls::{impl#12}::connect::{async_fn#0}::{closure_env#0}<tokio::net::tcp::stream::TcpStream>, tokio::net::tcp::stream::TcpStream> (self=..., ctx=0xffffc4ea4b60)
    at /home/owen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-native-tls-0.3.1/src/lib.rs:280
#19 0x0000aaaae42f6038 in tokio_native_tls::handshake::{async_fn#0}<tokio_native_tls::{impl#12}::connect::{async_fn#0}::{closure_env#0}<tokio::net::tcp::stream::TcpStream>, tokio::net::tcp::stream::TcpStream> ()
    at /home/owen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-native-tls-0.3.1/src/lib.rs:252
#20 0x0000aaaae42f3fac in tokio_native_tls::{impl#12}::connect::{async_fn#0}<tokio::net::tcp::stream::TcpStream> () at /home/owen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-native-tls-0.3.1/src/lib.rs:311
#21 0x0000aaaae3ad26e4 in tokio_tungstenite::tls::encryption::native_tls::wrap_stream::{async_fn#0}<tokio::net::tcp::stream::TcpStream> () at /home/owen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-tungstenite-0.20.0/src/tls.rs:55
#22 0x0000aaaae3ad07bc in tokio_tungstenite::tls::client_async_tls_with_config::{async_fn#0}<http::request::Request<()>, tokio::net::tcp::stream::TcpStream> () at /home/owen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-tungstenite-0.20.0/src/tls.rs:216
#23 0x0000aaaae3a32fbc in tokio_tungstenite::connect::connect::{async_fn#0} () at /home/owen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-tungstenite-0.20.0/src/connect.rs:79
#24 0x0000aaaae3a32648 in tokio_tungstenite::connect::connect_async_with_config::{async_fn#0}<url::Url> () at /home/owen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-tungstenite-0.20.0/src/connect.rs:34
#25 0x0000aaaae3a32220 in tokio_tungstenite::connect::connect_async::{async_fn#0}<url::Url> () at /home/owen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-tungstenite-0.20.0/src/connect.rs:19
#26 0x0000aaaae3a90c18 in livekit_api::signal_client::signal_stream::{impl#0}::connect::{async_fn#0} () at /home/owen/client-sdk-rust/livekit-api/src/signal_client/signal_stream.rs:64
#27 0x0000aaaae3a1db50 in livekit_api::signal_client::{impl#2}::connect::{async_fn#0} () at /home/owen/client-sdk-rust/livekit-api/src/signal_client/mod.rs:112
#28 0x0000aaaae39d7778 in livekit::rtc_engine::rtc_session::{impl#2}::connect::{async_fn#0} () at src/rtc_engine/rtc_session.rs:173
#29 0x0000aaaae3a690a0 in livekit::rtc_engine::{impl#2}::connect::{async_fn#0} () at src/rtc_engine/mod.rs:382
#30 0x0000aaaae3721b28 in livekit::rtc_engine::{impl#1}::connect::{async_fn#0} () at /home/owen/client-sdk-rust/livekit/src/rtc_engine/mod.rs:191
#31 0x0000aaaae372fda4 in livekit::room::{impl#2}::connect::{async_fn#0} () at /home/owen/client-sdk-rust/livekit/src/room/mod.rs:203
#32 0x0000aaaae373242c in basic_room::main::{async_block#0} () at basic_room/src/main.rs:15
#33 0x0000aaaae371c9ac in tokio::runtime::park::{impl#4}::block_on::{closure#0}<basic_room::main::{async_block_env#0}> () at /home/owen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.29.1/src/runtime/park.rs:283
#34 0x0000aaaae371c83c in tokio::runtime::coop::with_budget<core::task::poll::Poll<()>, tokio::runtime::park::{impl#4}::block_on::{closure_env#0}<basic_room::main::{async_block_env#0}>> (budget=..., f=...)
    at /home/owen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.29.1/src/runtime/coop.rs:107
#35 tokio::runtime::coop::budget<core::task::poll::Poll<()>, tokio::runtime::park::{impl#4}::block_on::{closure_env#0}<basic_room::main::{async_block_env#0}>> (f=...)
    at /home/owen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.29.1/src/runtime/coop.rs:73
#36 tokio::runtime::park::CachedParkThread::block_on<basic_room::main::{async_block_env#0}> (self=0xffffc4ea5fef, f=...) at /home/owen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.29.1/src/runtime/park.rs:283
#37 0x0000aaaae374073c in tokio::runtime::context::blocking::BlockingRegionGuard::block_on<basic_room::main::{async_block_env#0}> (self=0xffffc4ea87b0, f=...)
    at /home/owen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.29.1/src/runtime/context/blocking.rs:66
#38 0x0000aaaae3720bcc in tokio::runtime::scheduler::multi_thread::{impl#0}::block_on::{closure#0}<basic_room::main::{async_block_env#0}> (blocking=0xffffc4ea87b0)
    at /home/owen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.29.1/src/runtime/scheduler/multi_thread/mod.rs:87
#39 0x0000aaaae3740210 in tokio::runtime::context::runtime::enter_runtime<tokio::runtime::scheduler::multi_thread::{impl#0}::block_on::{closure_env#0}<basic_room::main::{async_block_env#0}>, ()> (handle=0xffffc4eaeaf0, allow_block_in_place=true, f=...)
    at /home/owen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.29.1/src/runtime/context/runtime.rs:65
#40 0x0000aaaae3720b7c in tokio::runtime::scheduler::multi_thread::MultiThread::block_on<basic_room::main::{async_block_env#0}> (self=0xffffc4eaeac8, handle=0xffffc4eaeaf0, future=...)
    at /home/owen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.29.1/src/runtime/scheduler/multi_thread/mod.rs:86
#41 0x0000aaaae371b500 in tokio::runtime::runtime::Runtime::block_on<basic_room::main::{async_block_env#0}> (self=0xffffc4eaeac0, future=...) at /home/owen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.29.1/src/runtime/runtime.rs:313
#42 0x0000aaaae37224a8 in basic_room::main () at basic_room/src/main.rs:28

bt_full.txt.zip

@oshoemaker
Copy link

Per a suggestion, I also used the precompiled FFI and tested on python in the same ARM docker container. This seemed to work just fine. It would appear that compiling and running a rust app on arm linux (ubuntu) seems to be the issue.

@oshoemaker
Copy link

Ok, I was able to get a successful test of the basic_room example. I needed to use the livekit feature "rustls-tls-native-roots". Without it I would get an expected "TisFeatureNotEnabled" error and the tis-native seg faults.

@oshoemaker
Copy link

One last update, I am a bit stuck. At this point I am unable to use reqwest lib and livekit in the same application. It doesn't seem to matter what combination of features is used. I end up with the same seg fault.

Please advise on if there is a workaround. Thanks!

@theomonnom
Copy link
Member

theomonnom commented Sep 12, 2023

Hey, as a temporary workaround, you can try to avoid having openssl in your builds. (You can check the dependencies using cargo tree).
Here is the diff when I use native-tls vs rustls-tls-native-roots for livekit

You can see it is working when I'm not using native-tls (no openssl in the tree)
This is far from being perfect and I'll try to find better alternatives

223,250d222
< │   │   │   ├── hyper-tls v0.5.0
< │   │   │   │   ├── bytes v1.4.0
< │   │   │   │   ├── hyper v0.14.27 (*)
< │   │   │   │   ├── native-tls v0.2.11
< │   │   │   │   │   ├── log v0.4.19
< │   │   │   │   │   ├── openssl v0.10.57
< │   │   │   │   │   │   ├── bitflags v2.3.3
< │   │   │   │   │   │   ├── cfg-if v1.0.0
< │   │   │   │   │   │   ├── foreign-types v0.3.2
< │   │   │   │   │   │   │   └── foreign-types-shared v0.1.1
< │   │   │   │   │   │   ├── libc v0.2.147
< │   │   │   │   │   │   ├── once_cell v1.18.0
< │   │   │   │   │   │   ├── openssl-macros v0.1.1 (proc-macro)
< │   │   │   │   │   │   │   ├── proc-macro2 v1.0.66 (*)
< │   │   │   │   │   │   │   ├── quote v1.0.32 (*)
< │   │   │   │   │   │   │   └── syn v2.0.28 (*)
< │   │   │   │   │   │   └── openssl-sys v0.9.93
< │   │   │   │   │   │       └── libc v0.2.147
< │   │   │   │   │   │       [build-dependencies]
< │   │   │   │   │   │       ├── cc v1.0.79 (*)
< │   │   │   │   │   │       ├── pkg-config v0.3.27
< │   │   │   │   │   │       └── vcpkg v0.2.15
< │   │   │   │   │   ├── openssl-probe v0.1.5
< │   │   │   │   │   └── openssl-sys v0.9.93 (*)
< │   │   │   │   ├── tokio v1.29.1 (*)
< │   │   │   │   └── tokio-native-tls v0.3.1
< │   │   │   │       ├── native-tls v0.2.11 (*)
< │   │   │   │       └── tokio v1.29.1 (*)
254d225
< │   │   │   ├── native-tls v0.2.11 (*)
276d246
< │   │   │   ├── tokio-native-tls v0.3.1 (*)
307c277,278
< │   │   │   ├── native-tls v0.2.11 (*)
---
> │   │   │   ├── rustls v0.21.5 (*)
> │   │   │   ├── rustls-native-certs v0.6.3 (*)
309c280
< │   │   │   ├── tokio-native-tls v0.3.1 (*)
---
> │   │   │   ├── tokio-rustls v0.24.1 (*)
317d287
< │   │   │       ├── native-tls v0.2.11 (*)
326a297
> │   │   │       ├── rustls v0.21.5 (*)

@theomonnom
Copy link
Member

So the best solution would be to build webrtc with openssl, seems like this isn't straightforward to do.
I'm going to investigate on a webrtc patch

@maxbrunsfeld
Copy link
Contributor

maxbrunsfeld commented Jun 26, 2024

I believe we're hitting this issue in Zed on Linux, when trying to integrate this crate. We're using the isahc crate, which uses libcurl and openssl. We get a crash when initializing the HTTP client. I think this may be due to symbol collisions between OpenSSL and the prebuilt libwebrtc.a that's downloaded when building libwebrtc-sys.

The backtrace of the crashed thread is:

    frame #2: 0x00007ffff743061d libcrypto.so.3`CRYPTO_THREAD_write_lock + 13
    frame #3: 0x00007ffff757ca83 libcrypto.so.3`x509_store_add + 83
    frame #4: 0x00007ffff757cb29 libcrypto.so.3`X509_STORE_add_cert + 25
    frame #5: 0x00007ffff755ed3f libcrypto.so.3`X509_load_cert_crl_file_ex + 175
    frame #6: 0x00007ffff755eec5 libcrypto.so.3`by_file_ctrl_ex + 117
    frame #7: 0x00007ffff757b298 libcrypto.so.3`X509_STORE_load_file_ex + 88
    frame #8: 0x000055556311b57d zed`populate_x509_store(cf=0x00007ffeac0103a0, data=0x00007ffef4002a90, store=0x00007ffeac010798) at openssl.c:3185:25
    frame #9: 0x000055556311bc10 zed`Curl_ssl_setup_x509_store(cf=0x00007ffeac0103a0, data=0x00007ffef4002a90, ssl_ctx=0x00007ffeac0103d8) at openssl.c:3391:14
    frame #10: 0x000055556311c4ec zed`ossl_connect_step1(cf=0x00007ffeac0103a0, data=0x00007ffef4002a90) at openssl.c:3719:16
    frame #11: 0x000055556311deea zed`ossl_connect_common(cf=0x00007ffeac0103a0, data=0x00007ffef4002a90, nonblocking=true, done=0x00007fffd45fc9c3) at openssl.c:4314:14
    frame #12: 0x000055556311e13c zed`ossl_connect_nonblocking(cf=0x00007ffeac0103a0, data=0x00007ffef4002a90, done=0x00007fffd45fc9c3) at openssl.c:4399:10
    frame #13: 0x00005555631135f5 zed`ssl_connect_nonblocking(cf=0x00007ffeac0103a0, data=0x00007ffef4002a90, done=0x00007fffd45fc9c3) at vtls.c:375:10
    frame #14: 0x000055556311576f zed`ssl_cf_connect(cf=0x00007ffeac0103a0, data=0x00007ffef4002a90, blocking=false, done=0x00007fffd45fc9c3) at vtls.c:1536:14
    frame #15: 0x00005555630bb464 zed`Curl_conn_cf_connect(cf=0x00007ffeac0103a0, data=0x00007ffef4002a90, blocking=false, done=0x00007fffd45fc9c3) at cfilters.c:296:12
    frame #16: 0x00005555630c5bc9 zed`cf_setup_connect(cf=0x00007ffeac010270, data=0x00007ffef4002a90, blocking=false, done=0x00007fffd45fc9c3) at connect.c:1201:14
    frame #17: 0x00005555630bb464 zed`Curl_conn_cf_connect(cf=0x00007ffeac010270, data=0x00007ffef4002a90, blocking=false, done=0x00007fffd45fc9c3) at cfilters.c:296:12
    frame #18: 0x00005555630be70f zed`cf_hc_baller_connect(b=0x00007ffeac0101d8, cf=0x00007ffeac010220, data=0x00007ffef4002a90, done=0x00007fffd45fc9c3) at cf-https-connect.c:135:15
    frame #19: 0x00005555630bedc7 zed`cf_hc_connect(cf=0x00007ffeac010220, data=0x00007ffef4002a90, blocking=false, done=0x00007fffd45fc9c3) at cf-https-connect.c:290:16
    frame #20: 0x00005555630bb651 zed`Curl_conn_connect(data=0x00007ffef4002a90, sockindex=0, blocking=false, done=0x00007fffd45fc9c3) at cfilters.c:351:14
    frame #21: 0x00005555630ec33f zed`multi_runsingle(multi=0x00007ffeac000ca0, nowp=0x00007fffd45fca80, data=0x00007ffef4002a90) at multi.c:2106:16
    frame #22: 0x00005555630ee345 zed`multi_socket(multi=0x00007ffeac000ca0, checkall=false, s=12, ev_bitmask=2, running_handles=0x00007fffd45fcb1c) at multi.c:3267:16
    frame #23: 0x00005555630eeaa9 zed`curl_multi_socket_action(multi=0x00007ffeac000ca0, s=12, ev_bitmask=2, running_handles=0x00007fffd45fcb1c) at multi.c:3389:12
    frame #24: 0x00005555630b03b4 zed`curl::multi::Multi::action::hefa98c73df6b6749 at multi.rs:510:17
    frame #25: 0x0000555562fafc28 zed`isahc::agent::AgentContext::poll::heea1766a9bbb5add at mod.rs:527:17
    frame #26: 0x0000555562fae2bd zed`isahc::agent::AgentContext::run::hea5bb4be0c6da859 at mod.rs:485:13
    frame #27: 0x0000555562fa9f38 zed`isahc::agent::AgentBuilder::spawn::_$u7b$$u7b$closure$u7d$$u7d$::hf06bae0351499a25 at mod.rs:127:26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants