This message was deleted.
# sdk-rust
s
This message was deleted.
a
@boundless-energy-78552 @dry-elephant-14928 if it makes sense for you, I could create credentials in a cloud VM exhibiting the issue...
🙏 1
b
Hey @ambitious-lunch-95812, from tomorrow, this issue will be my main priority, I’ll first try to reproduce it inside one of our VM. And if I can’t, it would be great to have access to one of your VMs, thanks 🙏
a
Awesome. Thanks, @boundless-energy-78552! Since our timezones are so different, I'll just send you some credentials today -- that way if you need access you'll have it.
👍 1
🙏 1
b
Hey, I just tested on your VM and it works for me ( The basic room example ). Did you try to run it on the host or inside a Docker container?
It is also working when using a container: I used this Dockerfile, everything has been run on your VM.
Copy code
FROM ubuntu:jammy as builder

RUN apt-get update
RUN apt-get install -y libssl-dev libx11-dev libgl1-mesa-dev libxext-dev curl unzip cmake build-essential pkg-config

RUN curl <https://sh.rustup.rs> -sSf | bash -s -- -y
RUN curl -Lo protoc.zip <https://github.com/protocolbuffers/protobuf/releases/download/v21.0/protoc-21.0-linux-x86_64.zip> &&  \
    unzip protoc.zip -d /usr/local && chmod a+x /usr/local/bin/protoc && rm protoc.zip

WORKDIR /usr/src/basic_room
COPY . .
RUN bash -c "source ~/.cargo/env; cargo install --path ./examples/basic_room --root /usr/src/basic_room"

FROM ubuntu:jammy
COPY --from=builder /usr/src/basic_room/bin/basic_room /usr/local/bin/basic_room

ENV LIVEKIT_URL=<ws://localhost:7880>
ENV LIVEKIT_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjUyODE5MzUwOTYsImlzcyI6IkFQSVRzRWZpZFpqclFvWSIsIm5hbWUiOiJwMSIsIm5iZiI6MTY4MTkzODY5Niwic3ViIjoicDEiLCJ2aWRlbyI6eyJyb29tIjoidGVzdHJvb20iLCJyb29tSm9pbiI6dHJ1ZX19.Se6WNr_xV9Z8aJ1mHI1BY5s2G1LrJa7pHyPcKBiIATw

RUN apt-get update
RUN apt-get install -y libssl-dev libx11-dev libgl1-mesa-dev libxext-dev

CMD ["basic_room"]
If you want to test, everything is on my home directory (
theo
)
a
Aha. using
ws://
is working for me also, but it's seg-faulting when using `wss://`:
Copy code
export LIVEKIT_URL=<wss://ivis-lk.spieg.net>
export LIVEKIT_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjUyODE5MzUwOTYsImlzcyI6IkFQSVRzRWZpZFpqclFvWSIsIm5hbWUiOiJwMSIsIm5iZiI6MTY4MTkzODY5Niwic3ViIjoicDEiLCJ2aWRlbyI6eyJyb29tIjoidGVzdHJvb20iLCJyb29tSm9pbiI6dHJ1ZX19.Se6WNr_xV9Z8aJ1mHI1BY5s2G1LrJa7pHyPcKBiIATw
./examples/target/debug/basic_room
Segmentation fault (core dumped)
I'll test without ssl on my ARM machine as well
b
Ahhhh, yes that helps, ok I’ll try with
wss://
e
I had an issue yesterday that seems pretty similar - a segfault when
reqwest
attempted to connect to an ssl endpoint - it was segfaulting when trying to use
openssl
. It seems to be a known issue caused by multiple tls libraries being linked - I solved it by changing
reqwest
and a few other crates to use
rustls
to know if this is the issue, you could try running the binary through gdb and looking at the backtrace
a
@enough-zebra-80131 I think I ran into the same issue with reqwest, but this doesn't arise when using
libssl3
. I believe this issue is in the
webrtc-sys
module, so it's separate from the
reqwest
compatibility.
e
webrtc-sys
uses
reqwest
as well, I changed it to fix my issue:
Copy code
-reqwest = { version = "0.11", features = ["blocking", "json"] }
+reqwest = { version = "0.11", default-features = false, features = ["blocking", "json", "rustls", "rustls-tls"] }
what's the source of the segfault on the backtrace?
interestingly this issue I had yesterday on macos was also pointing to
pthread_rwlock_wrlock
I have the impression that the issue comes from having multiple crates using dependencies like
reqwest
that link different ssl libraries
b
The weird thing is that reqwest is only used for the build system of webrtc-sys 🤔
e
https://github.com/LightTwist/client-sdk-rust this is the fork I'm working on - the last commit has the changes I made
b
@enough-zebra-80131 Oh so you’re now using rustls everywhere and it is fixing the issue?
e
Yup
note: rustls doesn't seem to work on debian 😢
(tokio-tungstenite using rustls)
by using (in the `livekit`crate):
tokio-tungstenite = { version = "0.19", features = ["rustls-tls-native-roots"] }
it works!
a
Awesome. I’ll give that a try later this afternoon. And you added the feature in both webrtc-sys and livekit-api?
e
yep! every instance of
reqwest
or
tokio-tungstenite
a
compiles & runs great on my mac (as it did before). I'm building a jammy container now
b
Linux crashes with ssl connections is now fixed on upstream. Thanks @ambitious-lunch-95812 @enough-zebra-80131 @freezing-lifeguard-43174 and @incalculable-ambulance-68856 for chasing the issue 🙏
🎉 4
i
@boundless-energy-78552 @enough-zebra-80131 @ambitious-lunch-95812 Thanks a lot! I confirmed that it is now working on latest main!
🙌 2