Perma tier2 LeakSanitizer | leak at NewSegment, CreateSegment, mozilla::ipc::Shmem::Alloc, mozilla::ipc::IToplevelProtocol::CreateSharedMemory
Categories
(Core :: Audio/Video: MediaStreamGraph, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr60 | --- | unaffected |
firefox-esr68 | --- | unaffected |
firefox68 | --- | unaffected |
firefox69 | --- | unaffected |
firefox70 | --- | fixed |
firefox71 | --- | fixed |
People
(Reporter: intermittent-bug-filer, Assigned: pehrsons)
References
(Regression)
Details
(Keywords: intermittent-failure, regression, Whiteboard: [stockwell disable-recommended])
Attachments
(1 file)
47 bytes,
text/x-phabricator-request
|
lizzard
:
approval-mozilla-beta+
|
Details | Review |
Filed by: apavel [at] mozilla.com
Parsed log: https://treeherder.mozilla.org/logviewer.html#?job_id=264060060&repo=autoland
Full log: https://queue.taskcluster.net/v1/task/NbNkvZ8pS0uSja3lhKVYzg/runs/0/artifacts/public/logs/live_backing.log
task 2019-08-29T15:02:50.302Z] 15:02:50 INFO - TEST-START | /mixed-content/worklet-paint-data-import/meta-csp/same-host-http/top-level/no-redirect/blockable/opt-in-blocks.https.html
[task 2019-08-29T15:02:50.306Z] 15:02:50 INFO - Closing window 119
[task 2019-08-29T15:02:50.465Z] 15:02:50 INFO - PID 18385 | -----------------------------------------------------
[task 2019-08-29T15:02:50.466Z] 15:02:50 INFO - PID 18385 | Suppressions used:
[task 2019-08-29T15:02:50.466Z] 15:02:50 INFO - PID 18385 | count bytes template
[task 2019-08-29T15:02:50.466Z] 15:02:50 INFO - PID 18385 | 27 832 nsComponentManagerImpl
[task 2019-08-29T15:02:50.466Z] 15:02:50 INFO - PID 18385 | 611 17713 libfontconfig.so
[task 2019-08-29T15:02:50.466Z] 15:02:50 INFO - PID 18385 | 1 29 libglib-2.0.so
[task 2019-08-29T15:02:50.467Z] 15:02:50 INFO - PID 18385 | -----------------------------------------------------
[task 2019-08-29T15:02:51.392Z] 15:02:51 INFO - .
[task 2019-08-29T15:02:51.392Z] 15:02:51 INFO - TEST-OK | /mixed-content/worklet-paint-data-import/meta-csp/same-host-http/top-level/no-redirect/blockable/opt-in-blocks.https.html | took 1091ms
[task 2019-08-29T15:02:55.211Z] 15:02:55 INFO - Browser exited with return code 0
[task 2019-08-29T15:02:55.211Z] 15:02:55 INFO - PROCESS LEAKS None
[task 2019-08-29T15:02:55.212Z] 15:02:55 INFO - ERROR | LeakSanitizer | SUMMARY: AddressSanitizer: 176 byte(s) leaked in 2 allocation(s).
[task 2019-08-29T15:02:55.212Z] 15:02:55 INFO - LeakSanitizer | To show the addresses of leaked objects add report_objects=1 to LSAN_OPTIONS
[task 2019-08-29T15:02:55.212Z] 15:02:55 INFO - This can be done in testing/mozbase/mozrunner/mozrunner/utils.py
[task 2019-08-29T15:02:55.212Z] 15:02:55 INFO - Allowed depth was 4
[task 2019-08-29T15:02:55.212Z] 15:02:55 INFO - TEST-UNEXPECTED-FAIL | LeakSanitizer | leak at NewSegment, CreateSegment, mozilla::ipc::Shmem::Alloc, mozilla::ipc::IToplevelProtocol::CreateSharedMemory
[task 2019-08-29T15:02:55.213Z] 15:02:55 INFO - TEST-UNEXPECTED-FAIL | LeakSanitizer | leak at mozilla::layers::BufferTextureData::CreateInternal, mozilla::layers::BufferTextureData::CreateForYCbCr, mozilla::layers::TextureClient::CreateForYCbCr, mozilla::layers::YCbCrTextureClientAllocationHelper::Allocate
[task 2019-08-29T15:02:55.214Z] 15:02:55 INFO - Closing logging queue
Updated•6 years ago
|
Comment 1•6 years ago
|
||
Comment 2•6 years ago
|
||
Andreas, could you please look into these leaks? Thank you.
https://treeherder.mozilla.org/#/jobs?repo=autoland&group_state=expanded&resultStatus=success%2Ctestfailed%2Cbusted%2Cexception&classifiedState=unclassified&searchStr=linux%2Cx64%2Casan%2Cweb%2Cplatform%2Ctests%2Ctest-linux64-asan%2Fopt-web-platform-tests-e10s-4%2Cw%28wpt4%29&tochange=212bfffe0a67c43e2c622a74b0009f182bbb6ffc&fromchange=8edbf8fe48bfd2daeff36e5a6716e5d8c6cc3f69&selectedJob=264078335
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 3•6 years ago
|
||
I can see where these shmem buffers are allocated -- but the question is where they're held when we leak. I'll have to dig deeper tomorrow.
Comment hidden (Intermittent Failures Robot) |
Assignee | ||
Comment 5•6 years ago
|
||
This is the relevant part of the stack when releasing that gfx resource, from a try run where I elevated the gfx error:
[task 2019-08-29T19:17:01.714Z] 19:17:01 INFO - PID 18332 | #23 0x7f8b7e1c33ed in mozilla::layers::SharedPlanarYCbCrImage::~SharedPlanarYCbCrImage() /builds/worker/workspace/build/src/gfx/layers/ipc/SharedPlanarYCbCrImage.cpp:36:51
[task 2019-08-29T19:17:01.724Z] 19:17:01 INFO - PID 18332 | #24 0x7f8b81efa3be in Release /builds/worker/workspace/build/src/obj-firefox/dist/include/ImageContainer.h:194:3
[task 2019-08-29T19:17:01.726Z] 19:17:01 INFO - PID 18332 | #25 0x7f8b81efa3be in Release /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/RefPtr.h:48
[task 2019-08-29T19:17:01.727Z] 19:17:01 INFO - PID 18332 | #26 0x7f8b81efa3be in Release /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/RefPtr.h:373
[task 2019-08-29T19:17:01.729Z] 19:17:01 INFO - PID 18332 | #27 0x7f8b81efa3be in ~RefPtr /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/RefPtr.h:79
[task 2019-08-29T19:17:01.731Z] 19:17:01 INFO - PID 18332 | #28 0x7f8b81efa3be in ~VideoFrame /builds/worker/workspace/build/src/dom/media/VideoSegment.cpp:30
[task 2019-08-29T19:17:01.732Z] 19:17:01 INFO - PID 18332 | #29 0x7f8b81efa3be in ~VideoChunk /builds/worker/workspace/build/src/dom/media/VideoSegment.h:65
[task 2019-08-29T19:17:01.734Z] 19:17:01 INFO - PID 18332 | #30 0x7f8b81efa3be in Destruct /builds/worker/workspace/build/src/obj-firefox/dist/include/nsTArray.h:554
[task 2019-08-29T19:17:01.735Z] 19:17:01 INFO - PID 18332 | #31 0x7f8b81efa3be in DestructRange /builds/worker/workspace/build/src/obj-firefox/dist/include/nsTArray.h:2224
[task 2019-08-29T19:17:01.737Z] 19:17:01 INFO - PID 18332 | #32 0x7f8b81efa3be in ClearAndRetainStorage /builds/worker/workspace/build/src/obj-firefox/dist/include/nsTArray.h:1329
[task 2019-08-29T19:17:01.738Z] 19:17:01 INFO - PID 18332 | #33 0x7f8b81efa3be in ~nsTArray_Impl /builds/worker/workspace/build/src/obj-firefox/dist/include/nsTArray.h:910
[task 2019-08-29T19:17:01.740Z] 19:17:01 INFO - PID 18332 | #34 0x7f8b81efa3be in mozilla::MediaSegmentBase<mozilla::VideoSegment, mozilla::VideoChunk>::~MediaSegmentBase() /builds/worker/workspace/build/src/dom/media/MediaSegment.h:235
[task 2019-08-29T19:17:01.741Z] 19:17:01 INFO - PID 18332 | #35 0x7f8b81eea3ed in ~VideoSegment /builds/worker/workspace/build/src/dom/media/VideoSegment.cpp:112:32
[task 2019-08-29T19:17:01.743Z] 19:17:01 INFO - PID 18332 | #36 0x7f8b81eea3ed in mozilla::VideoSegment::~VideoSegment() /builds/worker/workspace/build/src/dom/media/VideoSegment.cpp:112
[task 2019-08-29T19:17:01.744Z] 19:17:01 INFO - PID 18332 | #37 0x7f8b82257dbc in ~nsAutoPtr /builds/worker/workspace/build/src/obj-firefox/dist/include/nsAutoPtr.h:65:18
[task 2019-08-29T19:17:01.746Z] 19:17:01 INFO - PID 18332 | #38 0x7f8b82257dbc in ~Track /builds/worker/workspace/build/src/dom/media/StreamTracks.h:70
[task 2019-08-29T19:17:01.747Z] 19:17:01 INFO - PID 18332 | #39 0x7f8b82257dbc in ~nsAutoPtr /builds/worker/workspace/build/src/obj-firefox/dist/include/nsAutoPtr.h:65
[task 2019-08-29T19:17:01.748Z] 19:17:01 INFO - PID 18332 | #40 0x7f8b82257dbc in Destruct /builds/worker/workspace/build/src/obj-firefox/dist/include/nsTArray.h:554
[task 2019-08-29T19:17:01.749Z] 19:17:01 INFO - PID 18332 | #41 0x7f8b82257dbc in DestructRange /builds/worker/workspace/build/src/obj-firefox/dist/include/nsTArray.h:2224
[task 2019-08-29T19:17:01.750Z] 19:17:01 INFO - PID 18332 | #42 0x7f8b82257dbc in ClearAndRetainStorage /builds/worker/workspace/build/src/obj-firefox/dist/include/nsTArray.h:1329
[task 2019-08-29T19:17:01.750Z] 19:17:01 INFO - PID 18332 | #43 0x7f8b82257dbc in Clear /builds/worker/workspace/build/src/obj-firefox/dist/include/nsTArray.h:1805
[task 2019-08-29T19:17:01.750Z] 19:17:01 INFO - PID 18332 | #44 0x7f8b82257dbc in mozilla::StreamTracks::Clear() /builds/worker/workspace/build/src/dom/media/StreamTracks.cpp:98
[task 2019-08-29T19:17:01.765Z] 19:17:01 INFO - PID 18332 | #45 0x7f8b822104d3 in mozilla::MediaStream::DestroyImpl() /builds/worker/workspace/build/src/dom/media/MediaStreamGraph.cpp:1985:11
[task 2019-08-29T19:17:01.765Z] 19:17:01 INFO - PID 18332 | #46 0x7f8b82214c3f in mozilla::SourceMediaStream::DestroyImpl() /builds/worker/workspace/build/src/dom/media/MediaStreamGraph.cpp:2412:16
[task 2019-08-29T19:17:01.765Z] 19:17:01 INFO - PID 18332 | #47 0x7f8b82239f1c in mozilla::MediaStream::Destroy()::Message::Run() /builds/worker/workspace/build/src/dom/media/MediaStreamGraph.cpp:1999:16
[task 2019-08-29T19:17:01.767Z] 19:17:01 INFO - PID 18332 | #48 0x7f8b82206cd9 in mozilla::MediaStreamGraphImpl::RunMessagesInQueue() /builds/worker/workspace/build/src/dom/media/MediaStreamGraph.cpp:1167:20
[task 2019-08-29T19:17:01.770Z] 19:17:01 INFO - PID 18332 | #49 0x7f8b8220aed6 in mozilla::MediaStreamGraphImpl::OneIterationImpl(long) /builds/worker/workspace/build/src/dom/media/MediaStreamGraph.cpp:1400:3
[task 2019-08-29T19:17:01.770Z] 19:17:01 INFO - PID 18332 | #50 0x7f8b81f60be7 in mozilla::AudioCallbackDriver::DataCallback(float const*, float*, long) /builds/worker/workspace/build/src/dom/media/GraphDriver.cpp:882:36
Assignee | ||
Comment 6•6 years ago
|
||
It looks like what leads to this is a window being closed and a CubebOperation (driver switch/start ?) taking some time to finish, leading us to iterate the graph later than expected:
[task 2019-08-29T19:16:59.974Z] 19:16:59 INFO - TEST-START | /mediacapture-streams/MediaStream-finished-add.https.html
[task 2019-08-29T19:16:59.974Z] 19:16:59 INFO - Closing window 61
[task 2019-08-29T19:17:00.100Z] 19:17:00 INFO - PID 18332 | SharedThreadPool in xpcom-shutdown-threads. Waiting for pools "CubebOperation"
...
[task 2019-08-29T19:17:00.753Z] 19:17:00 INFO - PID 18332 | Crash Annotation GraphicsCriticalError: |[C0][GFX1]: Texture deallocated too late during shutdown (t=4.40205) [GFX1]: Texture deallocated too late during shutdown
[task 2019-08-29T19:17:00.753Z] 19:17:00 INFO - PID 18332 | Assertion failure: false (Texture deallocated too late during shutdown), at /builds/worker/workspace/build/src/gfx/layers/client/TextureClient.cpp:481
Having a MediaStream around in xpcom-shutdown-threads is unexpected.
MediaStreamGraph has an AsyncShutdownBlocker -- are we removing that before all streams are removed?
Assignee | ||
Comment 7•6 years ago
|
||
Right, if the blocker is notified of shutdown after the last stream has been removed on main thread (graph removed from gGraphs), that graph won't be notified, and shutdown progresses too soon.
Assignee | ||
Updated•6 years ago
|
Comment hidden (Intermittent Failures Robot) |
Comment 9•6 years ago
|
||
Hi Andreas. seeing that this has a very high occurrence rate, can you give a time estimate for a fix?
Comment hidden (Intermittent Failures Robot) |
Comment 11•6 years ago
|
||
I wonder whether it is possible to create a ShutdownTicket when we remove the graph from gGraphs, which I assume is when we know the graph will be shutdown, but that is assuming that remaining ports will be removed soon. Maybe it would be more consistent to only remove from gGraphs when there are neither streams nor ports.
Comment hidden (Intermittent Failures Robot) |
Updated•6 years ago
|
Assignee | ||
Comment 13•6 years ago
|
||
I expect to get a fix in today. I wrote up a patch on friday that hit some issues but now largely works. It does a bit much perhaps and is prone to create leaks. I'll write up a simpler thing today that focuses on MediaStreamGraph rather than the general ShutdownBlocker/ShutdownTicket mechanisms.
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 14•6 years ago
|
||
Depends on D44369
Assignee | ||
Comment 15•6 years ago
|
||
Updated•6 years ago
|
Assignee | ||
Comment 16•6 years ago
|
||
This will have to wait until tomorrow, because of the timezone difference to the reviewer. padenot was not able to review today.
Comment 17•6 years ago
|
||
Comment hidden (Intermittent Failures Robot) |
Comment 19•6 years ago
|
||
bugherder |
Assignee | ||
Comment 20•6 years ago
|
||
Comment on attachment 9089870 [details]
Bug 1577534 - Give MediaStreamGraphs individual ShutdownBlockers. r?karlt
Beta/Release Uplift Approval Request
- User impact if declined: Possible small leak if a content process is shut down at the wrong time. High frequency in CI.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: No
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Slight functionality refactor that looks fairly large. No timing or threading changes which is why I consider it low risk.
- String changes made/needed:
Comment 22•6 years ago
|
||
Comment on attachment 9089870 [details]
Bug 1577534 - Give MediaStreamGraphs individual ShutdownBlockers. r?karlt
Fix for shutdown memory leak, OK for uplift for beta 4.
Comment 23•6 years ago
|
||
bugherder uplift |
Comment hidden (Intermittent Failures Robot) |
Updated•4 years ago
|
Description
•