[clang-tools-extra] r299119 - [clang-tidy] Reuse FileID in getLocation

Chih-hung Hsieh via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 30 18:18:11 PDT 2017


I don't know why this test failed only on Windows, but will revert my
change soon.


On Thu, Mar 30, 2017 at 6:07 PM, Yung, Douglas <douglas.yung at sony.com>
wrote:

> Hi, this change seems to be causing the test clang-tidy/llvm-include-order.cpp
> to fail with a crash on the PS4 Windows bot:
>
> (From http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_
> 64-scei-ps4-windows10pro-fast/builds/7487)
>
> ******************** TEST 'Clang Tools :: clang-tidy/llvm-include-order.cpp'
> FAILED ********************
> Script:
> --
> C:/Python27/python.exe C:/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-
> windows10pro-fast/llvm.src/tools/clang/tools/extra/test/.
> ./test\clang-tidy\check_clang_tidy.py C:\Buildbot\Slave\llvm-clang-
> lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\
> tools\clang\tools\extra\test\clang-tidy\llvm-include-order.cpp
> llvm-include-order C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-
> windows10pro-fast\llvm.obj\tools\clang\tools\extra\test\
> clang-tidy\Output\llvm-include-order.cpp.tmp -- -- -isystem
> C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-
> windows10pro-fast\llvm.src\tools\clang\tools\extra\test\
> clang-tidy/Inputs/Headers
> --
> Exit Code: 1
>
> Command Output (stdout):
> --
> $ "C:/Python27/python.exe" "C:/Buildbot/Slave/llvm-clang-
> lld-x86_64-scei-ps4-windows10pro-fast/llvm.src/
> tools/clang/tools/extra/test/../test\clang-tidy\check_clang_tidy.py"
> "C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-
> windows10pro-fast\llvm.src\tools\clang\tools\extra\test\
> clang-tidy\llvm-include-order.cpp" "llvm-include-order"
> "C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-
> windows10pro-fast\llvm.obj\tools\clang\tools\extra\test\
> clang-tidy\Output\llvm-include-order.cpp.tmp" "--" "--" "-isystem"
> "C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-
> windows10pro-fast\llvm.src\tools\clang\tools\extra\test\
> clang-tidy/Inputs/Headers"
> # command output:
> Running ['clang-tidy', 'C:\\Buildbot\\Slave\\llvm-
> clang-lld-x86_64-scei-ps4-windows10pro-fast\\llvm.obj\\
> tools\\clang\\tools\\extra\\test\\clang-tidy\\Output\\
> llvm-include-order.cpp.tmp.cpp', '-fix', '--checks=-*,llvm-include-order',
> '--', '-isystem', 'C:\\Buildbot\\Slave\\llvm-clang-lld-x86_64-scei-ps4-
> windows10pro-fast\\llvm.src\\tools\\clang\\tools\\extra\\
> test\\clang-tidy/Inputs/Headers', '-nostdinc++']...
> clang-tidy failed:
> 2 warnings generated.
>
> Assertion failed: EndColNo <= map.getSourceLine().size() && "Invalid
> range!", file C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-
> windows10pro-fast\llvm.src\tools\clang\lib\Frontend\TextDiagnostic.cpp,
> line 999
>
>
>
> # command stderr:
> Traceback (most recent call last):
>
>   File "C:/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-
> windows10pro-fast/llvm.src/tools/clang/tools/extra/test/.
> ./test\clang-tidy\check_clang_tidy.py", line 140, in <module>
>
>     main()
>
>   File "C:/Buildbot/Slave/llvm-clang-lld-x86_64-scei-ps4-
> windows10pro-fast/llvm.src/tools/clang/tools/extra/test/.
> ./test\clang-tidy\check_clang_tidy.py", line 96, in main
>
>     subprocess.check_output(args, stderr=subprocess.STDOUT).decode()
>
>   File "C:\Python27\lib\subprocess.py", line 573, in check_output
>
>     raise CalledProcessError(retcode, cmd, output=output)
>
> subprocess.CalledProcessError: Command '['clang-tidy',
> 'C:\\Buildbot\\Slave\\llvm-clang-lld-x86_64-scei-ps4-
> windows10pro-fast\\llvm.obj\\tools\\clang\\tools\\extra\\
> test\\clang-tidy\\Output\\llvm-include-order.cpp.tmp.cpp', '-fix',
> '--checks=-*,llvm-include-order', '--', '-isystem',
> 'C:\\Buildbot\\Slave\\llvm-clang-lld-x86_64-scei-ps4-
> windows10pro-fast\\llvm.src\\tools\\clang\\tools\\extra\\
> test\\clang-tidy/Inputs/Headers', '-nostdinc++']' returned non-zero exit
> status 255
>
>
> error: command failed with exit status: 1
>
> --
>
> ********************
>
> Can you take a look?
>
> Douglas Yung
>
> > -----Original Message-----
> > From: cfe-commits [mailto:cfe-commits-bounces at lists.llvm.org] On Behalf
> Of
> > Chih-Hung Hsieh via cfe-commits
> > Sent: Thursday, March 30, 2017 15:09
> > To: cfe-commits at lists.llvm.org
> > Subject: [clang-tools-extra] r299119 - [clang-tidy] Reuse FileID in
> > getLocation
> >
> > Author: chh
> > Date: Thu Mar 30 17:09:17 2017
> > New Revision: 299119
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=299119&view=rev
> > Log:
> > [clang-tidy] Reuse FileID in getLocation
> >
> > One FileID per warning will increase and overflow NextLocalOffset when
> input
> > file is large with many warnings.
> > Reusing FileID avoids this problem.
> >
> > Differential Revision: http://reviews.llvm.org/D31406
> >
> >
> > Modified:
> >     clang-tools-extra/trunk/clang-tidy/ClangTidy.cpp
> >
> > Modified: clang-tools-extra/trunk/clang-tidy/ClangTidy.cpp
> > URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-
> > tidy/ClangTidy.cpp?rev=299119&r1=299118&r2=299119&view=diff
> > ============================================================
> ==================
> > --- clang-tools-extra/trunk/clang-tidy/ClangTidy.cpp (original)
> > +++ clang-tools-extra/trunk/clang-tidy/ClangTidy.cpp Thu Mar 30 17:09:17
> > +++ 2017
> > @@ -238,7 +238,7 @@ private:
> >        return SourceLocation();
> >
> >      const FileEntry *File = SourceMgr.getFileManager().
> getFile(FilePath);
> > -    FileID ID = SourceMgr.createFileID(File, SourceLocation(),
> > SrcMgr::C_User);
> > +    FileID ID = SourceMgr.getOrCreateFileID(File, SrcMgr::C_User);
> >      return SourceMgr.getLocForStartOfFile(ID).getLocWithOffset(Offset);
> >    }
> >
> >
> >
> > _______________________________________________
> > cfe-commits mailing list
> > cfe-commits at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170330/0b000f34/attachment-0001.html>


More information about the cfe-commits mailing list