<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi,<br>
    <br>
    The stack trace produced by TSan is:<br>
    <br>
      Previous write of size 8 at 0x0120ed2930 by thread T1:<br>
        #0 memset
    /home/slt/LLVM/llvm/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:678
    (race_on_mutex.c.tmp+0x0120071808)<br>
        #1 __GI___pthread_mutex_init
    /build/glibc-g99ldr/glibc-2.19/nptl/pthread_mutex_init.c:84
    (libpthread.so.0+0x000000d634)<br>
        #2 <null>
    /home/slt/LLVM/llvm/projects/compiler-rt/test/tsan/race_on_mutex.c:11
    (race_on_mutex.c.tmp+0x01200ea59c)<br>
    <br>
    The actual cause may be that the memset call at
    pthread_mutex_init.c:84 is not in-lined for mips where as it is
    in-lined for x86 targets.<br>
    Should we adjust the expected output?<br>
    <blockquote type="cite">Modified:
      compiler-rt/trunk/test/tsan/race_on_mutex.c<br>
      URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/race_on_mutex.c?rev=261986&r1=261985&r2=261986&view=diff"
        rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/race_on_mutex.c?rev=261986&r1=261985&r2=261986&view=diff</a><br>
==============================================================================<br>
      --- compiler-rt/trunk/test/tsan/race_on_mutex.c (original)<br>
      +++ compiler-rt/trunk/test/tsan/race_on_mutex.c Fri Feb 26
      01:01:24 2016<br>
      @@ -2,6 +2,10 @@<br>
       // This test fails when run on powerpc64 (VMA=46).<br>
       // The size of the write reported by Tsan for T1 is 8 instead of
      1.<br>
       // XFAIL: powerpc64<br>
      +// This test expects pthread_mutex_init in the frame #0 of thread
      T1 but we<br>
      +// get memset at frame #0 because memset that is called from
      pthread_init_mutex<br>
      <div><br>
      </div>
      <div>^^</div>
      <div>Seems that you're missing a verb or a preposition in this
        sentence.</div>
      <div>Also, pthread_mutex_init, not pthread_init_mutex.</div>
    </blockquote>
    Sorry, I'll correct it.<br>
    <br>
    <div class="moz-cite-prefix">On Saturday 27 February 2016 12:55 AM,
      Alexey Samsonov wrote:<br>
    </div>
    <blockquote
cite="mid:CAFBZoY8t2eijGVoYQQF2BvkNkuKPB-2g-SvktgJdN0pngn+dgw@mail.gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <div dir="ltr">
        <div class="gmail_extra">So, what is the stack trace produced by
          TSan? I don't see why we should XFAIL the test - we can either
          adjust the expectation,</div>
        <div class="gmail_extra">or improve the runtime so that it would
          in fact produce pthread_mutex_init as frame #0.</div>
        <div class="gmail_extra"><br>
          <div class="gmail_quote">On Thu, Feb 25, 2016 at 11:01 PM,
            Sagar Thakur via llvm-commits <span dir="ltr"><<a
                moz-do-not-send="true"
                href="mailto:llvm-commits@lists.llvm.org"
                target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a></a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">Author:
              slthakur<br>
              Date: Fri Feb 26 01:01:24 2016<br>
              New Revision: 261986<br>
              <br>
              URL: <a moz-do-not-send="true"
                href="http://llvm.org/viewvc/llvm-project?rev=261986&view=rev"
                rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=261986&view=rev</a><br>
              Log:<br>
              [TSAN] XFAIL race_on_mutex.cc for MIPS<br>
              <br>
              This test expects pthread_mutex_init in the frame #0 of
              thread T1 but we<br>
              get memset at frame #0 because memset that is called from
              pthread_init_mutex<br>
              is being intercepted by TSan<br>
              <br>
              <br>
              Modified:<br>
                  compiler-rt/trunk/test/tsan/race_on_mutex.c<br>
              <br>
              Modified: compiler-rt/trunk/test/tsan/race_on_mutex.c<br>
              URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/race_on_mutex.c?rev=261986&r1=261985&r2=261986&view=diff"
                rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/race_on_mutex.c?rev=261986&r1=261985&r2=261986&view=diff</a><br>
==============================================================================<br>
              --- compiler-rt/trunk/test/tsan/race_on_mutex.c (original)<br>
              +++ compiler-rt/trunk/test/tsan/race_on_mutex.c Fri Feb 26
              01:01:24 2016<br>
              @@ -2,6 +2,10 @@<br>
               // This test fails when run on powerpc64 (VMA=46).<br>
               // The size of the write reported by Tsan for T1 is 8
              instead of 1.<br>
               // XFAIL: powerpc64<br>
              +// This test expects pthread_mutex_init in the frame #0
              of thread T1 but we<br>
              +// get memset at frame #0 because memset that is called
              from pthread_init_mutex<br>
            </blockquote>
            <div><br>
            </div>
            <div>^^</div>
            <div>Seems that you're missing a verb or a preposition in
              this sentence.</div>
            <div>Also, pthread_mutex_init, not pthread_init_mutex.</div>
            <div> </div>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              +// is being intercepted by TSan<br>
              +// XFAIL: mips64<br>
               #include "test.h"<br>
              <br>
               pthread_mutex_t Mtx;<br>
              <br>
              <br>
              _______________________________________________<br>
              llvm-commits mailing list<br>
              <a moz-do-not-send="true"
                href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
              <a moz-do-not-send="true"
                href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits"
                rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
            </blockquote>
          </div>
          <br>
          <br clear="all">
          <div><br>
          </div>
          -- <br>
          <div class="gmail_signature">
            <div dir="ltr">Alexey Samsonov<br>
              <a moz-do-not-send="true" href="mailto:vonosmas@gmail.com"
                target="_blank">vonosmas@gmail.com</a></div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>