[PATCH] D14199: [compiler-rt] [tsan] Unify aarch64 mapping

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 10 11:14:58 PST 2015


eugenis added inline comments.

================
Comment at: lib/tsan/rtl/tsan_platform.h:129
@@ +128,3 @@
+  static const uptr kVdsoBeg       = 0x7f00000000ull;
+};
+
----------------
zatrazz wrote:
> zatrazz wrote:
> > eugenis wrote:
> > > I've noticed that this mapping does not have an application region at 0x55...
> > > That's where PIE executables are mapped by the newer kernels.
> > > Did you test this on an older kernel (I don't know exactly when the transition happened; it was around 4.1 for X86 and AFAIK a bit earlier for AArch 64)?
> > > 
> > > See http://reviews.llvm.org/D15308 for more context.
> > > 
> > I did check the PIE executable with a full TSAN test built with '-pie -fpic' and I saw no issue. Analyzing the trace for 39-bits using the mutexset1.cc (I picked it at random) I see:
> > 
> > * Non-pie build:
> > 
> > 00400000-004d1000 r-xp 00000000 08:02 21008174                           /home/adhemerval.zanella/llvm/llvm-git-aarch64-build-release/mutexset1
> > 004e0000-004e3000 r--p 000d0000 08:02 21008174                           /home/adhemerval.zanella/llvm/llvm-git-aarch64-build-release/mutexset1
> > 004e3000-004e6000 rw-p 000d3000 08:02 21008174                           /home/adhemerval.zanella/llvm/llvm-git-aarch64-build-release/mutexset1
> > 
> > * PIE build:
> > 
> > 7fae119000-7fae1ee000 r-xp 00000000 08:02 21008174                       /home/adhemerval.zanella/llvm/llvm-git-aarch64-build-release/mutexset1
> > 7fae1ee000-7fae1fb000 rw-p 00000000 00:00 0
> > 7fae1fd000-7fae200000 r--p 000d4000 08:02 21008174                       /home/adhemerval.zanella/llvm/llvm-git-aarch64-build-release/mutexset1
> > 7fae200000-7fae203000 rw-p 000d7000 08:02 21008174                       /home/adhemerval.zanella/llvm/llvm-git-aarch64-build-release/mutexset1
> > 
> > So at least for  39-bit PIE addresses are being covered. I will check again on 42-bit VMA.
> I and I checked on a fairly recent kernel, 3.19. I am not aware if the mappings for PIE has changed in recent kernels, neither I checked on recent ones. Do you have more information?
See this bug for the linux 4.1.2 problem with MSan:
https://llvm.org/bugs/show_bug.cgi?id=24155

I see 0x55... mappings with 3.10.40 kernel on Android/AAarch64.

git tag --contains in the torvalds repo tells me that this change appears in v4.1 and newer. Android must have cherry-picked it in 3.10.

What happens if you disable ASLR? We used to get the main executable at 0x55... under gdb (i.e. with disabled randomization) long before 3.9.



http://reviews.llvm.org/D14199





More information about the llvm-commits mailing list