Open Bug 1242597 Opened 8 years ago Updated 2 years ago

reference loop in nsSocketTransport AsyncCopy

Categories

(Core :: Networking, defect, P3)

defect

Tracking

()

People

(Reporter: mcmanus, Unassigned)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [necko-active])

Attachments

(1 file)

when using an async copier with a pipe, a refernece loop can form as
follows:

copier holds reference to transport (via &mOutput argument to
NS_AsynCopy) and eventually through nsStreamUtils.h calls
transport::outputstream::asyncwait using the copier as the
callback. the asyncwait() method holds a reference to the copier until
calling OnOutputStream ready. The copier also references transport, so
a loop is formed and if OnOutputStreamReady is not called it does not
get broken - both the copier and the transport are leaked.

(an example of this is in OpenOutputStream() where the code path does NS_AsyncCopy)

the patch rejects asyncwait() calls for sockets that have been already
been detached. (detaching results in the outputstreamready function
being invoked and the callback being cleared.)
Attachment #8711743 - Flags: review?(dd.mozilla)
Attachment #8711743 - Flags: review?(dd.mozilla) → review+
https://hg.mozilla.org/mozilla-central/rev/7e32d3531b96
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
Target Milestone: mozilla46 → mozilla47
backed out for crashes in 1243424
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
https://hg.mozilla.org/mozilla-central/rev/22f3ea5449d7
Status: REOPENED → RESOLVED
Closed: 8 years ago8 years ago
Resolution: --- → FIXED
(In reply to Carsten Book [:Tomcat] from comment #7)
> https://hg.mozilla.org/mozilla-central/rev/22f3ea5449d7

This looks like backout, so reopening
or I'm wrong Carsten Book [:Tomcat]?
Status: RESOLVED → REOPENED
Flags: needinfo?(cbook)
Resolution: FIXED → ---
(In reply to Virtual_ManPL [:Virtual] from comment #8)
> (In reply to Carsten Book [:Tomcat] from comment #7)
> > https://hg.mozilla.org/mozilla-central/rev/22f3ea5449d7
> 
> This looks like backout, so reopening
> or I'm wrong Carsten Book [:Tomcat]?

indeed seems the tool didn't detected this, thanks!
Flags: needinfo?(cbook)
Whiteboard: [necko-active]
Summary: reference loop in nsSocketTransport AsnycCopy → reference loop in nsSocketTransport AsyncCopy
Blocks: 1240568
Worth working on but Patrick doesn't have cycles right now. Volunteers?
Assignee: mcmanus → nobody
Let's land this, and see if we still have the same crash.
Assignee: nobody → dd.mozilla
Status: REOPENED → ASSIGNED
Target Milestone: mozilla47 → ---
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/6a0f2b93749a
Fix nsSocketTransport reference loop. r=dragana
Keywords: checkin-needed
Bulk priority update: https://bugzilla.mozilla.org/show_bug.cgi?id=1399258
Priority: -- → P1
Priority: P1 → P2
Moving to p3 because no activity for at least 1 year(s).
See https://github.com/mozilla/bug-handling/blob/master/policy/triage-bugzilla.md#how-do-you-triage for more information
Priority: P2 → P3
Flags: needinfo?(dd.mozilla)
Severity: normal → S3

I will not have time to work on this bug, so I am unassigning myself.

Assignee: dd.mozilla → nobody
Status: ASSIGNED → NEW
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: