[PATCH] Enable address sanitizer for tests.

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Holger Freyther holger at freyther.de
Wed Jan 20 19:15:44 UTC 2016


> On 20 Jan 2016, at 16:57, suraev at alumni.ntnu.no wrote:
> 
> From: Max <msuraev at sysmocom.de>

Hi,


> Some tests are leaky which is ok since it's one-shot programs
> anyway. For them mem. leak sanitizer is explicitly disabled via
> env. variables.

I think it is best to use the OpenBSC mailinglist for libosmocore
and other libraries.

From my point of view it really makes sense to have ASAN build and
run the tests (and include leak check if we can ignore some globals)
but I have a couple of issues with the specific patch:

1.) not all compilers we use support ASAN
2.) Just compiling the test doesn't help us to verify the library
itself. It needs to be instrumented too!

So my proposal would be:

1.) We get a gcc 5.x or clang on one of the linux builders (or I will
create one)
2.) We use your AT_CHECK check so we can pass this variable from the
outside too.
3.) We have a Jenkins nightly job that does make CFLAGS+="-fsanitize.."
CXXFLAGS+=.. check on all dependencies


> +AT_COLOR_TESTS

What does this give us?


> -AT_CHECK([$abs_top_builddir/tests/msgfile/msgfile_test], [0], [expout])
> +AT_CHECK([ASAN_OPTIONS="detect_leaks=0" $abs_top_builddir/tests/msgfile/msgfile_test], [0], [expout])

Did you have a look at osmo-bts and how I sneaked in support for using
qemu to execute the tests?




More information about the OpenBSC mailing list