WebRTC bus error on closure by remote peer
Closing a data channel-only connection remotely results only in a bus error, with no connection state change notification.
Here is the normal output from minimal-gstreamer-webrtc which reproduces the issue:
Minimal GStreamer WebRTC - Backend
[Signals] connecting to signal server ws://127.0.0.1:10001
[Signals] CONNECTED
[WebRTC Session 0] START
[Signals] RECEIVE {"type":"webrtc_offer","data":{"session_id":0,"webrtc_data":{"type":"offer","sdp":"v=0\r\no=- 3561884195720608271 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=extmap-allow-mixed\r\na=msid-semantic: WMS\r\n"}}}
SIGNAL WebRtcOffer { data: WebRtcOfferData { session_id: 0, webrtc_data: WebRtcData { data_type: Some("offer"), sdp: "v=0\r\no=- 3561884195720608271 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=extmap-allow-mixed\r\na=msid-semantic: WMS\r\n" } } }
[WebRtc] INCOMING SIGNAL WebRtcOffer { data: WebRtcOfferData { session_id: 0, webrtc_data: WebRtcData { data_type: Some("offer"), sdp: "v=0\r\no=- 3561884195720608271 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=extmap-allow-mixed\r\na=msid-semantic: WMS\r\n" } } }
[WebRTC Session 0] SIGNALING STATE → HaveRemoteOffer
[WebRTC Session 0] SIGNALING STATE → Stable
[Signals] SEND {"type":"webrtc_answer","data":{"session_id":0,"webrtc_data":{"type":"answer","sdp":"v=0\r\no=- 3561884195720608271 2 IN IP4 0.0.0.0\r\ns=-\r\nt=0 0\r\n"}}}
[Signals] RECEIVE {"type":"webrtc_offer","data":{"session_id":0,"webrtc_data":{"type":"offer","sdp":"v=0\r\no=- 3561884195720608271 3 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0\r\na=extmap-allow-mixed\r\na=msid-semantic: WMS\r\nm=application 9 UDP/DTLS/SCTP webrtc-datachannel\r\nc=IN IP4 0.0.0.0\r\na=ice-ufrag:wkfJ\r\na=ice-pwd:UB4IcIOxpE1oPe3BAQUTC82S\r\na=ice-options:trickle\r\na=fingerprint:sha-256 B8:CD:8B:FF:A5:F5:D4:EC:E0:9F:2E:80:77:0A:45:F4:CE:B2:9F:D7:88:0F:43:E4:A0:20:7A:43:DB:A4:87:76\r\na=setup:actpass\r\na=mid:0\r\na=sctp-port:5000\r\na=max-message-size:262144\r\n"}}}
SIGNAL WebRtcOffer { data: WebRtcOfferData { session_id: 0, webrtc_data: WebRtcData { data_type: Some("offer"), sdp: "v=0\r\no=- 3561884195720608271 3 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0\r\na=extmap-allow-mixed\r\na=msid-semantic: WMS\r\nm=application 9 UDP/DTLS/SCTP webrtc-datachannel\r\nc=IN IP4 0.0.0.0\r\na=ice-ufrag:wkfJ\r\na=ice-pwd:UB4IcIOxpE1oPe3BAQUTC82S\r\na=ice-options:trickle\r\na=fingerprint:sha-256 B8:CD:8B:FF:A5:F5:D4:EC:E0:9F:2E:80:77:0A:45:F4:CE:B2:9F:D7:88:0F:43:E4:A0:20:7A:43:DB:A4:87:76\r\na=setup:actpass\r\na=mid:0\r\na=sctp-port:5000\r\na=max-message-size:262144\r\n" } } }
[WebRtc] INCOMING SIGNAL WebRtcOffer { data: WebRtcOfferData { session_id: 0, webrtc_data: WebRtcData { data_type: Some("offer"), sdp: "v=0\r\no=- 3561884195720608271 3 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0\r\na=extmap-allow-mixed\r\na=msid-semantic: WMS\r\nm=application 9 UDP/DTLS/SCTP webrtc-datachannel\r\nc=IN IP4 0.0.0.0\r\na=ice-ufrag:wkfJ\r\na=ice-pwd:UB4IcIOxpE1oPe3BAQUTC82S\r\na=ice-options:trickle\r\na=fingerprint:sha-256 B8:CD:8B:FF:A5:F5:D4:EC:E0:9F:2E:80:77:0A:45:F4:CE:B2:9F:D7:88:0F:43:E4:A0:20:7A:43:DB:A4:87:76\r\na=setup:actpass\r\na=mid:0\r\na=sctp-port:5000\r\na=max-message-size:262144\r\n" } } }
[Signals] RECEIVE {"type":"ice_candidate","data":{"session_id":0,"webrtc_data":{"candidate":"candidate:4100071958 1 udp 2113937151 2084d8ba-48e3-45a2-8ead-97fc8cd325b1.local 43006 typ host generation 0 ufrag wkfJ network-cost 999","sdpMLineIndex":0}}}
SIGNAL IceCandidate { data: IceCandidateData { session_id: 0, webrtc_data: IceCandidateWebRtcData { candidate: "candidate:4100071958 1 udp 2113937151 2084d8ba-48e3-45a2-8ead-97fc8cd325b1.local 43006 typ host generation 0 ufrag wkfJ network-cost 999", media_id: None, line_index: Some(0), username_fragment: None } } }
[WebRtc] INCOMING SIGNAL IceCandidate { data: IceCandidateData { session_id: 0, webrtc_data: IceCandidateWebRtcData { candidate: "candidate:4100071958 1 udp 2113937151 2084d8ba-48e3-45a2-8ead-97fc8cd325b1.local 43006 typ host generation 0 ufrag wkfJ network-cost 999", media_id: None, line_index: Some(0), username_fragment: None } } }
[WebRTC Session 0] SIGNALING STATE → HaveRemoteOffer
[Signals] SEND {"type":"webrtc_answer","data":{"session_id":0,"webrtc_data":{"type":"answer","sdp":"v=0\r\no=- 3561884195720608271 3 IN IP4 0.0.0.0\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0\r\nm=application 9 UDP/DTLS/SCTP webrtc-datachannel\r\nc=IN IP4 0.0.0.0\r\na=ice-ufrag:e3MBESjP5Fm9DfEmMLnA415iHkTLElyx\r\na=ice-pwd:denmOyI/Xr2/X2dHkv6I5yZTfBRPsmnk\r\na=mid:0\r\na=setup:active\r\na=sctp-port:5000\r\na=fingerprint:sha-256 7F:C5:93:40:0E:3D:E3:CE:3F:3F:18:28:55:1B:80:A9:3F:56:AD:62:E7:1C:75:18:78:34:65:EC:3A:BA:9A:1A\r\n"}}}
[WebRTC Session 0] SIGNALING STATE → Stable
[Signals] SEND {"type":"ice_candidate","data":{"session_id":0,"webrtc_data":{"candidate":"candidate:1 1 UDP 2015363327 10.9.8.7 35838 typ host","sdpMLineIndex":0}}}
[Signals] SEND {"type":"ice_candidate","data":{"session_id":0,"webrtc_data":{"candidate":"candidate:2 1 TCP 1015021823 10.9.8.7 9 typ host tcptype active","sdpMLineIndex":0}}}
[Signals] SEND {"type":"ice_candidate","data":{"session_id":0,"webrtc_data":{"candidate":"candidate:3 1 TCP 1010827519 10.9.8.7 43031 typ host tcptype passive","sdpMLineIndex":0}}}
[Signals] SEND {"type":"ice_candidate","data":{"session_id":0,"webrtc_data":{"candidate":"candidate:4 1 UDP 2015363583 fe80::e04d:aa15:190a:e87 58702 typ host","sdpMLineIndex":0}}}
[Signals] SEND {"type":"ice_candidate","data":{"session_id":0,"webrtc_data":{"candidate":"candidate:5 1 TCP 1015022079 fe80::e04d:aa15:190a:e87 9 typ host tcptype active","sdpMLineIndex":0}}}
[Signals] SEND {"type":"ice_candidate","data":{"session_id":0,"webrtc_data":{"candidate":"candidate:6 1 TCP 1010827775 fe80::e04d:aa15:190a:e87 55495 typ host tcptype passive","sdpMLineIndex":0}}}
[WebRTC Session 0] CONNECTION STATE → Connecting
[WebRTC Session 0] CONNECTION STATE → Connected
[WebRTC Session] DATA CHANNEL test data channel
Then when the remote peer closes the connection, the only output is
[WebRTC Session 0] BUS ERROR from /GstPipeline:pipeline-0/GstWebRTCBin:webrtcbin0/GstSctpEnc:sctpenc0 - Could not write to resource.
../subprojects/gst-plugins-bad/ext/sctp/gstsctpenc.c(897): on_sctp_association_state_changed (): /GstPipeline:pipeline-0/GstWebRTCBin:webrtcbin0/GstSctpEnc:sctpenc0:
SCTP association went into error state
With no connection state change notification at all.
GStreamer 1.22.6 on Ubuntu 22.04