Closed
Bug 1395241
Opened 9 years ago
Closed 8 years ago
Crash in mozilla::DataChannelConnection::SctpDtlsOutput
Categories
(Core :: WebRTC: Networking, defect, P1)
Tracking
()
People
(Reporter: drno, Assigned: jesup)
Details
(4 keywords)
Crash Data
Attachments
(1 file)
|
1.27 KB,
patch
|
tuexen
:
review+
|
Details | Diff | Splinter Review |
Looking at crash stats it looks like we did not completely fix the problem in bug 1294095. It is still happening with a lot lower frequency then before, but still happening for example with 55.0.3.
+++ This bug was initially created as a clone of Bug #1294095 +++
This bug was filed from the Socorro interface and is
report bp-c237a768-7c3a-4c28-b18c-ad34f2160810.
=============================================================
Crashing Thread (54)
Frame Module Signature Source
0 xul.dll mozilla::DataChannelConnection::SctpDtlsOutput(void*, void*, unsigned int, unsigned char, unsigned char) netwerk/sctp/datachannel/DataChannel.cpp:691
1 xul.dll sctp_lowlevel_chunk_output netwerk/sctp/src/netinet/sctp_output.c:5010
2 mozglue.dll je_malloc memory/mozjemalloc/jemalloc.c:6184
3 xul.dll sctp_abort_an_association netwerk/sctp/src/netinet/sctputil.c:4212
4 xul.dll sctp_threshold_management netwerk/sctp/src/netinet/sctp_timer.c:167
5 xul.dll sctp_t3rxt_timer netwerk/sctp/src/netinet/sctp_timer.c:832
6 xul.dll sctp_timeout_handler netwerk/sctp/src/netinet/sctputil.c:1706
7 xul.dll sctp_handle_tick netwerk/sctp/src/netinet/sctp_callout.c:155
8 xul.dll user_sctp_timer_iterate netwerk/sctp/src/netinet/sctp_callout.c:194
9 kernel32.dll BaseThreadInitThunk
10 ntdll.dll __RtlUserThreadStart
11 ntdll.dll _RtlUserThreadStart
crashes with this signature are regressing in number since the 49 nightly cycle & the signature is currently making up 0.3% of browser crashes in 49.0b1.
Updated•9 years ago
|
status-firefox55:
--- → affected
status-firefox56:
--- → ?
status-firefox57:
--- → ?
status-firefox-esr52:
--- → affected
Updated•9 years ago
|
Whiteboard: [adv-main49+][adv-esr45.4+]
Updated•9 years ago
|
Group: core-security → media-core-security
Comment 2•9 years ago
|
||
Maire, can you help find an owner for this?
Updated•9 years ago
|
| Assignee | ||
Comment 3•9 years ago
|
||
Worth a shot to try to ensure the timer queues are cleared and won't call us back late. Michael, could this help? Note that currently we're use-after-free on the addr value ('peer' -- DataChannelConnection object) in SctpDtlsOutput(), while outputing a chunk from a SCTP_TIMER_TYPE_SHUTDOWN timer callback. It's very hard to clearly see where the timer is known to be shutdown and how one can ensure that - there's no usrsctp_disconnect() to match usrsctp_connect(). In any case, this looks safe. Might it help? is there another call we can make that's sure to help? Even if we have to call into a non-public layer?
Attachment #8907785 -
Flags: review?(tuexen)
| Assignee | ||
Updated•9 years ago
|
Assignee: nobody → rjesup
Status: NEW → ASSIGNED
Comment 4•9 years ago
|
||
Randell's going to take a shot at this because he knows about datachannels and the sctp library better than anyone else at Moz currently.
Flags: needinfo?(mreavy)
| Assignee | ||
Updated•9 years ago
|
Rank: 9
| Assignee | ||
Comment 5•9 years ago
|
||
Mass change P1->P2 to align with new Mozilla triage process.
Priority: P1 → P2
| Assignee | ||
Updated•9 years ago
|
Priority: P2 → P1
Comment 6•9 years ago
|
||
Comment on attachment 8907785 [details] [diff] [review]
shutdown SCTP sockets before usrsctp_close()
Review of attachment 8907785 [details] [diff] [review]:
-----------------------------------------------------------------
You can call that, but I don't think it will help. You can abort the association (if that is possible there) by setting the SO_LINGER option can then calling usrsctp_close() on the sockets.
I'm also working on a change in the usrsctp stack, that after registering the address, it will not be used anymore. That change should fix this issue.
Attachment #8907785 -
Flags: review?(tuexen) → review+
| Reporter | ||
Comment 7•9 years ago
|
||
Randel: do you want to land your r+ed patch and see if it helps, or do you want to wait for Michaels changes (not sure how long we would have to wait though)?
Flags: needinfo?(rjesup)
| Assignee | ||
Updated•9 years ago
|
Flags: needinfo?(rjesup)
| Reporter | ||
Updated•9 years ago
|
| Assignee | ||
Comment 8•9 years ago
|
||
This is likely wrapped up with the other shutdown bugs for SCTP
Comment 9•9 years ago
|
||
SO_LINGER is already turned off. Can someone trace the packet(s) that are being sent when addr is a dangling pointer? This might help to identify the cause.
Randell, it could be that shutdown triggers a message, so it's probably wise to reverse the calls (call usrsctp_shutdown first and then usrsctp_deregister_address). Correct me if I'm wrong, Michael.
Comment 10•8 years ago
|
||
Needinfo'ing the two persons mentioned in the comment above in case they didn't it.
Flags: needinfo?(tuexen)
Flags: needinfo?(rjesup)
| Assignee | ||
Updated•8 years ago
|
Flags: needinfo?(rjesup)
| Reporter | ||
Updated•8 years ago
|
Comment 11•8 years ago
|
||
usrsctp_shutdown() triggers the graceful shutdown. If you want to do an ungraceful shutdown, call usrsctp_close() after setting the SO_LINGER option. If you want to send SHUTDOWN chunk, you should call usrsctp_deregister_address() later.
Flags: needinfo?(tuexen)
Comment 12•8 years ago
|
||
So, calling usrsctp_shutdown is definitely not what we want as we don't do graceful shutdowns. As I know that the usrsctp code base has just been updated for Firefox, should we wait and see if it happens again? I don't see anything wrong in the call order at the moment (then again, it's threaded and really messes with my head).
| Reporter | ||
Comment 13•8 years ago
|
||
Agree that looking at comment #11 suggests that we don't land the patch. And as it's somewhat likely that is also part of the shutdown race condition we discovered we should wait and see if this issue here dis-appears as well.
| Assignee | ||
Comment 14•8 years ago
|
||
No crashes since the crash-stats DB clear in a version with the SCTP update
| Assignee | ||
Comment 15•8 years ago
|
||
another month with no crashes with SCTP update. Fixed or changed signature
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox59:
--- → ?
status-firefox60:
--- → ?
Resolution: --- → WORKSFORME
Updated•7 years ago
|
Updated•6 years ago
|
Group: media-core-security
You need to log in
before you can comment on or make changes to this bug.
Description
•