<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 14, 2015 at 6:05 PM, Dmitry Vyukov <span dir="ltr"><<a href="mailto:dvyukov@google.com" target="_blank">dvyukov@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Do you mean linux/C++ and 0x020000000000 - 0x100000000000 memory range?<br>
If so, I don't see what is broken.<br>
I've added the following debug output:<br>
<br>
+  Printf("kShadowBeg=%p kHiAppMemBeg=%p shadow=%p ok=%d\n",<br>
+      kShadowBeg, kHiAppMemBeg, MemToShadow(kHiAppMemBeg),<br>
IsShadowMem(MemToShadow(kHiAppMemBeg)));<br></blockquote><div><br></div><div>Have you tried to build and run runtime with TSAN_SHADOW_COUNT=2 ?</div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"><div>uptr MemToShadow(uptr x) {</div><div>78<span class="" style="white-space:pre">     </span>  DCHECK(IsAppMem(x));</div><div>79<span class="" style="white-space:pre">  </span>  return (((x) & ~(kAppMemMsk | (kShadowCell - 1)))</div><div>80<span class="" style="white-space:pre"> </span>      ^ kAppMemXor) * kShadowCnt;</div><div><br></div></font></div><div><font face="monospace, monospace">const uptr kHiAppMemBeg   = 0x7e8000000000ull;<br></font></div><div><font face="monospace, monospace">const uptr kAppMemMsk     = 0x7c0000000000ull;</font></div><div><font face="monospace, monospace">const uptr kAppMemXor     = 0x020000000000ull;<br></font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">x = </font><span style="font-family:monospace,monospace">0x7e8000000000ull</span></div><div><span style="font-family:monospace,monospace">y = </span><span style="font-family:monospace,monospace">(x) & ~(kAppMemMsk | (kShadowCell - 1)) = 0x028</span><span style="font-family:monospace,monospace">000000000ull;</span></div><div><span style="font-family:monospace,monospace">z = y ^ kAppMemXor = 0x008</span><span style="font-family:monospace,monospace">000000000ull;</span></div><div><span style="font-family:monospace,monospace">z * kShadowCnt = z * 2 = </span><span style="font-family:monospace,monospace">0x010</span><span style="font-family:monospace,monospace">000000000ull;</span></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
and it prints:<br>
<br>
kShadowBeg=0x020000000000 kHiAppMemBeg=0x7e8000000000 shadow=0x020000000000 ok=1<br>
<div class=""><div class="h5"><br>
<br>
<br>
On Mon, Jan 12, 2015 at 9:28 PM, Alexey Samsonov <<a href="mailto:vonosmas@gmail.com">vonosmas@gmail.com</a>> wrote:<br>
> Take a closer look at tsan_platform.h<br>
><br>
> MemToShadow() doesn't map all the user memory regions into expected<br>
> 0x0200000000 - 0x1000000000 range.<br>
> That is, IsShadowMem(MemToShadow(kHiAppMemBeg)) == false.<br>
><br>
> On Mon, Jan 12, 2015 at 7:25 AM, Dmitry Vyukov <<a href="mailto:dvyukov@google.com">dvyukov@google.com</a>> wrote:<br>
>><br>
>> What is the problem with TSAN_SHADOW_COUNT != 4? I do not see what has<br>
>> changed wrt TSAN_SHADOW_COUNT.<br>
>><br>
>> On Tue, Jan 6, 2015 at 5:25 AM, Alexey Samsonov <<a href="mailto:vonosmas@gmail.com">vonosmas@gmail.com</a>><br>
>> wrote:<br>
>> > After this change TSan can only work with TSAN_SHADOW_COUNT=4.<br>
>> > Do we plan to keep support for another values, or it's fine to just drop<br>
>> > them?<br>
>> ><br>
>> > On Sat, Oct 25, 2014 at 2:25 AM, Dmitry Vyukov <<a href="mailto:dvyukov@google.com">dvyukov@google.com</a>><br>
>> > wrote:<br>
>> >><br>
>> >> On Sat, Oct 25, 2014 at 1:17 AM, Kostya Serebryany <<a href="mailto:kcc@google.com">kcc@google.com</a>><br>
>> >> wrote:<br>
>> >> > Nice!<br>
>> >> > Please also update the docs (where relevant).<br>
>> >> > Do we need to remove -PIE from the driver now?<br>
>> >><br>
>> >> There is no immediate need for any changes.<br>
>> >> We can remove pie just to match gcc and asan, though. But I am sure<br>
>> >> that such change will cause a new splash of complains that something<br>
>> >> broke in some weird setups...<br>
>> >> _______________________________________________<br>
>> >> llvm-commits mailing list<br>
>> >> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
>> >> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
>> ><br>
>> ><br>
>> ><br>
>> ><br>
>> > --<br>
>> > Alexey Samsonov<br>
>> > <a href="mailto:vonosmas@gmail.com">vonosmas@gmail.com</a><br>
><br>
><br>
><br>
><br>
> --<br>
> Alexey Samsonov<br>
> <a href="mailto:vonosmas@gmail.com">vonosmas@gmail.com</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Alexey Samsonov<br><a href="mailto:vonosmas@gmail.com" target="_blank">vonosmas@gmail.com</a></div></div>
</div></div>