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 746465 - validate: add valgrind support
validate: add valgrind support
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-devtools
unspecified
Other Linux
: Normal enhancement
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-03-19 15:02 UTC by Guillaume Desmottes
Modified: 2015-03-20 09:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
launcher: add valgrind support (2.83 KB, patch)
2015-03-19 15:08 UTC, Guillaume Desmottes
none Details | Review
launcher: add valgrind support (3.18 KB, patch)
2015-03-19 15:56 UTC, Guillaume Desmottes
none Details | Review
launcher: add valgrind support (3.42 KB, patch)
2015-03-19 16:24 UTC, Guillaume Desmottes
none Details | Review
launcher: try using gst.supp as valgrind suppressions file (1.67 KB, patch)
2015-03-19 16:24 UTC, Guillaume Desmottes
none Details | Review
launcher: add valgrind support (3.42 KB, patch)
2015-03-19 17:15 UTC, Guillaume Desmottes
none Details | Review
validate: install gst.supp (760 bytes, patch)
2015-03-19 17:15 UTC, Guillaume Desmottes
none Details | Review
launcher: try using gst.supp as valgrind suppressions file (2.77 KB, patch)
2015-03-19 17:15 UTC, Guillaume Desmottes
none Details | Review
validate: move scenarios to validate/scenarios/ (5.53 KB, patch)
2015-03-20 09:10 UTC, Guillaume Desmottes
committed Details | Review
launcher: add valgrind support (3.42 KB, patch)
2015-03-20 09:10 UTC, Guillaume Desmottes
committed Details | Review
validate: install gst.supp (749 bytes, patch)
2015-03-20 09:10 UTC, Guillaume Desmottes
committed Details | Review
launcher: try using gst.supp as valgrind suppressions file (2.19 KB, patch)
2015-03-20 09:10 UTC, Guillaume Desmottes
committed Details | Review

Description Guillaume Desmottes 2015-03-19 15:02:22 UTC
Adding a --valgrind option to gst-validate-launcher to track memory corruption and leaks.

That's also the first step for automatically checking for leak regressions once we'll have a proper suppression file.
Comment 1 Guillaume Desmottes 2015-03-19 15:08:28 UTC
Created attachment 299837 [details] [review]
launcher: add valgrind support

Add a --valgrind option to gst-validate-launcher to run the tests inside
Valgrind and tune GLib's memory allocator accordingly.

Fix
Comment 2 Thibault Saunier 2015-03-19 15:47:55 UTC
Review of attachment 299837 [details] [review]:

Looks good but I wonder if you should not make the timeout and hard timeout longer in that case (probably * 5 or something) ?

Would be nice if we could make test fails if we detect definitely lost memory (probably redirecting valgrind logs to a specific file and parse it). That could be added later.
Comment 3 Guillaume Desmottes 2015-03-19 15:56:40 UTC
Created attachment 299847 [details] [review]
launcher: add valgrind support

Add a --valgrind option to gst-validate-launcher to run the tests inside
Valgrind and tune GLib's memory allocator accordingly.

Fix bgo#746465
Comment 4 Guillaume Desmottes 2015-03-19 16:24:01 UTC
Created attachment 299850 [details] [review]
launcher: add valgrind support

Add a --valgrind option to gst-validate-launcher to run the tests inside
Valgrind and tune GLib's memory allocator accordingly.

Fix
Comment 5 Guillaume Desmottes 2015-03-19 16:24:08 UTC
Created attachment 299851 [details] [review]
launcher: try using gst.supp as valgrind suppressions file
Comment 6 Thibault Saunier 2015-03-19 16:29:27 UTC
Review of attachment 299851 [details] [review]:

::: validate/launcher/baseclasses.py
@@ +565,3 @@
+    def get_valgrind_suppressions(self):
+        # Are we running from sources?
+        p = os.path.join('common', 'gst.supp')

You should base yourself on __file__ rather than $PWD

@@ +569,3 @@
+            return p
+
+        # TODO: do we want to install gst.supp and try using it from $prefix?

We could install it into share/gstreamer-1.0/ or something like that maybe?
Comment 7 Guillaume Desmottes 2015-03-19 17:15:44 UTC
Created attachment 299854 [details] [review]
launcher: add valgrind support

Add a --valgrind option to gst-validate-launcher to run the tests inside
Valgrind and tune GLib's memory allocator accordingly.

Fix
Comment 8 Guillaume Desmottes 2015-03-19 17:15:50 UTC
Created attachment 299855 [details] [review]
validate: install gst.supp

Will be used when running tests inside Valgrind.
Comment 9 Guillaume Desmottes 2015-03-19 17:15:56 UTC
Created attachment 299856 [details] [review]
launcher: try using gst.supp as valgrind suppressions file
Comment 10 Thibault Saunier 2015-03-20 08:18:45 UTC
Review of attachment 299856 [details] [review]:

::: validate/launcher/Makefile.am
@@ +17,3 @@
+config.py: Makefile
+	$(AM_V_GEN) { \
+		echo "DATADIR = '${datadir}/gstreamer-$(GST_API_VERSION)/validate-suppression'"; \

What is that for? (I can not see it used anywhere)

::: validate/launcher/baseclasses.py
@@ +573,3 @@
+        # Look in system data dirs
+        for datadir in GLib.get_system_data_dirs():
+        if os.path.exists(p):

We should use gstreamer-1.0/validate/gst.sup and gstreamer1.0/validate/scenarios/ I think... no big deal I guess.
Comment 11 Guillaume Desmottes 2015-03-20 08:44:59 UTC
(In reply to Thibault Saunier from comment #10)
> Review of attachment 299856 [details] [review] [review]:
> 
> ::: validate/launcher/Makefile.am
> @@ +17,3 @@
> +config.py: Makefile
> +	$(AM_V_GEN) { \
> +		echo "DATADIR =
> '${datadir}/gstreamer-$(GST_API_VERSION)/validate-suppression'"; \
> 
> What is that for? (I can not see it used anywhere)

Oh sorry this wasn't meant to be commited.

> ::: validate/launcher/baseclasses.py
> @@ +573,3 @@
> +        # Look in system data dirs
> +        for datadir in GLib.get_system_data_dirs():
> +        if os.path.exists(p):
> 
> We should use gstreamer-1.0/validate/gst.sup and
> gstreamer1.0/validate/scenarios/ I think... no big deal I guess.

I can move those yeah.
Comment 12 Guillaume Desmottes 2015-03-20 09:10:23 UTC
Created attachment 299925 [details] [review]
validate: move scenarios to validate/scenarios/
Comment 13 Guillaume Desmottes 2015-03-20 09:10:30 UTC
Created attachment 299926 [details] [review]
launcher: add valgrind support

Add a --valgrind option to gst-validate-launcher to run the tests inside
Valgrind and tune GLib's memory allocator accordingly.

Fix
Comment 14 Guillaume Desmottes 2015-03-20 09:10:39 UTC
Created attachment 299927 [details] [review]
validate: install gst.supp

Will be used when running tests inside Valgrind.
Comment 15 Guillaume Desmottes 2015-03-20 09:10:47 UTC
Created attachment 299928 [details] [review]
launcher: try using gst.supp as valgrind suppressions file
Comment 16 Thibault Saunier 2015-03-20 09:22:42 UTC
Review of attachment 299925 [details] [review]:

Looks good, I am just wondering if it will break backward compatibility but I think it won't actually as scenarios are bundled with -validate itself.
Comment 17 Thibault Saunier 2015-03-20 09:23:33 UTC
Review of attachment 299926 [details] [review]:

Looks good
Comment 18 Thibault Saunier 2015-03-20 09:23:54 UTC
Review of attachment 299927 [details] [review]:

Looks good.
Comment 19 Thibault Saunier 2015-03-20 09:24:59 UTC
Review of attachment 299928 [details] [review]:

Looks good.
Comment 20 Thibault Saunier 2015-03-20 09:39:43 UTC
commit cb8348c7b18485761d7022c2200c82bf001b4e5f
Author: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Date:   Thu Mar 19 17:22:26 2015 +0100

    launcher: try using gst.supp as valgrind suppressions file
    
    https://bugzilla.gnome.org/show_bug.cgi?id=746465

commit 3024b3682fb2ddd074431103295e6f534b7d2ebf
Author: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Date:   Thu Mar 19 17:44:19 2015 +0100

    validate: install gst.supp
    
    Will be used when running tests inside Valgrind.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=746465

commit 271f9f3c8edeedb21fa5d1288b11e98b6d44d572
Author: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Date:   Thu Mar 19 16:06:54 2015 +0100

    launcher: add valgrind support
    
    Add a --valgrind option to gst-validate-launcher to run the tests inside
    Valgrind and tune GLib's memory allocator accordingly.
    
    Fix https://bugzilla.gnome.org/show_bug.cgi?id=746465

commit 2778e501c4c05bb69227340bbc43e7995c8082b2
Author: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Date:   Fri Mar 20 10:06:35 2015 +0100

    validate: move scenarios to validate/scenarios/
    
    https://bugzilla.gnome.org/show_bug.cgi?id=746465