Missing DTLS alert on PeerConnection.close()
Categories
(Core :: WebRTC: Networking, defect, P2)
Tracking
()
| backlog | webrtc/webaudio+ |
People
(Reporter: drno, Assigned: mjf)
References
Details
Attachments
(2 files)
| Reporter | ||
Comment 1•9 years ago
|
||
| Reporter | ||
Comment 2•9 years ago
|
||
| Comment hidden (mozreview-request) |
| Reporter | ||
Updated•9 years ago
|
Comment 4•9 years ago
|
||
| mozreview-review | ||
| Reporter | ||
Comment 5•9 years ago
|
||
| mozreview-review-reply | ||
| Comment hidden (mozreview-request) |
Comment 7•9 years ago
|
||
| mozreview-review | ||
| Comment hidden (mozreview-request) |
Comment 10•9 years ago
|
||
| bugherder | ||
Comment 11•5 years ago
|
||
Is this a problem again?
I can reproduce this again with the latest firefox version (78.0.1) and the nightly version.
I create a Peer connection, then i close it with close(), and i cannot see a dtls alert using wireshark.
Comment 12•5 years ago
|
||
Michael, you're working on something related to this, right?
| Assignee | ||
Comment 13•5 years ago
|
||
I'm not working on it yet, but :kjacbos ID'd the basic issue a few days ago. SSL3_SendAlert is trying to send the alert, but the stream in NrIceMediaStream::SendPacket is null. This was the trace he gave me showing the issue:
Process 79812 stopped
* thread #10, name = 'Socket Thread', stop reason = breakpoint 1.1
frame #0: 0x0000000101c298a8 libnss3.dylib`SSL3_SendAlert(ss=0x00000001373fe000, level=alert_warning, desc=close_notify) at ssl3con.c:2869:13 [opt]
2866 SECStatus
2867 SSL3_SendAlert(sslSocket *ss, SSL3AlertLevel level, SSL3AlertDescription desc)
2868 {
-> 2869 PRUint8 bytes[2];
2870 SECStatus rv;
2871 PRBool needHsLock = !ssl_HaveSSL3HandshakeLock(ss);
2872
Target 0: (firefox) stopped.
(lldb) br set -n NrIceMediaStream::SendPacket
Breakpoint 2: where = XUL`mozilla::NrIceMediaStream::SendPacket(int, unsigned char const*, unsigned long) + 45 at nricemediastream.cpp:621:33, address = 0x0000000102fe2c8d
(lldb) cont
Process 79812 resuming
XUL was compiled with optimization - stepping may behave oddly; variables may not be available.
Process 79812 stopped
* thread #10, name = 'Socket Thread', stop reason = breakpoint 2.1
frame #0: 0x0000000102fe2c8d XUL`mozilla::NrIceMediaStream::SendPacket(this=0x00000001335fe040, component_id=1, data="/?d, len=24) at nricemediastream.cpp:621:33 [opt]
618
619 nsresult NrIceMediaStream::SendPacket(int component_id,
620 const unsigned char* data, size_t len) {
-> 621 nr_ice_media_stream* stream = old_stream_ ? old_stream_ : stream_;
622 if (!stream) {
623 return NS_ERROR_FAILURE;
624 }
Target 0: (firefox) stopped.
(lldb) n
Process 79812 stopped
* thread #10, name = 'Socket Thread', stop reason = step over
frame #0: 0x0000000102fe2ca0 XUL`mozilla::NrIceMediaStream::SendPacket(this=0x00000001335fe040, component_id=1, data="/?d, len=24) at nricemediastream.cpp:622:8 [opt]
619 nsresult NrIceMediaStream::SendPacket(int component_id,
620 const unsigned char* data, size_t len) {
621 nr_ice_media_stream* stream = old_stream_ ? old_stream_ : stream_;
-> 622 if (!stream) {
623 return NS_ERROR_FAILURE;
624 }
625
Target 0: (firefox) stopped.
(lldb) p stream
(mozilla::nr_ice_media_stream *) $0 = 0x0000000000000000
(lldb) bt
* thread #10, name = 'Socket Thread', stop reason = step over
* frame #0: 0x0000000102fe2ca0 XUL`mozilla::NrIceMediaStream::SendPacket(this=0x00000001335fe040, component_id=1, data="/?d, len=24) at nricemediastream.cpp:622:8 [opt]
frame #1: 0x00000001030078a9 XUL`mozilla::TransportLayerIce::SendPacket(this=0x000000013561d040, packet=0x000070000c612e10) at transportlayerice.cpp:125:27 [opt]
frame #2: 0x0000000102ff3ae8 XUL`mozilla::TransportLayerNSPRAdapter::Write(this=0x0000000137494bc0, buf=<unavailable>, length=<unavailable>) at transportlayerdtls.cpp:105:32 [opt]
frame #3: 0x0000000101c4bedb libnss3.dylib`ssl_DefSend(ss=0x00000001373fe000, buf="/?d, len=24, flags=0) at ssldef.c:105:18 [opt]
frame #4: 0x0000000101c2cc1e libnss3.dylib`ssl3_SendRecord(ss=0x00000001373fe000, cwSpec=0x0000000135621ed0, ct=<unavailable>, pIn=<unavailable>, nIn=<unavailable>, flags=0) at ssl3con.c:2575:20 [opt]
frame #5: 0x0000000101c29a4e libnss3.dylib`SSL3_SendAlert(ss=0x00000001373fe000, level=alert_warning, desc=close_notify) at ssl3con.c:2903:16 [opt]
frame #6: 0x0000000101c5260b libnss3.dylib`ssl_SecureClose(ss=0x00000001373fe000) at sslsecur.c:684:15 [opt]
frame #7: 0x0000000102ff4063 XUL`mozilla::TransportLayerDtls::~TransportLayerDtls() [inlined] mozilla::UniquePRFileDescDeletePolicy::operator(aValue=<unavailable>)(PRFileDesc*) at ScopedNSSTypes.h:301:1 ```
Comment 14•5 years ago
|
||
BTW, we will only send this once, and packets get lost. But it seems like Michael has a handle on where this is failing, so at least we don't fail 100% of the time.
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Comment 15•5 years ago
|
||
If the NrIceCtx is torn down first there is not a valid media stream on which
to send the close_notify alert.
| Assignee | ||
Comment 16•5 years ago
|
||
Comment 17•5 years ago
|
||
Comment 18•5 years ago
|
||
| bugherder | ||
Description
•