AddressSanitizer in FreeBSD jenkins builds

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/.

Pau Espin Pedrol pespin at sysmocom.de
Fri Jun 23 12:23:55 UTC 2017


Hi,

Some of you may have noticed that I have been lately fixing compilation 
warnings + enabling -Wall and -Werror on jenkins build for several 
osmocom libraries.

While doing so, I noticed that the following lines trying to enable 
AddressSanitizer support are actually failing when building with the 
FreeBSD jenkins slave, probably due to it using some other shell without 
bash support:
./configure: CFLAGS+= -fsanitize=address -fsanitize=undefined: not found
./configure: CPPFLAGS+= -fsanitize=address -fsanitize=undefined: not found

The source lines are:

CFLAGS+=" -fsanitize=address -fsanitize=undefined"
CPPFLAGS+=" -fsanitize=address -fsanitize=undefined"

After changing them to support sh and submitting the change in gerrit 
[1], AddressSanitizer was enabled in FreeBSD for first time, but I 
started getting lots of link issues with AdressSanitizer (asan) related 
symbols.
I read in several places that there seems to be a known issue with 
FreeBSD 10.3 and clang-3.4.1 (what we are using) regarding use of 
AddressSanitizer [2, 3].

I then tried configuring CC in the jenkins slave to use clang37 instead 
of cc (clang-3.4.1), and then the linking issue seems to be solved, but 
again a new compiler bug related to usage of __builtin_cpu_supports 
shows up, preventing compilation of libosmocore [4].

I think the best solution is to disable explicitly AddressSanitizer in 
contrib/jenkins.sh when running from FreeBSD, so the behaviour is 
actually the same as before, in which it was implicitly not enabled due 
to a syntax error. Once we move to FreeBSD11 and clang-3.8 we can try 
enabling it again.

If nobody comes with a better solution or is against this, I will 
proceed to do so during next hours/days.


[1] https://gerrit.osmocom.org/#/c/3024/2/configure.ac
[2] 
https://stackoverflow.com/questions/30085036/linking-clang-address-sanitizer-on-freebsd-10-1-release
[3] 
https://webcache.googleusercontent.com/search?q=cache:CZmrK35zigEJ:ea5faa5po25cf7fb.onion.nu/projects/tor/ticket/19821+&cd=1&hl=ca&ct=clnk&gl=de&client=firefox-b
[4] https://bugs.llvm.org//show_bug.cgi?id=25510

-- 
- Pau Espin Pedrol <pespin at sysmocom.de>         http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschaeftsfuehrer / Managing Director: Harald Welte



More information about the OpenBSC mailing list