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

janus crash #2277

Closed
648540858 opened this issue Jul 13, 2020 · 16 comments
Closed

janus crash #2277

648540858 opened this issue Jul 13, 2020 · 16 comments

Comments

@648540858
Copy link

In the PC, the USB camera is plugged in and out several times,janus crash。
This is the log

[4274938336463589] Creating ICE agent (ICE Lite mode, controlled)
[4274938336463589] The DTLS handshake has been completed
[janus.plugin.videoroom-0x7fd028001cf0] WebRTC media is now available
Creating new handle in session 8364171956718057: 8755820026969410; 0x7fd028006be0 0x7fd08000d740
[ERR] [plugins/janus_videoroom.c:janus_videoroom_handler:6117] Can't offer an SDP with no audio, video or data

[538482094445565] Negotiation update, checking what changed...
[538482094445565] ICE restart detected
[538482094445565] Restarting ICE...
free(): invalid pointer
@lminiero
Copy link
Member

Please get proper debugging info on master (if you're not on master, I won't look at it)
https://janus.conf.meetecho.com/docs/debug

@648540858
Copy link
Author

The reproduction steps are simplified

In the videoRoom, unplug the usb camera and plug it in 10 seconds later. The program crashes

https://gist.github.com/648540858/c4d0ba92c840f90273c778129af43263

@lminiero
Copy link
Member

Can you print the complete value of the sdp string at step #5?

@648540858
Copy link
Author

https://gist.github.com/648540858/26a602d90e5fae1bf026d0b8e27ea9e9

In order to be consistent, I uploaded error again, and the end is “answer”and “offer”

@lminiero
Copy link
Member

That's not the SDP I need. You've shared the ones the browser sees, I guess (there's the WebRTC stuff in it), but it dies before that, trying to parse the SDP the plugin passed to the core (which will be a barebone one). Again, please paste the exact value that you can retrieve via gdb, navigating to step number #5 and printing the value of sdp.

@648540858
Copy link
Author

648540858 commented Jul 14, 2020

I updated the content
https://gist.github.com/648540858/26a602d90e5fae1bf026d0b8e27ea9e9

this is the #5

v=0
o=- 8438431517591379976 3 IN IP4 1.1.1.1
s=VideoRoom 39728759
t=0 0
c=IN IP4 127.0.0.1
m=audio 9 UDP/TLS/RTP/SAVPF 111
c=IN IP4 127.0.0.1
a=recvonly
a=rtpmap:111 opus/48000/2
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
m=video 9 UDP/TLS/RTP/SAVPF 96
c=IN IP4 127.0.0.1
a=recvonly
a=rtpmap:96 VP8/90000
a=rtcp-fb:96 ccm fir
a=rtcp-fb:96 nack
a=rtcp-fb:96 nack pli
a=rtcp-fb:96 goog-remb
a=rtcp-fb:96 transport-cc
a=extmap:4 urn:3gpp:video-orientation
a=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay

@lminiero
Copy link
Member

Just tried parsing that SDP manually:

const char *sdp = <your string>;
janus_sdp *psdp = janus_sdp_parse(sdp, NULL, 0);
janus_sdp_destroy(psdp);

and it works as expected. The debugger seems to say it's crashing when doing g_strfreev, but I don't get that issue. Maybe a system-specific issue on your end? Dependencies all updated?

@648540858
Copy link
Author

If the camera is not plugged in and out, Janus will work normally. It will crash only after the camera is pulled out for a period of time. This is the version of the dependency package installed

glib-2.49.7
libnice-0.1.16
libsrtp-2.2.0
libwebsockets-3.2.3
libsrtp-2.2.0

The project was built using Ubuntu 19, Other dependencies are installed using apt

@648540858
Copy link
Author

this is Other dependencies

libffi-dev 
cmake 
wget 
python
libmicrohttpd-dev
libjansson-dev 
libssl-dev 
libsofia-sip-ua-dev 
libglib2.0-dev 
libopus-dev libogg-dev
libcurl4-openssl-dev 
liblua5.3-dev 
libconfig-dev 
pkg-config 
gengetopt 
libtool 
automake 
gtk-doc-tools 
libpcre3 
libpcre3-dev

@648540858
Copy link
Author

I use your test code, and there is no problem in my test environment。I don't think that's the reason for the problem。
How to further test

@lminiero
Copy link
Member

Try compiling with libasan: https://janus.conf.meetecho.com/docs/debug

@648540858
Copy link
Author

OK, I'll try

@648540858
Copy link
Author

@lminiero
Copy link
Member

This libasan dump finally provided some useful info. The above commit should fix it.

@648540858
Copy link
Author

Looking forward to your work

@648540858
Copy link
Author

The test passed. Very good. You are the best

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