libsanitizer merge from upstream r175042

Konstantin Serebryany konstantin.s.serebryany@gmail.com
Wed Feb 13 10:28:00 GMT 2013


On Wed, Feb 13, 2013 at 1:51 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Wed, Feb 13, 2013 at 01:19:47PM +0400, Konstantin Serebryany wrote:
>> The attached patch is the libsanitizer merge from upstream r175042.
>>
>> Lots of changes. Among other things:
>>  - x86_64 linux: change the shadow offset to 0x7fff8000 (~5% speedup)
>>  - the new asan allocator is enabled on Mac (was enabled on Linux before).
>>  - tsan finds races between atomic and plain accesses
>>  - better scanf interceptor, enabled by default
>>  - don't include linux/futex.h (fixes PR56128)
>>  - simple tests seem to work (again?) on PowerPC64 with 44-bit address
>> space (46 AS not tested)
>>
>> Patch for libsanitizer is automatically generated by libsanitizer/merge.sh
>> Tested with
>> rm -rf */{*/,}libsanitizer \
>>   && make -j 50 \
>>   && make -C gcc check-g{cc,++}
>> RUNTESTFLAGS='--target_board=unix\{-m32,-m64\} asan.exp'
>>
>> Our internal LLVM bots (Linux, Mac and Android) are green.
>>
>> Ok to commit?
>
> --- libsanitizer/asan/asan_mapping.h    (revision 195997)
> +++ libsanitizer/asan/asan_mapping.h    (working copy)
> @@ -34,27 +34,16 @@
>  #   if defined(__powerpc64__)
>  #    define SHADOW_OFFSET (1ULL << 41)
>  #   else
> -#    define SHADOW_OFFSET (1ULL << 44)
> +#    define SHADOW_OFFSET 0x7fff8000ULL
>  #   endif
>  #  endif
>  # endif
>  #endif  // ASAN_FLEXIBLE_MAPPING_AND_OFFSET
>
> This is inconsistent with the i386.c change.  You said the 0x7fff8000ULL
> shadow offset doesn't work on Darwin, so either the above should be
>
> +#    if ASAN_MAC
> +#     define SHADOW_OFFSET (1ULL << 44)
> +#    else
> +#     define SHADOW_OFFSET 0x7fff8000ULL
> +#    endif

Right. In LLVM we test only with ASAN_FLEXIBLE_MAPPING_AND_OFFSET==1,
so this came unnoticed.
Fixed in r175049.

>
> or i386.c should use 0x7fff8000 even for TARGET_MACHO && TARGET_LP64.
>
> --- gcc/config/i386/i386.c      (revision 195997)
> +++ gcc/config/i386/i386.c      (working copy)
> @@ -5436,7 +5436,9 @@
>  static unsigned HOST_WIDE_INT
>  ix86_asan_shadow_offset (void)
>  {
> -  return (unsigned HOST_WIDE_INT) 1 << (TARGET_LP64 ? 44 : 29);
> +  return TARGET_LP64 ? (TARGET_MACHO ? (HOST_WIDE_INT_1 << 44)
> +                     : HOST_WIDE_INT_C (0x7fff8000))
> +             : (HOST_WIDE_INT_1 << 29);
>
> Please use tabs instead of 8 spaces, and indent it properly (second line
> : below the second ?, third line : below first ?).
>
> +2013-02-13  Kostya Serebryany  <kcc@google.com>
> +
> +       * config/i386/i386.c: use 0x7fff8000 as asan_shadow_offset on x86_64
> +       linux.
>
> Start sentence, so "Use" instead of "use".

done

>
> +       * sanitizer.def: rename __asan_init to __asan_init_v1.
>
> Likewise, "Rename".

done

>
> +       * testsuite/c-c++-common/asan/strncpy-overflow-1.c: update the test
> +       to match the fresh asan run-time.
>
> "Update".  Also, these two go into gcc/testsuite/ChangeLog, without
> testsuite/ prefix in the pathnames.

done.

--kcc
>
> +       * testsuite/c-c++-common/asan/rlimit-mmap-test-1.c: Ditto.
> +
>
>         Jakub
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libsanitizer-r175049.patch
Type: application/octet-stream
Size: 219723 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20130213/e184e1bd/attachment.obj>


More information about the Gcc-patches mailing list