[PATCH] D14199: [compiler-rt] [tsan] Unify aarch64 mapping
Adhemerval Zanella via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 11 03:33:17 PST 2015
zatrazz added inline comments.
================
Comment at: lib/tsan/rtl/tsan_platform.h:129
@@ +128,3 @@
+ static const uptr kVdsoBeg = 0x7f00000000ull;
+};
+
----------------
eugenis wrote:
> 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.
>
My previous analysis was in fact wrong, even for the kernels I am currently using (3.19 for 39-bit and 3.17 for 42-bit I am seeing):
- 0x00000000000-0x00010000000: 39/42-bits program own segments
- 0x05500000000-0x05600000000: 39-bits PIE program segments
- 0x07f80000000-0x07fffffffff: 39-bits libraries segments
- 0x2aa00000000-0x2ab00000000: 42-bits PIE program segments
- 0x3ff00000000-0x3ffffffffff: 42-bits libraries segments
Fortunately I could adjust aarch64 mapping to include these segments using the current mapping. I am preparing a patch.
http://reviews.llvm.org/D14199
More information about the llvm-commits
mailing list