[compiler-rt] r220571 - tsan: support mmap(MAP_32BIT)

Alexey Samsonov vonosmas at gmail.com
Fri Jan 16 07:05:25 PST 2015


On Wed, Jan 14, 2015 at 6:05 PM, Dmitry Vyukov <dvyukov at google.com> wrote:

> Do you mean linux/C++ and 0x020000000000 - 0x100000000000 memory range?
> If so, I don't see what is broken.
> I've added the following debug output:
>
> +  Printf("kShadowBeg=%p kHiAppMemBeg=%p shadow=%p ok=%d\n",
> +      kShadowBeg, kHiAppMemBeg, MemToShadow(kHiAppMemBeg),
> IsShadowMem(MemToShadow(kHiAppMemBeg)));
>

Have you tried to build and run runtime with TSAN_SHADOW_COUNT=2 ?

uptr MemToShadow(uptr x) {
78  DCHECK(IsAppMem(x));
79  return (((x) & ~(kAppMemMsk | (kShadowCell - 1)))
80      ^ kAppMemXor) * kShadowCnt;

const uptr kHiAppMemBeg   = 0x7e8000000000ull;
const uptr kAppMemMsk     = 0x7c0000000000ull;
const uptr kAppMemXor     = 0x020000000000ull;

x = 0x7e8000000000ull
y = (x) & ~(kAppMemMsk | (kShadowCell - 1)) = 0x028000000000ull;
z = y ^ kAppMemXor = 0x008000000000ull;
z * kShadowCnt = z * 2 = 0x010000000000ull;


>
> and it prints:
>
> kShadowBeg=0x020000000000 kHiAppMemBeg=0x7e8000000000
> shadow=0x020000000000 ok=1
>
>
>
> On Mon, Jan 12, 2015 at 9:28 PM, Alexey Samsonov <vonosmas at gmail.com>
> wrote:
> > Take a closer look at tsan_platform.h
> >
> > MemToShadow() doesn't map all the user memory regions into expected
> > 0x0200000000 - 0x1000000000 range.
> > That is, IsShadowMem(MemToShadow(kHiAppMemBeg)) == false.
> >
> > On Mon, Jan 12, 2015 at 7:25 AM, Dmitry Vyukov <dvyukov at google.com>
> wrote:
> >>
> >> What is the problem with TSAN_SHADOW_COUNT != 4? I do not see what has
> >> changed wrt TSAN_SHADOW_COUNT.
> >>
> >> On Tue, Jan 6, 2015 at 5:25 AM, Alexey Samsonov <vonosmas at gmail.com>
> >> wrote:
> >> > After this change TSan can only work with TSAN_SHADOW_COUNT=4.
> >> > Do we plan to keep support for another values, or it's fine to just
> drop
> >> > them?
> >> >
> >> > On Sat, Oct 25, 2014 at 2:25 AM, Dmitry Vyukov <dvyukov at google.com>
> >> > wrote:
> >> >>
> >> >> On Sat, Oct 25, 2014 at 1:17 AM, Kostya Serebryany <kcc at google.com>
> >> >> wrote:
> >> >> > Nice!
> >> >> > Please also update the docs (where relevant).
> >> >> > Do we need to remove -PIE from the driver now?
> >> >>
> >> >> There is no immediate need for any changes.
> >> >> We can remove pie just to match gcc and asan, though. But I am sure
> >> >> that such change will cause a new splash of complains that something
> >> >> broke in some weird setups...
> >> >> _______________________________________________
> >> >> llvm-commits mailing list
> >> >> llvm-commits at cs.uiuc.edu
> >> >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> >> >
> >> >
> >> >
> >> >
> >> > --
> >> > Alexey Samsonov
> >> > vonosmas at gmail.com
> >
> >
> >
> >
> > --
> > Alexey Samsonov
> > vonosmas at gmail.com
>



-- 
Alexey Samsonov
vonosmas at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150116/42797f33/attachment.html>


More information about the llvm-commits mailing list