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 739431 - Provide a --enable-asan switch in configure.ac
Provide a --enable-asan switch in configure.ac
Status: RESOLVED WONTFIX
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other All
: Normal enhancement
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-10-30 22:51 UTC by Mathieu Duponchelle
Modified: 2015-05-18 17:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
configure: Allow to build against libasan. (3.36 KB, patch)
2014-10-30 22:52 UTC, Mathieu Duponchelle
none Details | Review

Description Mathieu Duponchelle 2014-10-30 22:51:31 UTC
When enabled, programs linked against gstreamer-1.0 are validated by libasan. It seems with gcc 4.8 there is no leak detection, which might explain the remarkably low number of asan errors in the test suite (only one issue found in a recent addition to bytereader.check, and the error is in the test afaict).

I expect more issues to be detected when compiling gst-plugins-bad in a similar fashion.

I would love to have feedback from someone that can use gcc 4.9, will discuss on the IRC tomorrow, for now I'll just attach a patch and call it a day.
Comment 1 Mathieu Duponchelle 2014-10-30 22:52:17 UTC
Created attachment 289702 [details] [review]
configure: Allow to build against libasan.

libasan is an address sanitizer, compiling with it will give interesting
debugging information.
Comment 2 Tim-Philipp Müller 2014-10-30 23:06:35 UTC
I think maybe we should also check if the compiler supports -fsanitize-address?

I get the following build failure (debian sid, gcc 4.9.1):
//usr/lib/x86_64-linux-gnu/libasan.so.1: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
//usr/lib/x86_64-linux-gnu/libasan.so.1: warning: the use of `tempnam' is dangerous, better use `mkstemp'
//usr/lib/x86_64-linux-gnu/libasan.so.1: warning: the use of `tmpnam_r' is dangerous, better use `mkstemp'
Command '['/home/tpm/gst/glib-master/gstreamer/gst/tmp-introspectniGdf2/Gst-1.0', '--introspect-dump=/home/tpm/gst/glib-master/gstreamer/gst/tmp-introspectniGdf2/functions.txt,/home/tpm/gst/glib-master/gstreamer/gst/tmp-introspectniGdf2/dump.xml']' returned non-zero exit status -11
Makefile:1958: recipe for target 'Gst-1.0.gir' failed
Comment 3 Tim-Philipp Müller 2014-10-31 10:06:30 UTC
Also, when I compile core with this and then run 'make check' in -base, all of the unit tests just crash on startup (in libasan afaict).
Comment 4 Sebastian Dröge (slomo) 2014-11-01 18:08:33 UTC
Why only the address sanitizer and not all the others that gcc and clang have? :) And in theory this could just be handled by setting CFLAGS and LDFLAGS properly, I did that in the past already for some testing.
Comment 5 Guillaume Desmottes 2015-05-18 17:26:48 UTC
For the record, I can confirm that building with this does the job as well:

./configure CFLAGS="-fsanitize=address" LDFLAGS="-lasan"
Comment 6 Tim-Philipp Müller 2015-05-18 17:35:06 UTC
WONTFIX-ing as per comment #4 then..