After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 765903 - fix various leaks in tests
fix various leaks in tests
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal minor
: 1.9.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-05-02 13:00 UTC by Guillaume Desmottes
Modified: 2016-05-03 10:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
elementfactory: fix factory leak in test (764 bytes, patch)
2016-05-02 13:01 UTC, Guillaume Desmottes
committed Details | Review
fakesink: fix pipeline leak in test (767 bytes, patch)
2016-05-02 13:01 UTC, Guillaume Desmottes
committed Details | Review
filesrc: fix buffer leaks in tests (993 bytes, patch)
2016-05-02 13:01 UTC, Guillaume Desmottes
committed Details | Review
selector: fix pad leaks in tests (959 bytes, patch)
2016-05-02 13:01 UTC, Guillaume Desmottes
committed Details | Review
streamiddemux: fix list and event leaks in test (1.94 KB, patch)
2016-05-02 13:01 UTC, Guillaume Desmottes
committed Details | Review
pipeline: fix bus leak in seek test (867 bytes, patch)
2016-05-02 13:01 UTC, Guillaume Desmottes
committed Details | Review

Description Guillaume Desmottes 2016-05-02 13:00:39 UTC
I kept feeding unit tests to my experimental leaks detection tool and fixed a bunch of leaks while doing so. :)
Comment 1 Guillaume Desmottes 2016-05-02 13:01:16 UTC
Created attachment 327146 [details] [review]
elementfactory: fix factory leak in test
Comment 2 Guillaume Desmottes 2016-05-02 13:01:22 UTC
Created attachment 327147 [details] [review]
fakesink: fix pipeline leak in test
Comment 3 Guillaume Desmottes 2016-05-02 13:01:27 UTC
Created attachment 327148 [details] [review]
filesrc: fix buffer leaks in tests

gst_check_setup_sink_pad() internally uses gst_check_chain_func() so we
should call gst_check_drop_buffers() when tearing down tests to free the
buffers which have been exchanged through the pipeline.
Comment 4 Guillaume Desmottes 2016-05-02 13:01:32 UTC
Created attachment 327149 [details] [review]
selector: fix pad leaks in tests

setup_input_pad() creates a new pad so we should unref it once we're
done.
Comment 5 Guillaume Desmottes 2016-05-02 13:01:38 UTC
Created attachment 327150 [details] [review]
streamiddemux: fix list and event leaks in test
Comment 6 Guillaume Desmottes 2016-05-02 13:01:43 UTC
Created attachment 327151 [details] [review]
pipeline: fix bus leak in seek test

gst_bus_add_signal_watch_full() keeps a ref on the bus which should
be released using gst_bus_remove_signal_watch().
Comment 7 Sebastian Dröge (slomo) 2016-05-03 07:58:46 UTC
(In reply to Guillaume Desmottes from comment #0)
> I kept feeding unit tests to my experimental leaks detection tool and fixed
> a bunch of leaks while doing so. :)

Where can your tool be found? :)
Comment 8 Sebastian Dröge (slomo) 2016-05-03 08:05:02 UTC
Attachment 327146 [details] pushed as 1e297d7 - elementfactory: fix factory leak in test
Attachment 327147 [details] pushed as 1064bdb - fakesink: fix pipeline leak in test
Attachment 327148 [details] pushed as 7c1a091 - filesrc: fix buffer leaks in tests
Attachment 327149 [details] pushed as d456f8e - selector: fix pad leaks in tests
Attachment 327150 [details] pushed as 0e42f92 - streamiddemux: fix list and event leaks in test
Attachment 327151 [details] pushed as 8af52df - pipeline: fix bus leak in seek test
Comment 9 Guillaume Desmottes 2016-05-03 08:31:27 UTC
(In reply to Sebastian Dröge (slomo) from comment #7)
> (In reply to Guillaume Desmottes from comment #0)
> > I kept feeding unit tests to my experimental leaks detection tool and fixed
> > a bunch of leaks while doing so. :)
> 
> Where can your tool be found? :)

"Coming soon" ;)
Comment 10 Thiago Sousa Santos 2016-05-03 10:34:39 UTC
Any idea why valgrind couldn't catch those?
Comment 11 Tim-Philipp Müller 2016-05-03 10:51:43 UTC
we make it ignore stuff that's still reachable (e.g. in global variables).