T2080 : How to use address sanitizer

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

T2080 : How to use address sanitizer

898 Views
tachyon11
Contributor I

According to GCC version, I think that the address sanitizer can be available.

To detecting memory corruption for the costom board, it seems to be so useful.

But  I've not used it ,yet.

https://en.wikipedia.org/wiki/AddressSanitizer

AddressSanitizer (or ASan) is a programming tool that detects memory corruption bugs such as buffer overflows or accesses to a dangling pointer (use-after-free).

AddressSanitizer is based on compiler instrumentation and directly-mapped shadow memory.

AddressSanitizer is currently implemented in Clang (starting from version 3.1[1]) and GCC (starting from version 4.8[2]). On average, the instrumentation increases processing time by about 73% and memory usage by 340%.[3]

In order to compile T2080 system, I've used the next GCC version

powerpc64-fsl-linux-gcc (GCC) 4.8.1

Copyright (C) 2013 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.  There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Do you know how to use it ?

Is there a kind of manual for it ?

Tags (2)
0 Kudos
1 Reply

686 Views
r8070z
NXP Employee
NXP Employee

The GCC 4.8.1 document

https://gcc.gnu.org/onlinedocs/gcc-4.8.1/gcc.pdf 

provides the sanitize options and refers to the google wiki documents - see Address Sanitizer

https://github.com/google/sanitizers/wiki/AddressSanitizer 

There are also using cases on the web, for example

Compiling with Address Sanitizer (ASAN) with CLANG and with GCC-4.8 · GitHub 

0 Kudos