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] Crash when freeing medium msid #3081

Closed
formater opened this issue Sep 30, 2022 · 5 comments
Closed

[1.x] Crash when freeing medium msid #3081

formater opened this issue Sep 30, 2022 · 5 comments
Labels
multistream Related to Janus 1.x

Comments

@formater
Copy link

What version of Janus is this happening on?
Janus version: 1100 (1.1.0)

Have you tested a more recent version of Janus too?
No, because I can't reproduce the crash

gdb backtrace available here:
https://gist.githubusercontent.com/formater/8424e2e88e398cd90120dcf86c48abb4/raw/680ea9eb7db7a37257471bfd410a679f4b627edf/gistfile1.txt

@formater formater added the multistream Related to Janus 1.x label Sep 30, 2022
@lminiero
Copy link
Member

We'll need many more details than "it crashed". What were you trying to do? What's the scenario? Which plugins? Any useful information? Thanks.

@formater
Copy link
Author

Sorry. The only compiled plugin is the sip plugin. The janus gateway is used as webrtc sip gateway.
I don't know what happened during the crash, because that server is in production, multiple people use the service.

It was up an running for months, and this is the first time seg fault happened. Will try to update to latest version, and wait a few more months to see if the issue still exists or not :)

@atoppi
Copy link
Member

atoppi commented Oct 13, 2022

According to the stack trace it crashed when freeing the medium->msid (line 3872)

janus-gateway/src/janus.c

Lines 3869 to 3879 in 0b5ea05

if(opusred_pt < 0 && medium != NULL && medium->opusred_pt > 0)
medium->opusred_pt = 0;
if(!have_msid) {
g_free(medium->msid);
medium->msid = NULL;
g_free(medium->mstid);
medium->mstid = NULL;
}
/* Check if rid-based simulcasting is available */
if(!have_rid && medium != NULL) {
g_free(medium->rid[0]);

The check for medium != NULL is missing in the involved block, I guess we need to address that.

@atoppi atoppi changed the title [1.x] Crash [1.x] Crash when freeing medium msid Oct 13, 2022
@lminiero
Copy link
Member

The check for medium != NULL is missing in the involved block, I guess we need to address that.

Good catch, I'll add it.

@atoppi atoppi closed this as completed in 0b974c0 Oct 13, 2022
@atoppi atoppi removed the needinfo label Oct 13, 2022
@atoppi
Copy link
Member

atoppi commented Oct 13, 2022

The above commit should fix the issue, please test and check that everything works as expected.

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

3 participants