[compiler-rt] r323013 - [TSan][MIPS] Expand sanitizer memory space to lower addresses

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 30 07:13:44 PST 2018


Merged to 6.0 in r323013

On Sat, Jan 20, 2018 at 1:06 AM, Petar Jovanovic via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: petarj
> Date: Fri Jan 19 16:06:07 2018
> New Revision: 323013
>
> URL: http://llvm.org/viewvc/llvm-project?rev=323013&view=rev
> Log:
> [TSan][MIPS] Expand sanitizer memory space to lower addresses
>
> MemToShadowImpl() maps lower addresses to a memory space out of sanitizers
> range. The simplest example is address 0 which is mapped to 0x2000000000
>
> static const uptr kShadowBeg     = 0x2400000000ull;
>
> but accessing the address during tsan execution will lead to a segmentation
> fault.
>
> This patch expands the range used by the sanitizer and ensures that 1/8 of
> the maximum valid address in the virtual address spaces is used for shadow
> memory.
>
> Patch by Milos Stojanovic.
>
> Differential Revision: https://reviews.llvm.org/D41777
>
> Modified:
>     compiler-rt/trunk/lib/tsan/rtl/tsan_platform.h
>
> Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_platform.h
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/
> tsan/rtl/tsan_platform.h?rev=323013&r1=323012&r2=323013&view=diff
> ============================================================
> ==================
> --- compiler-rt/trunk/lib/tsan/rtl/tsan_platform.h (original)
> +++ compiler-rt/trunk/lib/tsan/rtl/tsan_platform.h Fri Jan 19 16:06:07
> 2018
> @@ -79,25 +79,27 @@ struct Mapping {
>  #define TSAN_MID_APP_RANGE 1
>  #elif defined(__mips64)
>  /*
> -C/C++ on linux/mips64
> -0100 0000 00 - 0200 0000 00: main binary
> -0200 0000 00 - 1400 0000 00: -
> -1400 0000 00 - 2400 0000 00: shadow
> -2400 0000 00 - 3000 0000 00: -
> -3000 0000 00 - 4000 0000 00: metainfo (memory blocks and sync objects)
> -4000 0000 00 - 6000 0000 00: -
> -6000 0000 00 - 6200 0000 00: traces
> -6200 0000 00 - fe00 0000 00: -
> -fe00 0000 00 - ff00 0000 00: heap
> -ff00 0000 00 - ff80 0000 00: -
> -ff80 0000 00 - ffff ffff ff: modules and main thread stack
> +C/C++ on linux/mips64 (40-bit VMA)
> +0000 0000 00 - 0100 0000 00: -
>  (4 GB)
> +0100 0000 00 - 0200 0000 00: main binary
>  (4 GB)
> +0200 0000 00 - 2000 0000 00: -
>  (120 GB)
> +2000 0000 00 - 4000 0000 00: shadow
> (128 GB)
> +4000 0000 00 - 5000 0000 00: metainfo (memory blocks and sync objects)
> (64 GB)
> +5000 0000 00 - aa00 0000 00: -
>  (360 GB)
> +aa00 0000 00 - ab00 0000 00: main binary (PIE)
>  (4 GB)
> +ab00 0000 00 - b000 0000 00: -
> (20 GB)
> +b000 0000 00 - b200 0000 00: traces
> (8 GB)
> +b200 0000 00 - fe00 0000 00: -
>  (304 GB)
> +fe00 0000 00 - ff00 0000 00: heap
> (4 GB)
> +ff00 0000 00 - ff80 0000 00: -
>  (2 GB)
> +ff80 0000 00 - ffff ffff ff: modules and main thread stack
> (<2 GB)
>  */
>  struct Mapping {
>    static const uptr kMetaShadowBeg = 0x4000000000ull;
>    static const uptr kMetaShadowEnd = 0x5000000000ull;
>    static const uptr kTraceMemBeg   = 0xb000000000ull;
>    static const uptr kTraceMemEnd   = 0xb200000000ull;
> -  static const uptr kShadowBeg     = 0x2400000000ull;
> +  static const uptr kShadowBeg     = 0x2000000000ull;
>    static const uptr kShadowEnd     = 0x4000000000ull;
>    static const uptr kHeapMemBeg    = 0xfe00000000ull;
>    static const uptr kHeapMemEnd    = 0xff00000000ull;
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180130/1a10f61f/attachment.html>


More information about the llvm-commits mailing list