<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jun 4, 2016 at 4:52 PM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.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">I think this test needs to create a temporary directory and cd into it:<br>
<br>
llvm-nm a.out | FileCheck %s<br>
<br>
this could be using a a.out from some other test if the scheduling is<br>
just right.<br></blockquote><div><br></div><div>Good catch. I was staring at my original test case in this patch which had explicit `-o`..</div><div><br></div><div>It looks like this issue was likely introduced in <a href="http://llvm.org/klaus/lld/commit/e60c3351266e56d91bfd60f34d36edbbb3a1c5e1/">http://llvm.org/klaus/lld/commit/e60c3351266e56d91bfd60f34d36edbbb3a1c5e1/</a></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">
<br>
Thanks!<br>
<br>
Cheers,<br>
Rafael<br>
<br>
<br>
On 4 June 2016 at 16:30, Sean Silva via llvm-commits<br>
<div class=""><div class="h5"><<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
><br>
><br>
> On Sat, Jun 4, 2016 at 1:43 PM, Chandler Carruth <<a href="mailto:chandlerc@google.com">chandlerc@google.com</a>><br>
> wrote:<br>
>><br>
>> Sorry to dredge up an old commit, but I just saw this test spuriously<br>
>> fail:<br>
>><br>
>><br>
>> <a href="http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/14073" rel="noreferrer" target="_blank">http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/14073</a><br>
>><br>
>> My commit seems unlikely to have triggered this, and the next build<br>
>> "fixed" the test. I'm worried there is something non-deterministic going on<br>
>> here.<br>
><br>
><br>
> Thanks for bringing attention to this. This is actually somewhat more<br>
> troubling.<br>
><br>
> This test case links together save-temps.ll (containing just the function<br>
> `foo`) with Inputs/save-temps.ll (containing just the function `bar`). Yet<br>
> the error message below shows a reference to a function `f`. I'm baffled<br>
> about how a function `f` could end up in the nm output here.<br>
><br>
> Maybe `f` is the string `foo` being cut off, but that doesn't make sense<br>
> since FileCheck's output indicates that it was `bar` that wasn't seen, and<br>
> `bar` would have come first (unless this is a coincidence of the cut off<br>
> with an ordering nondeterminism).<br>
><br>
> Expanding the possibilities to "the bot may be unreliable / cosmic ray"<br>
> territory, this could be that Inputs/linkonce.ll or another file containing<br>
> a function `f` is somehow getting used instead of Inputs/save-temps.ll<br>
> (which, assuming LLD is deterministic, makes sense since `bar` is missing<br>
> and `f` was found in its place).<br>
><br>
> FAIL: lld :: ELF/lto/save-temps.ll (26092 of 27438)<br>
> ******************** TEST 'lld :: ELF/lto/save-temps.ll' FAILED<br>
> ********************<br>
> Script:<br>
> --<br>
> rm -f a.out a.out.lto.bc a.out.lto.o<br>
> llvm-as<br>
> /home/buildbot/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.src/tools/lld/test/ELF/lto/save-temps.ll<br>
> -o<br>
> /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<br>
> llvm-as<br>
> /home/buildbot/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.src/tools/lld/test/ELF/lto/Inputs/save-temps.ll<br>
> -o<br>
> /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<br>
> /home/buildbot/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.obj/./bin/ld.lld<br>
> -shared -m elf_x86_64<br>
> /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<br>
> /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<br>
> -save-temps<br>
> /home/buildbot/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.obj/./bin/llvm-nm<br>
> a.out |<br>
> /home/buildbot/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.obj/./bin/FileCheck<br>
> /home/buildbot/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.src/tools/lld/test/ELF/lto/save-temps.ll<br>
> /home/buildbot/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.obj/./bin/llvm-nm<br>
> a.out.lto.bc |<br>
> /home/buildbot/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.obj/./bin/FileCheck<br>
> /home/buildbot/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.src/tools/lld/test/ELF/lto/save-temps.ll<br>
> /home/buildbot/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.obj/./bin/llvm-nm<br>
> a.out.lto.o |<br>
> /home/buildbot/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.obj/./bin/FileCheck<br>
> /home/buildbot/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/llvm.src/tools/lld/test/ELF/lto/save-temps.ll<br>
> llvm-dis a.out.lto.bc<br>
> --<br>
> Exit Code: 1<br>
><br>
> Command Output (stderr):<br>
> --<br>
> /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:<br>
> error: expected string not found in input<br>
> ; CHECK: T bar<br>
>          ^<br>
> <stdin>:1:1: note: scanning from here<br>
> 0000000000002000 d _DYNAMIC<br>
> ^<br>
> <stdin>:2:18: note: possible intended match here<br>
> 0000000000001000 T f<br>
>                  ^<br>
><br>
> --<br>
><br>
> ********************<br>
><br>
><br>
><br>
><br>
>><br>
>> When reading this patch I noticed one thing below:<br>
>><br>
>> On Wed, Mar 9, 2016 at 2:34 PM Sean Silva via llvm-commits<br>
>> <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
>>><br>
>>><br>
>>> ==============================================================================<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>
>><br>
>><br>
>> This change seems odd and unrelated to me.<br>
>><br>
>> If the CHECK-DAG was required, that shows some lack of deterministic<br>
>> output here. This change seems unlikely to have fixed any such<br>
>> non-determinism.<br>
><br>
><br>
> The CHECK-DAG was because the intent of the test actually doesn't imply an<br>
> order. For example, down the road, LTO is likely to do function layout and<br>
> so these may end up in a different order, and IMO the test shouldn't be<br>
> fragile.  Rui objected because it "doesn't currently" matter, and I<br>
> assented.<br>
><br>
> -- Sean Silva<br>
><br>
>><br>
>><br>
>> Sadly, this seems unlikely to explain the spurious failure I just saw. =/<br>
><br>
><br>
><br>
</div></div><div class=""><div class="h5">> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
> <a 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>
><br>
</div></div></blockquote></div><br></div></div>