This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt] Set asan win 64-bits to use dynamic address for memory allocator
ClosedPublic

Authored by etienneb on Sep 14 2016, 11:06 AM.

Details

Summary

ASAN on Windows 64-bits should use a dynamic address instead of a fixed one.
The asan-allocator code to support dynamic address is already landed.
This patch is turning on the feature.

Diff Detail

Event Timeline

etienneb updated this revision to Diff 71399.Sep 14 2016, 11:06 AM
etienneb retitled this revision from to [compiler-rt] Set asan win 64-bits to use dynamic address for memory allocator.
etienneb updated this object.
etienneb added a reviewer: rnk.
etienneb added subscribers: chrisha, llvm-commits.

The code was previously fixed by: https://reviews.llvm.org/D23170

rnk accepted this revision.Sep 14 2016, 11:20 AM
rnk edited edge metadata.

lgtm, just had to verify that the allocator actually handles that.

lib/asan/asan_allocator.h
135

512G, maybe?

This revision is now accepted and ready to land.Sep 14 2016, 11:20 AM
etienneb updated this revision to Diff 71410.Sep 14 2016, 11:58 AM
etienneb edited edge metadata.

fix missing decl

I ran the test on win7, and it's working fine:

D:\src\llvm\ninja64>ninja check-asan
-- Testing: 543 tests, 16 threads --
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
Testing Time: 69.00s
  Expected Passes    : 377
  Expected Failures  : 16
  Unsupported Tests  : 150

But, on win7 I still need that extra patch:

Index: lib/asan/asan_mapping.h
===================================================================
--- lib/asan/asan_mapping.h     (revision 281512)
+++ lib/asan/asan_mapping.h     (working copy)
@@ -140,7 +140,7 @@
 static const u64 kFreeBSD_ShadowOffset32 = 1ULL << 30;  // 0x40000000
 static const u64 kFreeBSD_ShadowOffset64 = 1ULL << 46;  // 0x400000000000
 static const u64 kWindowsShadowOffset32 = 3ULL << 28;  // 0x30000000
-static const u64 kWindowsShadowOffset64 = 1ULL << 45;  // 32TB
+static const u64 kWindowsShadowOffset64 = 1ULL << 41;  // 32TB

 #define SHADOW_SCALE kDefaultShadowScale

Until we landed this:

https://reviews.llvm.org/D24575
https://reviews.llvm.org/D23354

As I get it, no build bots should be broken.
If not, please revert this patch and I'm gonna find the right way to make it happens.

etienneb closed this revision.Sep 14 2016, 12:31 PM