Closed Bug 1021335 Opened 10 years ago Closed 10 years ago

leaks in sctp_add_to_readq detected by LSAN

Categories

(Core :: WebRTC: Networking, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla32
Tracking Status
firefox31 --- fixed
firefox32 --- fixed

People

(Reporter: mccr8, Assigned: jesup)

References

Details

(Keywords: memory-leak, Whiteboard: [MemShrink][qa-])

Attachments

(2 files)

There's a few kb of these.

Randell, there's a bunch of leaks reported by Coverity for this SCTP code, so that's probably a good place to start trying to fix these, as that will be easier to turn into a fix than a few random LSAN stacks.
Upstream bug I imagine...
All "leaks" reported go through the same code path. The SCTP allocates memory which is given to its upper layer via the recv_callback. This memory is expected to be freed by the upper layer in the callback (or later outside). By looking at DataChannel.cc: Where are you freeing the buffer you got? At least not in the receive callback...

Best regards
Michael
Flags: needinfo?(rjesup)
That would make it my bug; taking
Assignee: nobody → rjesup
Flags: needinfo?(rjesup)
tested under ASAN with no problems
Comment on attachment 8436341 [details] [diff] [review]
Fix DataChannel leak of recv buffers from SCTP

Given the comment from Michael Tuexen (library author), I just need a sanity check review on this.  Tested under ASAN.

LSAN rocks
Attachment #8436341 - Flags: review?(tuexen)
Attachment #8436341 - Flags: review?(continuation)
Comment on attachment 8436341 [details] [diff] [review]
Fix DataChannel leak of recv buffers from SCTP

Review of attachment 8436341 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good to me.
Attachment #8436341 - Flags: review?(tuexen) → review+
Whiteboard: [MemShrink] → [MemShrink][webrtc-uplift]
Summary: Small leaks in sctp_add_to_readq detected by LSAN → leaks in sctp_add_to_readq detected by LSAN
Comment on attachment 8436341 [details] [diff] [review]
Fix DataChannel leak of recv buffers from SCTP

[Approval Request Comment]  (For 31 Aurora or Beta)
Bug caused by (feature/regressing bug #): N/A

User impact if declined: major leak using DataChannels

Testing completed (on m-c, etc.): On inbound, run datachannel tests locally under ASAN, review by library author

Risk to taking this patch (and alternatives if risky): low.  ASAN would have shown any problems.  Simple mis-use of API; API memory use wasn't documented or I missed it.

String or IDL/UUID changes made by this patch: none
Attachment #8436341 - Flags: review?(continuation) → approval-mozilla-aurora?
https://hg.mozilla.org/mozilla-central/rev/1159503d1f38
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Attachment #8436341 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Whiteboard: [MemShrink][webrtc-uplift] → [MemShrink][webrtc-uplift] [qa-]
Whiteboard: [MemShrink][webrtc-uplift] [qa-] → [MemShrink][qa-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: