GNOME Bugzilla – Bug 739431
Provide a --enable-asan switch in configure.ac
Last modified: 2015-05-18 17:35:06 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.
Created attachment 289702 [details] [review] configure: Allow to build against libasan. libasan is an address sanitizer, compiling with it will give interesting debugging information.
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
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).
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.
For the record, I can confirm that building with this does the job as well: ./configure CFLAGS="-fsanitize=address" LDFLAGS="-lasan"
WONTFIX-ing as per comment #4 then..