Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Jan 2015 21:28:08 +0100
From:      Dimitry Andric <dim@FreeBSD.org>
To:        FreeBSD Current <freebsd-current@freebsd.org>
Cc:        FreeBSD Toolchain <freebsd-toolchain@freebsd.org>
Subject:   Connected sanitizer libraries to the build (for x86)
Message-ID:  <FCF2A752-8B03-45BD-B548-A28FCBB27C7B@FreeBSD.org>

next in thread | raw e-mail | index | archive | help

--Apple-Mail=_CCB9499A-2601-452E-962D-513777E93502
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

Hi,

In r277146, I have connected the sanitizer libraries from compiler-rt to
the build.  Currently, this works for i386 and amd64, and contains
Address Sanitizer (ASan) and Undefined Behavior Sanitizer.

AddressSanitizer is a fast memory error detector [1].  It consists of a
compiler instrumentation module and a run-time library. The tool can
detect the following types of bugs:

* Out-of-bounds accesses to heap, stack and globals
* Use-after-free
* Use-after-return (to some extent)
* Double-free, invalid free
* Memory leaks (experimental)

The typical slowdown introduced by AddressSanitizer is 2x.  Enable it by
compiling and linking with clang, and using the -fsanitize=3Daddress =
flag.

Undefined Behavior Sanitizer is a fast and compatible undefined behavior
checker, which enables a number of checks that have small runtime cost
and no impact on address space layout or ABI.  Enable it by using the
-fsanitize=3Dundefined flag. [2]

Please note that the sanitizers still have some rough edges on FreeBSD,
particularly on i386.  These will hopefully be smoothed out in the
coming time.  Reports of problems (and fixes :) are very welcome, but
please log them in Bugzilla, so they can be tracked.

-Dimitry

[1] =
http://llvm.org/releases/3.5.0/tools/clang/docs/AddressSanitizer.html
[2] =
http://llvm.org/releases/3.5.0/tools/clang/docs/UsersManual.html#opt-fsani=
tize-undefined


--Apple-Mail=_CCB9499A-2601-452E-962D-513777E93502
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.26

iEYEARECAAYFAlS1f94ACgkQsF6jCi4glqMhiQCg4mJcgwA97S2p+3a0oKHLyKM+
SdwAnR0ch0q1rrBja9TAzWOS8h78Mzcn
=39z4
-----END PGP SIGNATURE-----

--Apple-Mail=_CCB9499A-2601-452E-962D-513777E93502--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?FCF2A752-8B03-45BD-B548-A28FCBB27C7B>