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

[1.x]Janus crash with sip-plugin and active subscription #2974

Closed
doerner opened this issue May 10, 2022 · 11 comments
Closed

[1.x]Janus crash with sip-plugin and active subscription #2974

doerner opened this issue May 10, 2022 · 11 comments
Labels
multistream Related to Janus 1.x

Comments

@doerner
Copy link

doerner commented May 10, 2022

What version of Janus is this happening on?
1.0.1-r0 on alpinelinux

Have you tested a more recent version of Janus too?
no

Was this working before?
I do not know.

Is there a gdb or libasan trace of the issue?

Additional context
Using the sip-plugin via HTTP-long-polls I do
register with a sip server
subscribe to an other extension on the sip server (and receive also a first notify from that extension)
Reload the webpage (while the subscription is still active) => janus crashes!

@doerner doerner added the multistream Related to Janus 1.x label May 10, 2022
@lminiero
Copy link
Member

Please put some titles on the issues you open or I'll just ignore them.

@doerner doerner changed the title [1.x] [1.x]Janus crash with sip-plugin and active subscription May 10, 2022
@lminiero
Copy link
Member

Reload the webpage (while the subscription is still active) => janus crashes!

To investigate crashes we need a trace of some sorts, from gdb or even better libasan:

https://janus.conf.meetecho.com/docs/debug

@doerner
Copy link
Author

doerner commented May 11, 2022

I do have some trouble to find the location of the core dump.
What I did find is

2022-05-11T11:07:57.190502+02:00 elbx kernel: [13286827.928090] sip janus[28951]: segfault at 7f04e99b53a0 ip 00007f04e9b2be1a sp 00007f04e99544a0 error 4 in libsofia-sip-ua.so.0.6.0[7f04e9af3000+a8000]
2022-05-11T11:07:57.190535+02:00 elbx kernel: [13286827.928120] Code: 31 c0 51 4c 8d 0d 44 5a 07 00 41 b8 98 03 00 00 48 8d 15 4a 5a 07 00 e8 e4 72 fc ff 5e 5f 48 85 ed 74 3f 48 8b 05 96 80 0c 00 <48> 39 45 30 75 32 48 8b 7d 28 48 39 af 60 01 00 00 74 25 6a 00 31

I guess therefore it is another libsofia bug. => Is this the right place to report it?

@lminiero
Copy link
Member

If it's a bug in Sofia, no. If it's us using the library incorrectly, instead, yes. But unfortunately the snippet you shared doesn't help shed any light on the root cause. If you can build with libasan support and manage to replicate the problem, we should have more info to look at.

@doerner
Copy link
Author

doerner commented May 11, 2022

Unfortunately janus seems not be compiled with debugging symbols on alpine.

Here is the output if janus is run from the command line (eg not in background)

Log
Destroying session 8285860825773283; 0x7fe6b8b2a770
Detaching handle from JANUS SIP plugin; 0x7fe6b8abb640 0x7fe6b8ab6480 0x7fe6b8abb640 0x7fe6b8acea90
[janus.plugin.sip-0x7fe6b8ab6480] No WebRTC media anymore
Creating new session: 6098295951074984; 0x7fe6b8690880
Creating new handle in session 6098295951074984: 6991086509723361; 0x7fe6b8690880 0x7fe6b8abb780
Assertion failed: sub && sub->sub_ref != 0 (su_alloc.c: su_home_ref: 729)
Aborted (core dumped)

And the gdb states:

Reading symbols from /usr/bin/janus...
(No debugging symbols found in /usr/bin/janus)
[New LWP 31781]
[New LWP 31764]
[New LWP 31763]
[New LWP 31765]
[New LWP 31771]
[New LWP 31772]
[New LWP 31773]
[New LWP 31774]
[New LWP 31780]
[New LWP 31767]
[New LWP 31766]
[New LWP 31769]
[New LWP 31768]
[New LWP 31775]
[New LWP 31770]
[New LWP 31785]
Core was generated by `janus'.
Program terminated with signal SIGABRT, Aborted.
#0  0x00007fe6b9a733fa in setjmp () from /lib/ld-musl-x86_64.so.1
[Current thread is 1 (LWP 31781)]

Please note also: The core dump file (created by the pattern "core-%e) is named "core-sip\ janus".

I hope that helps!

@lminiero
Copy link
Member

I hope that helps!

Unfortunately it doesn't, it doesn't have any info we can use.

@lminiero
Copy link
Member

I only see a reference to

Assertion failed: sub && sub->sub_ref != 0 (su_alloc.c: su_home_ref: 729)

but that looks like stuff that's internal to Sofia SIP.

@lminiero
Copy link
Member

I've managed to replicate the issue, but even if I have libasan enabled, it looks like I'm getting the same limited debugging information. I'll check if I can extract some more data out of it somehow.

@lminiero
Copy link
Member

@doerner commits ba7e2a3 (multistream) and a131ad4 (0.x) should now fix both #2973 and #2974, can you check if it's working as intended for you now?

I think there may still be an issue when a subscription is created from a helper thread: I'll look into this next. For subscriptions created from the "master" session it should be fine though.

@doerner
Copy link
Author

doerner commented May 27, 2022

Thank you for taking time to look into the problems. Unfortunately I cannot compile Janus at this time to confirm your solution works. But I am sure it does, so please feel free to close the issues anytime.
In the unlikely case the problem seems to persists, I will reopen the / open a new issue.

@lminiero
Copy link
Member

Ack, I'll close both issues then 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
multistream Related to Janus 1.x
Projects
None yet
Development

No branches or pull requests

2 participants