<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - llvm-reduce tests fail with "Error making unique filename: File exists!""
   href="https://bugs.llvm.org/show_bug.cgi?id=43278">43278</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>llvm-reduce tests fail with "Error making unique filename: File exists!"
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>tools
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>support scripts
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>nicolasweber@gmx.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>greg.bedwell@sony.com, i@maskray.me, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre><a href="http://llvm-cs.pcc.me.uk/tools/llvm-reduce/deltas/Delta.cpp#38">http://llvm-cs.pcc.me.uk/tools/llvm-reduce/deltas/Delta.cpp#38</a> does:

  sys::path::append(TmpFilepath, TmpDir, "tmp-%%%.ll");
  std::error_code EC =
      sys::fs::createUniqueFile(TmpFilepath, UniqueFD, UniqueFilepath);


Every other caller of createUniqueFile uses way more '%' characters.
createUniqueFile() tries a few times to make unique names but gives up after
128 tries.


But llvm-reduce not creating unique files in tmp and/or deleting them when it's
done is a problem too.

Two things to do:

- make llvm-reduce clean up after itself
- use more '%' characters.


$ ls out/gn/obj/llvm/test/Reduce/tmp/tmp-
Display all 4088 possibilities? (y or n)

16**3 is is 4096, so the test created almost all possible file names on my
system.


ninja: Entering directory `out/gn'
[0/2] ACTION
//clang-tools-extra/clangd/test:check-clangd(//llvm/utils/gn/build/toolchain:unix)
llvm-lit:
/usr/local/google/home/thakis/src/llvm-project/llvm/utils/lit/lit/llvm/config.py:340:
note: using clang:
/usr/local/google/home/thakis/src/llvm-project/out/gn/bin/clang
-- Testing: 610 tests, 64 threads --
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 
Testing Time: 4.12s
  Expected Passes    : 607
  Unsupported Tests  : 3
INFO:root:test check-clang-tools
ninja: Entering directory `out/gn'
[0/2] ACTION
//clang-tools-extra/test:check-clang-tools(//llvm/utils/gn/build/toolchain:unix)
-- Testing: 784 tests, 64 threads --
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 
Testing Time: 4.11s
  Expected Passes    : 782
  Expected Failures  : 1
  Unsupported Tests  : 1
INFO:root:test check-lld
ninja: Entering directory `out/gn'
[0/2] ACTION //lld/test:check-lld(//llvm/utils/gn/build/toolchain:unix)
llvm-lit:
/usr/local/google/home/thakis/src/llvm-project/llvm/utils/lit/lit/llvm/config.py:340:
note: using ld.lld:
/usr/local/google/home/thakis/src/llvm-project/out/gn/bin/ld.lld
llvm-lit:
/usr/local/google/home/thakis/src/llvm-project/llvm/utils/lit/lit/llvm/config.py:340:
note: using lld-link:
/usr/local/google/home/thakis/src/llvm-project/out/gn/bin/lld-link
llvm-lit:
/usr/local/google/home/thakis/src/llvm-project/llvm/utils/lit/lit/llvm/config.py:340:
note: using ld64.lld:
/usr/local/google/home/thakis/src/llvm-project/out/gn/bin/ld64.lld
llvm-lit:
/usr/local/google/home/thakis/src/llvm-project/llvm/utils/lit/lit/llvm/config.py:340:
note: using wasm-ld:
/usr/local/google/home/thakis/src/llvm-project/out/gn/bin/wasm-ld
-- Testing: 2199 tests, 64 threads --
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 
Testing Time: 20.03s
  Expected Passes    : 2160
  Expected Failures  : 1
  Unsupported Tests  : 38
INFO:root:test check-llvm
ninja: Entering directory `out/gn'
[0/2] ACTION //llvm/test:check-llvm(//llvm/utils/gn/build/toolchain:unix)
-- Testing: 33473 tests, 64 threads --
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.
FAIL: LLVM :: Reduce/remove-funcs.ll (25784 of 33473)
******************** TEST 'LLVM :: Reduce/remove-funcs.ll' FAILED
********************
Script:
--
: 'RUN: at line 4';   rm -rf
/usr/local/google/home/thakis/src/llvm-project/out/gn/obj/llvm/test/Reduce/Output/remove-funcs.ll.tmp
: 'RUN: at line 5';   mkdir
/usr/local/google/home/thakis/src/llvm-project/out/gn/obj/llvm/test/Reduce/Output/remove-funcs.ll.tmp
: 'RUN: at line 7';   cp
/usr/local/google/home/thakis/src/llvm-project/llvm/test/Reduce/Inputs/remove-funcs.py
/usr/local/google/home/thakis/src/llvm-project/out/gn/obj/llvm/test/Reduce/Output/remove-funcs.ll.tmp/test.py
: 'RUN: at line 9';   echo "#!" "/usr/bin/python" >
/usr/local/google/home/thakis/src/llvm-project/out/gn/obj/llvm/test/Reduce/Output/remove-funcs.ll.tmp/test.py
: 'RUN: at line 11';   cat
/usr/local/google/home/thakis/src/llvm-project/llvm/test/Reduce/Inputs/remove-funcs.py
<span class="quote">>></span >
/usr/local/google/home/thakis/src/llvm-project/out/gn/obj/llvm/test/Reduce/Output/remove-funcs.ll.tmp/test.py
: 'RUN: at line 13';   llvm-reduce --test
/usr/local/google/home/thakis/src/llvm-project/out/gn/obj/llvm/test/Reduce/Output/remove-funcs.ll.tmp/test.py
/usr/local/google/home/thakis/src/llvm-project/llvm/test/Reduce/remove-funcs.ll
-o
/usr/local/google/home/thakis/src/llvm-project/out/gn/obj/llvm/test/Reduce/Output/remove-funcs.ll.tmp/out.ll
: 'RUN: at line 14';   cat
/usr/local/google/home/thakis/src/llvm-project/out/gn/obj/llvm/test/Reduce/Output/remove-funcs.ll.tmp/out.ll
| /usr/local/google/home/thakis/src/llvm-project/out/gn/bin/FileCheck
-implicit-check-not=uninteresting
/usr/local/google/home/thakis/src/llvm-project/llvm/test/Reduce/remove-funcs.ll
--
Exit Code: 1

Command Output (stderr):
--
*** Reducing Functions...
----------------------------
Function Index Reference:
        1: uninteresting1
        2: interesting
        3: uninteresting2
        4: uninteresting3
----------------------------
Increasing granularity...Success! New Chunks:
        [1,2]
        [3,4]
Error making unique filename: File exists!

--

********************
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.
FAIL: LLVM :: Reduce/remove-metadata.ll (25810 of 33473)
******************** TEST 'LLVM :: Reduce/remove-metadata.ll' FAILED
********************
Script:
--
: 'RUN: at line 4';   rm -rf
/usr/local/google/home/thakis/src/llvm-project/out/gn/obj/llvm/test/Reduce/Output/remove-metadata.ll.tmp
: 'RUN: at line 5';   mkdir
/usr/local/google/home/thakis/src/llvm-project/out/gn/obj/llvm/test/Reduce/Output/remove-metadata.ll.tmp
: 'RUN: at line 7';   cp
/usr/local/google/home/thakis/src/llvm-project/llvm/test/Reduce/Inputs/remove-metadata.py
/usr/local/google/home/thakis/src/llvm-project/out/gn/obj/llvm/test/Reduce/Output/remove-metadata.ll.tmp/test.py
: 'RUN: at line 9';   echo "#!" "/usr/bin/python" >
/usr/local/google/home/thakis/src/llvm-project/out/gn/obj/llvm/test/Reduce/Output/remove-metadata.ll.tmp/test.py
: 'RUN: at line 11';   cat
/usr/local/google/home/thakis/src/llvm-project/llvm/test/Reduce/Inputs/remove-metadata.py
<span class="quote">>></span >
/usr/local/google/home/thakis/src/llvm-project/out/gn/obj/llvm/test/Reduce/Output/remove-metadata.ll.tmp/test.py
: 'RUN: at line 13';   llvm-reduce --test
/usr/local/google/home/thakis/src/llvm-project/out/gn/obj/llvm/test/Reduce/Output/remove-metadata.ll.tmp/test.py
/usr/local/google/home/thakis/src/llvm-project/llvm/test/Reduce/remove-metadata.ll
-o
/usr/local/google/home/thakis/src/llvm-project/out/gn/obj/llvm/test/Reduce/Output/remove-metadata.ll.tmp/out.ll
: 'RUN: at line 14';   cat
/usr/local/google/home/thakis/src/llvm-project/out/gn/obj/llvm/test/Reduce/Output/remove-metadata.ll.tmp/out.ll
| /usr/local/google/home/thakis/src/llvm-project/out/gn/bin/FileCheck
-implicit-check-not=!
/usr/local/google/home/thakis/src/llvm-project/llvm/test/Reduce/remove-metadata.ll
--
Exit Code: 1

Command Output (stdout):
--
*** Reducing GVs...
----------------------------
GlobalVariable Index Reference:
        1: global
----------------------------
*** Reducing Metadata...

--
Command Output (stderr):
--
warning: ignoring debug info with an invalid version (0) in
/usr/local/google/home/thakis/src/llvm-project/llvm/test/Reduce/remove-metadata.ll
*** Reducing Functions...
----------------------------
Function Index Reference:
        1: main
----------------------------
Increasing granularity...
Already at minimum size. Cannot reduce anymore.
----------------------------
Increasing granularity...
Already at minimum size. Cannot reduce anymore.
Increasing granularity...Success! New Chunks:
        [1]
        [2]
Ignoring: [2] | tmp-4da.ll
Error making unique filename: File exists!

--

********************
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 
Testing Time: 73.33s
********************
Failing Tests (2):
    LLVM :: Reduce/remove-funcs.ll
    LLVM :: Reduce/remove-metadata.ll

  Expected Passes    : 32469
  Expected Failures  : 147
  Unsupported Tests  : 855
  Unexpected Failures: 2</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>