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 794353 - rtponviftimestamp: memory leak on finalize
rtponviftimestamp: memory leak on finalize
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 794290 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2018-03-15 10:58 UTC by Pavel Modilaynen
Modified: 2018-04-06 12:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed fix (860 bytes, patch)
2018-03-15 10:59 UTC, Pavel Modilaynen
none Details | Review

Description Pavel Modilaynen 2018-03-15 10:58:41 UTC
There is missing buffer list destruction in gst_rtp_onvif_timestamp_finalize () which can be noticed with:

diff --git a/gst/onvif/gstrtponviftimestamp.c b/gst/onvif/gstrtponviftimestamp.c
index a957483..674f57d 100644
--- a/gst/onvif/gstrtponviftimestamp.c
+++ b/gst/onvif/gstrtponviftimestamp.c
@@ -222,6 +222,9 @@ gst_rtp_onvif_timestamp_finalize (GObject * object)
   g_queue_free (self->event_queue);
 
   G_OBJECT_CLASS (gst_rtp_onvif_timestamp_parent_class)->finalize (object);
+
+  g_assert (self->buffer == NULL);
+  g_assert (self->list == NULL);
 }

Which leads to:
[ 8355.912930] test[13119]: ERROR:../../../../../../../../gstreamer1.0-plugins-bad/gst/onvif/gstrtponviftimestamp.c:246:gst_rtp_onvif_timestamp_finalize: assertion failed: (self->list == NULL)
Comment 1 Pavel Modilaynen 2018-03-15 10:59:16 UTC
Created attachment 369726 [details] [review]
proposed fix
Comment 2 Tim-Philipp Müller 2018-03-27 15:55:23 UTC
Thanks, the patch looks fine to me and shouldn't hurt, but I wonder in what scenario it would be needed, since it should all really be freed already during the state change when shutting down the element.

Could you check if this fixes your leak as well:

https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/gst/onvif?id=4d76070f4ec97c6aecbc55ec27997c523aa2b922
Comment 3 Pavel Modilaynen 2018-04-06 12:37:08 UTC
@Tim-Philipp Müller  I cannot reproduce this issue and my #794290 with your patch in the same scenario.
I even added sleeps and checked that normally I always have corruptions and leaks and with your patch (+ sleeps) I haven't got a single one. 
Thank you!
Comment 4 Pavel Modilaynen 2018-04-06 12:38:23 UTC
*** Bug 794290 has been marked as a duplicate of this bug. ***