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 756069 - Gstreamer: Fix sample memory leaks
Gstreamer: Fix sample memory leaks
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 1.6.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-10-05 02:12 UTC by Vineeth
Modified: 2015-10-07 18:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix sample memory leak (1.68 KB, patch)
2015-10-05 02:14 UTC, Vineeth
committed Details | Review

Description Vineeth 2015-10-05 02:12:41 UTC
When sample is got using gst_tag_list_get_sample_index, the memory should be free'd, else it will be leaked.

Adding patches for gst-launch.c and gsttag.c
Comment 1 Vineeth 2015-10-05 02:14:35 UTC
Created attachment 312656 [details] [review]
fix sample memory leak
Comment 2 Sebastian Dröge (slomo) 2015-10-05 11:09:03 UTC
commit 456ef2aa1d912a8af5283907d2ffb8ca51481c2a
Author: Vineeth TM <vineeth.tm@samsung.com>
Date:   Mon Oct 5 11:12:47 2015 +0900

    tests/gst-launch: Fix sample memory leak
    
    When sample is got using gst_tag_list_get_sample_index, it should
    be free'd.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756069
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2015-10-05 19:17:50 UTC
make gst/gsttag.check
Running suite(s): GstTag


Unexpected critical/warning: gst_mini_object_unref: assertion 'mini_object->refcount > 0' failed
92%: Checks: 14, Failures: 1, Errors: 0
gstcheck.c:79:F:general:test_buffer_tags:0: Unexpected critical/warning: gst_mini_object_unref: assertion 'mini_object->refcount > 0' failed
Running suite(s): GstTag


Unexpected critical/warning: gst_mini_object_unref: assertion 'mini_object->refcount > 0' failed
92%: Checks: 14, Failures: 1, Errors: 0
gstcheck.c:79:F:general:test_buffer_tags:0: Unexpected critical/warning: gst_mini_object_unref: assertion 'mini_object->refcount > 0' failed
make: *** [gst/gsttag.check] Error 1
Comment 4 Stefan Sauer (gstreamer, gtkdoc dev) 2015-10-05 19:29:12 UTC
If we get a sample the test will fail. If we don't get a sample, we free the previous sample over and over again.

A much better fix is splitting the test. Having a single test doing lots of assert is just bad practise anyway (recommended reading: http://artofunittesting.com/)
Comment 5 Stefan Sauer (gstreamer, gtkdoc dev) 2015-10-05 19:31:30 UTC
commit 5b3cbbc4941f4705ccccf6b8139b95935cfc47a2
Author: Stefan Sauer <ensonic@users.sf.net>
Date:   Mon Oct 5 21:29:49 2015 +0200

    tests: fix the tag test
    
    The previous change (see bgo #756069) was causing us to free the same pointer
    multiple times. If we actually get a sample back, the test fails, no need to
    free anything in that case.
Comment 6 Vineeth 2015-10-05 20:26:25 UTC
Overlooked that.. thanks Stefan :)