Re: [Evolution] [RFH] Using the memory error detector AddressSanitizer (ASan)
- From: Reid Thompson <Reid Thompson ateb com>
- To: "paulepanter users sourceforge net" <paulepanter users sourceforge net>
- Cc: "evolution-list gnome org" <evolution-list gnome org>
- Subject: Re: [Evolution] [RFH] Using the memory error detector AddressSanitizer (ASan)
- Date: Mon, 11 May 2015 12:54:15 +0000
On Mon, 2015-05-11 at 12:43 +0000, Reid Thompson wrote:
On Sat, 2015-05-09 at 16:08 +0200, Paul Menzel wrote:
Am Dienstag, den 05.05.2015, 13:11 +0000 schrieb Reid Thompson:
On Tue, 2015-05-05 at 07:55 +0200, Paul Menzel wrote:
Am Samstag, den 02.05.2015, 11:58 +0000 schrieb Joakim Tjernlund:
You need to set LDFLAGS too
Unfortunately it still fails to build when passing
`LDFLAGS='-fsanitize=address'`.
what is your complete build command and the error output
/bin/sh ../libtool --tag=CC --mode=link gcc ...
Thanks,
Paul
from the brief looking that I did, building as you want requires the
compilation to be done with clang -- correct??? not gcc ???
reid
ok - i see both:
AddressSanitizer is a part of LLVM starting with version 3.1 and a part
of GCC starting with version 4.8
and
In order to use AddressSanitizer you will need to compile and link your program using clang with the
-fsanitize=address switch.
on https://code.google.com/p/address-sanitizer/wiki/AddressSanitizer
i have
gcc version 4.8.4 (Gentoo 4.8.4 p1.4, pie-0.6.1)
and the below works for me.
% cat tests/use-after-free.c
#include <stdlib.h>
int main() {
char *x = (char*)malloc(10 * sizeof(char*));
free(x);
return x[5];
}
gcc -fsanitize=address -O1 -fno-omit-frame-pointer -g tests/use-after-free.c
this also works for me
clang -fsanitize=address -O1 -fno-omit-frame-pointer -g tests/use-after-free.c
reid
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]