<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jun 4, 2016 at 1:43 PM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@google.com" target="_blank">chandlerc@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div>Sorry to dredge up an old commit, but I just saw this test spuriously fail:</div><div><br></div><div><a href="http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/14073" target="_blank">http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/14073</a><br></div><div><br></div><div>My commit seems unlikely to have triggered this, and the next build "fixed" the test. I'm worried there is something non-deterministic going on here.</div></div></div></blockquote><div><br></div><div>Thanks for bringing attention to this. This is actually somewhat more troubling.</div><div><br></div><div><div>This test case links together save-temps.ll (containing just the function `foo`) with Inputs/save-temps.ll (containing just the function `bar`). Yet the error message below shows a reference to a function `f`. I'm baffled about how a function `f` could end up in the nm output here.</div><div><br></div><div>Maybe `f` is the string `foo` being cut off, but that doesn't make sense since FileCheck's output indicates that it was `bar` that wasn't seen, and `bar` would have come first (unless this is a coincidence of the cut off with an ordering nondeterminism).</div><div><br></div><div>Expanding the possibilities to "the bot may be unreliable / cosmic ray" territory, this could be that Inputs/linkonce.ll or another file containing a function `f` is somehow getting used instead of Inputs/save-temps.ll (which, assuming LLD is deterministic, makes sense since `bar` is missing and `f` was found in its place).</div></div><div><br></div><div><pre style="font-family:"Courier New",courier,monotype,monospace;color:rgb(0,0,0);font-size:medium"><span class="">FAIL: lld :: ELF/lto/save-temps.ll (26092 of 27438)
******************** TEST 'lld :: ELF/lto/save-temps.ll' FAILED ********************
Script:
--
rm -f a.out a.out.lto.bc a.out.lto.o
llvm-as /home/buildbot/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.src/tools/lld/test/ELF/lto/save-temps.ll -o /home/buildbot/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.obj/tools/lld/test/ELF/lto/Output/save-temps.ll.tmp.o
llvm-as /home/buildbot/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.src/tools/lld/test/ELF/lto/Inputs/save-temps.ll -o /home/buildbot/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.obj/tools/lld/test/ELF/lto/Output/save-temps.ll.tmp2.o
/home/buildbot/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.obj/./bin/ld.lld -shared -m elf_x86_64 /home/buildbot/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.obj/tools/lld/test/ELF/lto/Output/save-temps.ll.tmp.o /home/buildbot/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.obj/tools/lld/test/ELF/lto/Output/save-temps.ll.tmp2.o -save-temps
/home/buildbot/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.obj/./bin/llvm-nm a.out | /home/buildbot/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.obj/./bin/FileCheck /home/buildbot/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.src/tools/lld/test/ELF/lto/save-temps.ll
/home/buildbot/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.obj/./bin/llvm-nm a.out.lto.bc | /home/buildbot/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.obj/./bin/FileCheck /home/buildbot/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.src/tools/lld/test/ELF/lto/save-temps.ll
/home/buildbot/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.obj/./bin/llvm-nm a.out.lto.o | /home/buildbot/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.obj/./bin/FileCheck /home/buildbot/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.src/tools/lld/test/ELF/lto/save-temps.ll
llvm-dis a.out.lto.bc
--
Exit Code: 1

Command Output (stderr):
--
/home/buildbot/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.src/tools/lld/test/ELF/lto/save-temps.ll:18:10: error: expected string not found in input
; CHECK: T bar
         ^
<stdin>:1:1: note: scanning from here
0000000000002000 d _DYNAMIC
^
<stdin>:2:18: note: possible intended match here
0000000000001000 T f
                 ^

--

********************</span></pre></div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div> When reading this patch I noticed one thing below:</div><span class=""><div dir="ltr"><br></div><div dir="ltr">On Wed, Mar 9, 2016 at 2:34 PM Sean Silva via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">==============================================================================<br>
--- lld/trunk/test/ELF/lto/save-temps.ll (original)<br>
+++ lld/trunk/test/ELF/lto/save-temps.ll Wed Mar  9 16:30:05 2016<br>
@@ -1,10 +1,11 @@<br>
 ; REQUIRES: x86<br>
-; RUN: rm -f %t.so %t.so.lto.bc<br>
+; RUN: rm -f %t.so %t.so.lto.bc %t.so.lto.o<br>
 ; RUN: llvm-as %s -o %t.o<br>
 ; RUN: llvm-as %p/Inputs/save-temps.ll -o %t2.o<br>
 ; RUN: ld.lld -shared -m elf_x86_64 %t.o %t2.o -o %t.so -save-temps<br>
 ; RUN: llvm-nm %t.so | FileCheck %s<br>
 ; RUN: llvm-nm %t.so.lto.bc | FileCheck %s<br>
+; RUN: llvm-nm %t.so.lto.o | FileCheck %s<br>
<br>
 target triple = "x86_64-unknown-linux-gnu"<br>
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"<br>
@@ -13,5 +14,5 @@ define void @foo() {<br>
   ret void<br>
 }<br>
<br>
-; CHECK-DAG: T bar<br>
-; CHECK-DAG: T foo<br>
+; CHECK: T bar<br>
+; CHECK: T foo<br></blockquote><div><br></div></span><div>This change seems odd and unrelated to me.</div><div><br></div><div>If the CHECK-DAG was required, that shows some lack of deterministic output here. <span style="line-height:1.5">This change seems unlikely to have fixed any such non-determinism.</span></div></div></div></blockquote><div><br></div><div>The CHECK-DAG was because the intent of the test actually doesn't imply an order. For example, down the road, LTO is likely to do function layout and so these may end up in a different order, and IMO the test shouldn't be fragile.  Rui objected because it "doesn't currently" matter, and I assented.</div><div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div><span style="line-height:1.5"><br></span></div><div>Sadly, this seems unlikely to explain the spurious failure I just saw. =/</div></div></div>
</blockquote></div><br></div></div>