Closed
Bug 1040345
Opened 11 years ago
Closed 11 years ago
GMP automated tests leak GeckoMediaPluginService
Categories
(Core :: WebRTC: Audio/Video, defect)
Core
WebRTC: Audio/Video
Tracking
()
RESOLVED
FIXED
mozilla33
People
(Reporter: benjamin, Assigned: jesup)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 5 obsolete files)
23.56 KB,
patch
|
jesup
:
review+
|
Details | Diff | Splinter Review |
Test-running the GMP tests, we leak the GeckoMediaPluginService:
3:20.57 nsTraceRefcnt::DumpStatistics: 1200 entries
3:20.57 TEST-INFO | leakcheck | leaked 1 GeckoMediaPluginService (40 bytes)
TEST-INFO | leakcheck | leaked 2 Mutex (24 bytes)
TEST-INFO | leakcheck | leaked 1 ReentrantMonitor (16 bytes)
TEST-INFO | leakcheck | leaked 2 nsTArray_base (8 bytes)
TEST-INFO | leakcheck | leaked 1 nsThread (124 bytes)
3:20.58 TEST-UNEXPECTED-FAIL | leakcheck | 212 bytes leaked (GeckoMediaPluginSe
rvice, Mutex, ReentrantMonitor, nsTArray_base, nsThread)
3:20.58 runtests.py | Running tests: end.
3:20.71 TEST-UNEXPECTED-FAIL | leakcheck | 212 bytes leaked (GeckoMediaPluginSe
rvice, Mutex, ReentrantMonitor, nsTArray_base, nsThread)
Flags: needinfo?(mreavy)
Assignee | ||
Comment 1•11 years ago
|
||
still leaks with this
Assignee | ||
Comment 2•11 years ago
|
||
Found the major cause - GMPParent::UnloadProcess() was killing the plugin container before it could process the Encoding/DecodingComplete requests and respond. It was assuming they were synchronous. Modified it to check if we can unload as each encoder/decoder is removed. This now appears to work, but exposed a refcounting problem with GMPParent now that the cleanup code is actually running.
Assignee | ||
Updated•11 years ago
|
Attachment #8458433 -
Attachment is obsolete: true
Assignee | ||
Comment 3•11 years ago
|
||
more cleanup of encoders/decoders in shutdown; now only leaks the service and nsThread
Assignee | ||
Updated•11 years ago
|
Attachment #8458506 -
Attachment is obsolete: true
Updated•11 years ago
|
Assignee: nobody → rjesup
Flags: needinfo?(mreavy)
Assignee | ||
Comment 4•11 years ago
|
||
with lots of debugging, and assumes you have the real plugin in the path. Now only leaks a single nsThread and children (the GMPThread)
Assignee | ||
Updated•11 years ago
|
Attachment #8458548 -
Attachment is obsolete: true
Assignee | ||
Comment 5•11 years ago
|
||
This works and passes cleanly locally. Last key was noting that the GMP WebrtcCodec wasn't getting cleaned up - it would get Release()ed (not it's not refcounted), but not deleted. Now stored in an AutoPtr in the conduit (the config already was, but not the external codec).
Assignee | ||
Updated•11 years ago
|
Attachment #8458749 -
Attachment is obsolete: true
Assignee | ||
Comment 6•11 years ago
|
||
Comment on attachment 8458819 [details] [diff] [review]
Fix shutdown design issues with Webrtc GMP interfaces and quash leaks
the feedbacks for cpearce and bsmedberg are optional, in case they want to comment
Attachment #8458819 -
Flags: review?(gpascutto)
Attachment #8458819 -
Flags: feedback?(cpearce)
Attachment #8458819 -
Flags: feedback?(benjamin)
Reporter | ||
Comment 7•11 years ago
|
||
Comment on attachment 8458819 [details] [diff] [review]
Fix shutdown design issues with Webrtc GMP interfaces and quash leaks
Did you fold the patch from bug 1039572 into yours? I just landed that, so this may need to be unfolded/rebased.
Comment 8•11 years ago
|
||
Comment on attachment 8458819 [details] [diff] [review]
Fix shutdown design issues with Webrtc GMP interfaces and quash leaks
Review of attachment 8458819 [details] [diff] [review]:
-----------------------------------------------------------------
Looks sane to me but someone who's more familiar with how this works should sign of too.
::: content/media/gmp/GMPParent.cpp
@@ +128,5 @@
>
> + // Note: the shutdown of the codecs is async! don't kill
> + // the plugin-container until they're all safely shut down via
> + // MaybeUnloadProcess()
> + MaybeUnloadProcess(); // really only for the case of none
naming nit: Usually I'd expect MaybeUnloadProcess would call UnloadProcess. Think about this way: you're calling a function called UnloadProcess, but it may not actually end up doing that.
I'd call this StartUnloadProcess but that's actually an awkward name too.
@@ +185,5 @@
> + // Not really safe if we just grab to the mGMPThread, as we don't know
> + // what thread we're running on and other threads may be trying to
> + // access this without locks! However, debug only, and primary failure
> + // mode outside of compiler-helped TSAN is a leak. But better would be
> + // to use swap() under a lock.
...so why not do that?
::: media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp
@@ +120,5 @@
> mMPS = do_GetService("@mozilla.org/gecko-media-plugin-service;1");
> MOZ_ASSERT(mMPS);
>
> + if (!mGMPThread) {
> + if (NS_WARN_IF(NS_FAILED(mMPS->GetThread(getter_AddRefs(mGMPThread))))) {
No need to try to cram this on one line, let alone that the line that outputs a warning is somehow embedded in the if...
@@ +556,5 @@
>
> int32_t
> WebrtcGmpVideoDecoder::Reset()
> {
> + // XXX ?
Bug nr?
Attachment #8458819 -
Flags: review?(gpascutto) → review+
Assignee | ||
Comment 9•11 years ago
|
||
unbitrotted
Assignee | ||
Updated•11 years ago
|
Attachment #8458819 -
Attachment is obsolete: true
Attachment #8458819 -
Flags: feedback?(cpearce)
Attachment #8458819 -
Flags: feedback?(benjamin)
Assignee | ||
Comment 10•11 years ago
|
||
Comment on attachment 8459121 [details] [diff] [review]
Fix shutdown design issues with Webrtc GMP interfaces and quash leaks
Merged with changes by bsmedberg
carry forward r=gcp
Attachment #8459121 -
Flags: review+
Assignee | ||
Comment 11•11 years ago
|
||
Target Milestone: --- → mozilla33
Assignee | ||
Comment 12•11 years ago
|
||
Comment 13•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•