GNOME Bugzilla – Bug 768762
tests: qtmux and matroskamux reported as leaking by the leaks tracer
Last modified: 2017-02-21 15:49:06 UTC
The element 'elements/qtmux' and 'elements/matroskamux' tests are reported as leaking by the leaks tracer. That's because they have GstBuffer in their template caps ('streamheader', 'codec_data'). The template caps are leaked hence are the buffers. One way to fix this would be to mark the buffers owned by such caps as leaked as well (cf attached patch) but we did not go for this option when we introduced the LEAKED flag (see https://bugzilla.gnome.org/show_bug.cgi?id=766008#c16 ). According to https://bugzilla.gnome.org/show_bug.cgi?id=766008#c20 the tests should be change to not use such caps but I don't know the details.
Created attachment 331390 [details] [review] caps: handle buffer owned by leaked caps
Some guidance about how to solve this would be welcome. Those two tests are the last ones reported as leaking (core, base, good, ugly). Solving this bug would bring us a step closer of using the leaks detector in our QA tools (bug #767856).
The template caps shouldn't really contain buffers, I would suggest that you only add them to the actual caps later.
(In reply to Sebastian Dröge (slomo) from comment #3) > The template caps shouldn't really contain buffers, I would suggest that you > only add them to the actual caps later. Indeed, that solves it. Thanks! :)
Created attachment 345126 [details] [review] {matroska,qt}mux: don't set buffers in template caps streamheader and codec_data buffers fields are only meant to be in the negotiated caps, not the template ones. Fix leaks of those buffers as template caps are static.
Thanks for the patch! commit 0f719af3077b788f9e0d87066fdcfd19c36eca49 Author: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> Date: Tue Feb 7 17:27:56 2017 +0100 tests: matroskamux, qtmux: don't add codec_data buffers to template caps streamheader and codec_data buffers fields are only meant to be in the negotiated caps, not the template caps. Fixes false-positive leaks of those buffers detected by the leaks tracer, as template caps are static, and we decided to not include code in gstreamer core to handle this unusual case of template caps having buffers in them. https://bugzilla.gnome.org/show_bug.cgi?id=768762