This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, ARM] Enable libsanitizer
- From: Konstantin Serebryany <konstantin dot s dot serebryany at gmail dot com>
- To: Christophe Lyon <christophe dot lyon at linaro dot org>, Evgeniy Stepanov <eugenis at google dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Patch Tracking <patches at linaro dot org>
- Date: Thu, 28 Mar 2013 11:36:55 +0400
- Subject: Re: [Patch, ARM] Enable libsanitizer
- References: <CAKdteObkDtD99dihWAwZiAszRW2Qxpr=mA+bkc79Wp8V2Kmgyg at mail dot gmail dot com>
+eugenis@google.com
Hi Christophe,
On Thu, Mar 28, 2013 at 2:09 AM, Christophe Lyon
<christophe.lyon@linaro.org> wrote:
> Hi,
> This small patch enables libsanitizer on ARM.
> It has been tested successfully on cortex-a9 hardware (via the GCC testsuite).
>
> I have chosen to bundle -funwind-table with -fsanitize=* so that a
> useful backtrace can be printed to the user in case of error,
> otherwise the reporting is limited to one line belonging to
> libsanitizer.so.
>
> Note that the testsuite currently fails when executing under qemu:
> - support of /proc/self/maps does not conform to the kernel format.
> One extra space is missing from some lines, which confuses libsanitizer.
> Patch proposed to upstream qemu:
> http://lists.gnu.org/archive/html/qemu-devel/2013-02/msg03051.html
As we discussed in
https://code.google.com/p/address-sanitizer/issues/detail?id=160
this may be fixed in libsanitizer, although i'd still prefer the qemu fix.
>
> - qemu reserves some memory space by default, conflicting with
> libsanitizer needs.
> Workaround: invoke qemu with -R 0
Good to know!
>
> - libsanitizer detects if its output is a tty, and when GCC testsuite
> is executed under qemu, libsanitizer concludes that it is actually
> running under a tty, and adds beautyfying characters which confuse
> dejanu.
Is this again a quemu problem?
Or should we do some more checks before emitting color codes?
A comment about this patch and a question to Evgeniy:
on Android/ARM we use zero shadow offset.
(code.google.com/p/address-sanitizer/wiki/ZeroBasedShadow)
Can we do it on other ARM targets too?
--kcc
>
>
> OK?
>
> Christophe.
>
> 2013-03-27 Christophe Lyon <christophe.lyon@linaro.org>
>
> gcc/
> * config/arm/arm.c (arm_asan_shadow_offset): New function.
> (TARGET_ASAN_SHADOW_OFFSET): Define.
> * config/arm/linux-eabi.h (ASAN_CC1_SPEC): Define.
> (LINUX_OR_ANDROID_CC): Add ASAN_CC1_SPEC.
>
> libsanitizer/
> * configure.tgt: Add ARM pattern.