Bug ID: 37091
           Summary: clang-tidy (and possibly other tools) leave temporary
                    files behind
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs

After the following commit was introduced: 

    Author: Ilya Biryukov <>
    Date:   Mon Mar 19 14:19:58 2018 +0000

    Changed createTemporaryFile without FD to actually create a file.

    This commit changes semantics of createUniqueFile and
    createTemporaryFile variants that do not return file descriptors.
    Previously they only checked if files exist, therefore being subject
    to race conditions. Now they will create an empty file to avoid them.

    Functions that do not create a file are now called
    getPotentiallyUniqueTempFileName and getPotentiallyUniqueFileName.

    Reviewers: klimek, bkramer, krasimir, JDevlieghere, espindola

    Reviewed By: klimek

    Subscribers: llvm-commits

    Differential Revision:


we have encountered cases where clang-tidy leaves behind temporary files. This
might also be the case for other tools, but I have not verified that.

When e.g. running the following:

  ( export TMPDIR=tmpdir; rm -rf $TMPDIR; mkdir $TMPDIR;
    clang-tidy empty-file.c -- --target=mips64 )

a placeholder-*.s file is left in $TMPDIR:

  $ ls tmpdir/

A temporary file is created when specifying the following targets: mips64,
mips64el, msp430, nios2, r600, amdgcn, sparc, sparcv9, sparcel, tce, tcele,
xcore, nvptx, nvptx64, le64, spir, spir64, renderscript32, renderscript64.

You are receiving this mail because:
You are on the CC list for the bug.
llvm-bugs mailing list

Reply via email to