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 777440 - Ignore leaks in gst_check_init
Ignore leaks in gst_check_init
Status: RESOLVED NOTABUG
Product: GStreamer
Classification: Platform
Component: common
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-01-18 11:04 UTC by Patricia Muscalu
Modified: 2017-01-30 14:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ignore leaks in gst_check_init (804 bytes, patch)
2017-01-18 11:05 UTC, Patricia Muscalu
none Details | Review
ignore leaks in gst_check_init (777 bytes, patch)
2017-01-18 12:32 UTC, Patricia Muscalu
none Details | Review

Description Patricia Muscalu 2017-01-18 11:04:28 UTC
Make valgrind ignore leaks in gst_check_init.
Comment 1 Patricia Muscalu 2017-01-18 11:05:05 UTC
Created attachment 343703 [details] [review]
ignore leaks in gst_check_init
Comment 2 Sebastian Dröge (slomo) 2017-01-18 11:17:28 UTC
Review of attachment 343703 [details] [review]:

::: gst.supp
@@ +4044,3 @@
+   fun:g_object_new
+   fun:*
+   fun:*

You can put "..." here instead of multiple lines of *

@@ +4049,3 @@
+   fun:gst_init
+   fun:gst_check_init
+   fun:main

main() seems not needed here, also why is this not covered by another leak suppression that is probably there for gst_init / gst_init_check already?
Comment 3 Patricia Muscalu 2017-01-18 11:27:27 UTC
main() is present in other places. Thanks for your comments I'll try to improve my patch.
Comment 4 Patricia Muscalu 2017-01-18 12:32:26 UTC
Created attachment 343713 [details] [review]
ignore leaks in gst_check_init
Comment 5 Patricia Muscalu 2017-01-18 12:36:14 UTC
The other suppression cases for gst_init_check ignore other kind of leaks. The "common factor" for all of them is a call stack containing:

   fun:g_option_context_parse
   fun:gst_init_check
   fun:gst_init
   fun:gst_check_init
Comment 6 Nicolas Dufresne (ndufresne) 2017-01-18 14:14:13 UTC
Review of attachment 343713 [details] [review]:

Didn't we implement gst_deinit() for that one ?
Comment 7 Patricia Muscalu 2017-01-19 08:14:44 UTC
Which commit exactly? We see the leak with 1.10.2.
Comment 8 Sebastian Dröge (slomo) 2017-01-19 10:44:30 UTC
What exactly is leaked here that is not destroyed in gst_deinit()?
Comment 9 Patricia Muscalu 2017-01-19 12:40:23 UTC
valgrind output:

==4676== 217 (184 direct, 33 indirect) bytes in 1 blocks are definitely lost in loss record 1,756 of 1,823
==4676==    at 0x62875CC: g_type_create_instance (in /tmp/sysroots/x86_64-linux/usr/lib/libgobject-2.0.so.0.4600.2)
==4676==    by 0x6269D9A: ??? (in /tmp/sysroots/x86_64-linux/usr/lib/libgobject-2.0.so.0.4600.2)
==4676==    by 0x626B590: g_object_newv (in /tmp/sysroots/x86_64-linux/usr/lib/libgobject-2.0.so.0.4600.2)
==4676==    by 0x626BE7B: g_object_new (in /tmp/sysroots/x86_64-linux/usr/lib/libgobject-2.0.so.0.4600.2)
==4676==    by 0x5B4E76F: ??? (in /tmp/sysroots/x86_64-linux/usr/lib/libgstreamer-1.0.so.0.1002.0)
==4676==    by 0x5B49B48: ??? (in /tmp/sysroots/x86_64-linux/usr/lib/libgstreamer-1.0.so.0.1002.0)
==4676==    by 0x67025F7: g_option_context_parse (in /tmp/sysroots/x86_64-linux/usr/lib/libglib-2.0.so.0.4600.2)
==4676==    by 0x5B4AA1E: gst_init_check (in /tmp/sysroots/x86_64-linux/usr/lib/libgstreamer-1.0.so.0.1002.0)
==4676==    by 0x5B4AA66: gst_init (in /tmp/sysroots/x86_64-linux/usr/lib/libgstreamer-1.0.so.0.1002.0)
==4676==    by 0x59079F2: gst_check_init (in /home/patricia/products/cvp-unittests/builds/p5515/tmp/sysroots/x86_64-linux/usr/lib/libgstcheck-1.0.so.0.1002.0)
==4676==    by 0x404CFB: main (testsrc.c:624)
Comment 10 Sebastian Dröge (slomo) 2017-01-19 13:02:21 UTC
Can you get another one with debug symbols for GStreamer and GLib/GObject?
Comment 11 Patricia Muscalu 2017-01-19 14:49:30 UTC
==6465== 217 (184 direct, 33 indirect) bytes in 1 blocks are definitely lost in loss record 1,763 of 1,829
| ==6465==    at 0x62875DC: g_type_create_instance (in /tmp/sysroots/x86_64-linux/usr/lib/libgobject-2.0.so.0.4600.2)
| ==6465==    by 0x6269DAA: g_object_new_internal (in /tmp/sysroots/x86_64-linux/usr/lib/libgobject-2.0.so.0.4600.2)
| ==6465==    by 0x626B5A0: g_object_newv (in /tmp/sysroots/x86_64-linux/usr/lib/libgobject-2.0.so.0.4600.2)
| ==6465==    by 0x626BE8B: g_object_new (in /tmp/sysroots/x86_64-linux/usr/lib/libgobject-2.0.so.0.4600.2)
| ==6465==    by 0x5B4E77F: _priv_gst_allocator_initialize (gstallocator.c:594)
| ==6465==    by 0x5B49B58: init_post (gst.c:576)
| ==6465==    by 0x67025F7: g_option_context_parse (in /tmp/sysroots/x86_64-linux/usr/lib/libglib-2.0.so.0.4600.2)
| ==6465==    by 0x5B4AA2E: gst_init_check (gst.c:353)
| ==6465==    by 0x5B4AA76: gst_init (gst.c:399)
| ==6465==    by 0x59079F2: gst_check_init (gstcheck.c:127)
| ==6465==    by 0x404D0B: main (testsrc.c:624)
| ==6465==
Comment 12 Patricia Muscalu 2017-01-23 13:41:00 UTC
Is the provided information enough?
Comment 13 Sebastian Dröge (slomo) 2017-01-23 14:10:29 UTC
This is unreffed again in _priv_gst_allocator_cleanup() by gst_deinit(). So something is actually leaking this (or gst_deinit() is not called), and it's not something for a suppression.
Comment 14 Patricia Muscalu 2017-01-30 13:52:00 UTC
Yes. There is actually an allocator leak in our test code and this leak is visible thanks to the commit 1ea831bd (in gstreamer):

commit 1ea831bd6cedbba89e5e78af58976238c89e5b75
Author: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Date:   Mon Apr 18 13:05:40 2016 +0300

    allocator: add cleanup method
    
    Make tracking memory leaks easier.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=765212


We do not see this leak in GStreamer 1.8.3 because the call to _priv_gst_allocator_cleanup() is missing.

Thank you for your help!