Open Bug 1051111 Opened 10 years ago Updated 10 months ago

Leak of an nsAStreamCopier and friends because the continuation event is rejected

Categories

(Core :: Networking, defect, P3)

ARM
Gonk (Firefox OS)
defect

Tracking

()

People

(Reporter: khuey, Unassigned)

References

Details

(Keywords: memory-leak, Whiteboard: [necko-backlog])

When shutting down B2G the log reliably has WARNING: An event was posted to a thread that will never run it (rejected): file ../../../gecko/xpcom/threads/nsThread.cpp, line 463 WARNING: unable to post continuation event: file ../../../gecko/xpcom/io/nsStreamUtils.cpp, line 450 We then leak an nsAStreamCopier and the associated stuff (a pipe, the socket transport service, a socket transport, etc). AFAICT nsSocketTransport never cancels the async copy (since it doesn't grab the copier context it shouldn't be possible for it to do so). Not really sure whether to file this in XPCOM or Necko, so lets start here on the assumption that nsSocketTransport is wrong. Also potentially relevant: bug 266789.
Flags: needinfo?(jduell.mcbugs)
Flags: needinfo?(benjamin)
It sounds to me like the problem is that we still have some stream code running this late in shutdown. So either: 1) nsAStreamCopier should observe shutdown and cancel stream copying 2) The client of nsAStreamCopier should be aware of shutdown and stop doing stuff Do we know what stream is being copied here and whether we can fix it at the client?
Flags: needinfo?(benjamin)
Patrick, got any idea here? (or an idea of who's best to look into it?)
Flags: needinfo?(jduell.mcbugs) → needinfo?(mcmanus)
(03:20:45 PM) mcmanus: so khuey - traditionally, and I speak only really from tradition here because I've never changed any of this, consumers of the sockettransportservice have observed shutdown themselves and done the cancel (03:21:23 PM) mcmanus: .. and done the cancel of any open transports when the shutdown is received (03:21:46 PM) mcmanus: so that would argue for making the change in sntp.jsm (03:22:27 PM) mcmanus: which does seem oddly distributed of what could be a centralzied function (03:36:22 PM) mcmanus: but it lets them cleanup in a application specific way.. the http code tries to spit out an error and then calls sockettransport::close(ns_error_abort)
Flags: needinfo?(mcmanus)
Whiteboard: [necko-backlog]
Priority: -- → P1
Priority: P1 → P3
Severity: normal → S3
See Also: → 1870784
You need to log in before you can comment on or make changes to this bug.