WebRTSP / ReStreamer

Media URLs ReStreamer and Cloud DVR
GNU General Public License v3.0
32 stars 6 forks source link

ReStreamer Segfaults when configured with a turn server but the turnserver is not reachable #20

Closed eslam-ahmed-khair closed 2 years ago

eslam-ahmed-khair commented 2 years ago

Hello,

I added a turn server to ReStreamer configuration file and I noticed that if the turnserver is not running and a clients attempts a connection, Restreamer always segfaults at some point. Here's a small log that may help you:

[2021-12-29 10:34:03.871] [GstRtStreaming] [trace] [GstWebRTCPeerBase] Signaling State changed: "GST_WEBRTC_SIGNALING_STATE_STABLE"
Segmentation fault (core dumped)
RSATom commented 2 years ago

@eslam-ahmed-khair Are you still on old GStreamer version?

eslam-ahmed-khair commented 2 years ago

@eslam-ahmed-khair Are you still on old GStreamer version?

I am afraid, Yes!

RSATom commented 2 years ago

Then I would recommend you try the latest version and if issue will still persists I'll try to investigate it. I just was not able to reproduce issue with Ubuntu 21.10

eslam-ahmed-khair commented 2 years ago

I was able to produce it using an Ubuntu 21.10 docker image.

restreamer.conf used:

ws-port: 5554
http-port: 5080

streamers: (
{name: "1",            url: "rtsp://admin:admin@192.168.0.222/defaultPrimary?streamType=u",              description: "1", force-h264-profile-level-id: "42c015"}
)

stun-server: "stun://192.168.1.108:3478"
turn-server : "turn://admin:admin@192.168.1.108:3478"
debug: {
  log-level: 5
}

Now if the turnserver is not running, you get instant segfault in ReStreamer.

RSATom commented 2 years ago

@eslam-ahmed-khair can you provide backtrace?

eslam-ahmed-khair commented 2 years ago

@eslam-ahmed-khair can you provide backtrace?

Sorry for the late response. The backtrace isn't much really, it shows that it originates from libnice

Thread 24 "gst-nice-ops" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff9cd3b700 (LWP 78584)]
0x00007fffdc625438 in ?? () from /lib/x86_64-linux-gnu/libnice.so.10
(gdb) bt
#0  0x00007fffdc625438 in  () at /lib/x86_64-linux-gnu/libnice.so.10
#1  0x00007fffdc60fb00 in  () at /lib/x86_64-linux-gnu/libnice.so.10
#2  0x00007fffdc61833a in  () at /lib/x86_64-linux-gnu/libnice.so.10
#3  0x00007fffdc618401 in  () at /lib/x86_64-linux-gnu/libnice.so.10
#4  0x00007fffdc6057be in  () at /lib/x86_64-linux-gnu/libnice.so.10
#5  0x00007ffff7dabbe8 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#6  0x00007ffff7dab04e in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#7  0x00007ffff7dab400 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#8  0x00007ffff7dab6f3 in g_main_loop_run () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#9  0x00007fffdc68ac9c in  () at /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstwebrtc.so
#10 0x00007ffff7dd4ad1 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#11 0x00007ffff7936609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#12 0x00007ffff785b293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
RSATom commented 2 years ago

@eslam-ahmed-khair do you have libnice-dbg installed? Also, did you try the same config with snap package? - It uses the latest (v0.1.18) libnice.

eslam-ahmed-khair commented 2 years ago

Will re-open once reproduced via snap.