-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
WebRTC causes crash on close #1482
Comments
similar problem, after some time panic: Feb 20 08:32:39 portalNew rtsp-simple-server[760]: panic: close of closed channel |
same here with v0.21.4
|
OnConnectionStateChange of pion/webrtc is not thread safe. Add a mutex to make it thread safe.
Thanks all for reporting the issue, i assumed that callbacks of the WebRTC library (pion/webrtc) were thread-safe but in fact they were not, and the same line was sometimes called twice in parallel, leading to the crash. This is fixed in v0.21.5. |
thanks! |
Thank you, excellent!
…________________________________
From: arkanoid87 ***@***.***>
Sent: Tuesday, February 21, 2023 5:54:03 PM
To: aler9/rtsp-simple-server ***@***.***>
Cc: Roger Davenport ***@***.***>; Author ***@***.***>
Subject: [EXTERNAL] Re: [aler9/rtsp-simple-server] WebRTC causes crash on close (Issue #1482)
CAUTION EXTERNAL EMAIL!
DO YOU RECOGNIZE THE SENDER? ARE YOU EXPECTING THIS EMAIL?
If this email looks suspicious, click the Report Suspicious Email button in Outlook to report it.
DO NOT click any links and NEVER input your username and password.
thanks!
—
Reply to this email directly, view it on GitHub<#1482 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AV6L3TRDYLKWNXC6Y6A4Q53WYVIRXANCNFSM6AAAAAAU7QLFOQ>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Thank you! |
Hi @aler9 I see the same issue in normal rtsp as well, I am running this on the latest docker container and 8-12 rtsp videos are connected and disconnected at random times, eventually crashing with this message. Kindly help.
|
@ajianjalil this is fixed in v1.0.2 |
@aler9 Thank you very much. |
This issue is being locked automatically because it has been closed for more than 6 months. |
Which version are you using?
v0.21.4
Which operating system are you using?
Describe the issue
panic: close of closed channel: Hard crash when reading RTSP streams through WebRTC.
Description
Describe how to replicate the issue
Have several RTSP streams pulling from security cameras and after several hours of WebRTC stream open/closes you will get a crash. Happens once a day or so.
Paths:
"paths": {
"100-100-101": {
"source": "rtsp://camera:554/Profile2/media.smp",
"sourceProtocol": "tcp",
"sourceAnyPortEnable": false,
"sourceFingerprint": "",
"sourceOnDemand": true,
"sourceOnDemandStartTimeout": "10s",
"sourceOnDemandCloseAfter": "10s",
"sourceRedirect": "",
"disablePublisherOverride": false,
"fallback": ""
WebRTC config:
"webrtcDisable": false,
"webrtcAddress": ":8889",
"webrtcEncryption": true,
"webrtcServerKey": "/certs/server.key",
"webrtcServerCert": "/certs/server.cer",
"webrtcAllowOrigin": "*",
"webrtcTrustedProxies": [],
"webrtcICEServers": [
"stun:stun.l.google.com:19302"
],
"webrtcICEHostNAT1To1IPs": [
"2.3.4.5"
],
"webrtcICEUDPMuxAddress": ":8189",
"webrtcICETCPMuxAddress": "",
Did you attach the server logs?
rtsp-simple-server_1 | 2023/02/17 11:57:30 INF [WebRTC] [conn 147.206.80.144:50349] is reading from path '1204-838310701-B316', 2 tracks (H264, G711)
rtsp-simple-server_1 | 2023/02/17 11:57:33 INF [WebRTC] [conn 10.209.20.163:58968] closed (websocket error: websocket: close 1001 (going away))
rtsp-simple-server_1 | 2023/02/17 11:57:33 INF [WebRTC] [conn 10.209.20.163:58991] closed (websocket error: websocket: close 1001 (going away))
rtsp-simple-server_1 | panic: close of closed channel
rtsp-simple-server_1 |
rtsp-simple-server_1 | goroutine 75992 [running]:
rtsp-simple-server_1 | github.com/aler9/rtsp-simple-server/internal/core.(*webRTCConn).runInner.func3(0x6)
rtsp-simple-server_1 | /s/internal/core/webrtc_conn.go:366 +0xc9
rtsp-simple-server_1 | created by github.com/pion/webrtc/v3.(*PeerConnection).onConnectionStateChange
rtsp-simple-server_1 | /go/pkg/mod/github.com/pion/webrtc/[email protected]/peerconnection.go:492 +0x173
yes
Did you attach a network dump?
NO
The text was updated successfully, but these errors were encountered: