[PATCH] D16689: [tsan] Dynamically detect heap range for aarch64.

Yabin Cui via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 22 16:30:41 PST 2016

yabinc added a comment.

Sorry for not updating this so long, I was struggling with other stuff.
I don't understand "these sources are outdated, the AArch64 part is not like that any more for a good number of months." When I downloaded the latest linux kernel, the code of arch/arm64/mm/mmap.c is not changed:

unsigned long arch_mmap_rnd(void)
	unsigned long rnd;

	if (test_thread_flag(TIF_32BIT))

  		rnd = (unsigned long)get_random_int() & ((1 << mmap_rnd_compat_bits) - 1);


  		rnd = (unsigned long)get_random_int() & ((1 <<** mmap_rnd_bits**) - 1);

return rnd << PAGE_SHIFT;

And I think at least we should support it on android. The division and multiplication are in current code like MemToShadowImpl as well, and they should be compiled into shift instructions.

Comment at: lib/tsan/rtl/tsan_platform.h:609
@@ +608,3 @@
+  DCHECK(IsAppMem(x));
+  if (x >= Mapping::kHeapMemBeg &&
kcc wrote:
> Here and below, can we use if (SANITIZER_GO) instead of #ifdef? 
I use #if !defined(SANITIZER_GO) instead of #if !(SANITIZER_GO), because other places make compilation decision based on whether SANITIZER_GO is defined.


More information about the llvm-commits mailing list