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

Crash in Streaming Plugin when using threads > 0 #2038

Closed
BellesoftConsulting opened this issue Apr 1, 2020 · 5 comments
Closed

Crash in Streaming Plugin when using threads > 0 #2038

BellesoftConsulting opened this issue Apr 1, 2020 · 5 comments

Comments

@BellesoftConsulting
Copy link

BellesoftConsulting commented Apr 1, 2020

Hi there, I am reporting a crash in my Beloved Janus server. the crash only happens for me when using threads > 0 on a mount-point on the streaming plugin.
I am using libnice master, and the following:

Debian Buster. kernel: 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u2 (2019-11-11) x86_64 GNU/Linux

This server is running master janus , at commit: f3e1c1e
Thanks!

Backtrace:

`[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/opt/janus/bin/janus -o'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007fe73e917e65 in g_mutex_lock () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
[Current thread is 1 (Thread 0x7fe7377fe700 (LWP 22651))]
(gdb) bt
#0  0x00007fe73e917e65 in g_mutex_lock () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#1  0x00007fe73c48a9b7 in janus_streaming_handler (data=<optimized out>) at plugins/janus_streaming.c:4759
#2  0x00007fe73e8f6415 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fe73e19efa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
#4  0x00007fe73e0cf4cf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
(gdb) q`
@lminiero
Copy link
Member

lminiero commented Apr 1, 2020

Edited your post as the hashtag+number were being turned into links to other issues. Looks like it's dying on

janus_mutex_lock(&helper->mutex);

which may mean the helper was destroyed, which should only happen on a janus_streaming_mountpoint_destroy though, so it may be a race condition with viewers trying to subscribe to a mountpoint while you're destroying it (does this ring a bell?). If so, adding reference counters to helpers might help.

If you can replicate the issue, please compile Janus with libasan support and provide the output it prints after the crash.

@BellesoftConsulting
Copy link
Author

Hi Lorenzo,
Yes, it is entirely possible they were trying to subscribe while the endpoint was being destroyed.

@lminiero
Copy link
Member

lminiero commented Apr 1, 2020

Please try the PR above. If it still crashes, we'll need a libasan dump and possibly a log with REFCOUNT_DEBUG enabled (for which you'll need to edit refcount.h and recompile).

@BellesoftConsulting
Copy link
Author

ok, will try. In production, I have a solid v0.7.3 install base, which never crashes or gives me issues, only some servers on the "newer" 0.9.x. the servers in question are running
commit f3e1c1e from March 4.
do you recommend I upgrade all 0.9x from early march to master? is it stable? :)

@lminiero
Copy link
Member

lminiero commented Apr 9, 2020

Merged #2039 so I'll close. We can reopen if still an issue.

@lminiero lminiero closed this as completed Apr 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants