[PATCH] D25597: Try to fix buildbot failure in VirtualFileSystem caused by r284129.

2016-10-14 Thread Bruno Cardoso Lopes via cfe-commits
bruno added a comment.

Looks that somehow the current directory doesn't exit anymore OR it's non empty 
but only contains spaces or something like that. Besides the snippet below, 
RedirectingFileSystem::lookupPath(llvm::Twine const&) also calls `makeAbsolute` 
before `remove_dots`. Can you try to print `FileSystemOpts.WorkingDir`?



 
  bool FileManager::getStatValue(StringRef Path, FileData &Data, bool isFile,   



   std::unique_ptr *F) { 


  
  // FIXME: FileSystemOpts shouldn't be passed in here, all paths should be 


  
  // absolute!  


  
  if (FileSystemOpts.WorkingDir.empty())


  
return FileSystemStatCache::get(Path, Data, isFile, F,StatCache.get(), 
*FS);   

   



  
  SmallString<128> FilePath(Path);  


  
  FixupRelativePath(FilePath);  


  



  
  return FileSystemStatCache::get(FilePath.c_str(), Data, isFile, F,


  
  StatCache.get(), *FS);


  

}


https://reviews.llvm.org/D25597



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D25597: Try to fix buildbot failure in VirtualFileSystem caused by r284129.

2016-10-17 Thread Krzysztof Parzyszek via cfe-commits
kparzysz added a comment.

This change

  bool FileManager::getStatValue(StringRef Path, FileData &Data, bool isFile,
 std::unique_ptr *F) {
// FIXME: FileSystemOpts shouldn't be passed in here, all paths should be
// absolute!
  llvm::dbgs() << "FileSystemOpts.WorkingDir: '" << FileSystemOpts.WorkingDir 
<< "'\n";
if (FileSystemOpts.WorkingDir.empty())
  return FileSystemStatCache::get(Path, Data, isFile, F,StatCache.get(), 
*FS);

prints
`FileSystemOpts.WorkingDir: ''`


https://reviews.llvm.org/D25597



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D25597: Try to fix buildbot failure in VirtualFileSystem caused by r284129.

2016-10-17 Thread Krzysztof Parzyszek via cfe-commits
kparzysz added a comment.

In https://reviews.llvm.org/D25597#571532, @kparzysz wrote:

> `FileSystemOpts.WorkingDir: ''`


There is no space between the single quotes.


https://reviews.llvm.org/D25597



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D25597: Try to fix buildbot failure in VirtualFileSystem caused by r284129.

2016-10-17 Thread Krzysztof Parzyszek via cfe-commits
kparzysz added a comment.

Printing Path shows
`/../target/hexagon/include`


https://reviews.llvm.org/D25597



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D25597: Try to fix buildbot failure in VirtualFileSystem caused by r284129.

2016-10-17 Thread Krzysztof Parzyszek via cfe-commits
kparzysz added a comment.

I committed https://reviews.llvm.org/rL284383 and the Hexagon bot is passing 
now. (The patch was reverted, but then it was recommitted.)


https://reviews.llvm.org/D25597



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D25597: Try to fix buildbot failure in VirtualFileSystem caused by r284129.

2016-10-17 Thread Bruno Cardoso Lopes via cfe-commits
bruno added a comment.

Nice! Thanks


https://reviews.llvm.org/D25597



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D25597: Try to fix buildbot failure in VirtualFileSystem caused by r284129.

2016-10-19 Thread Eric Liu via cfe-commits
ioeric abandoned this revision.
ioeric added a comment.

Thanks all!


https://reviews.llvm.org/D25597



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D25597: Try to fix buildbot failure in VirtualFileSystem caused by r284129.

2016-10-14 Thread Eric Liu via cfe-commits
ioeric created this revision.
ioeric added a reviewer: bkramer.
ioeric added a subscriber: cfe-commits.

Since `remove_dots` does not delete leading "../" anymore, assertion test need
to be updated.


https://reviews.llvm.org/D25597

Files:
  lib/Basic/VirtualFileSystem.cpp


Index: lib/Basic/VirtualFileSystem.cpp
===
--- lib/Basic/VirtualFileSystem.cpp
+++ lib/Basic/VirtualFileSystem.cpp
@@ -1477,8 +1477,9 @@
 RedirectingFileSystem::lookupPath(sys::path::const_iterator Start,
   sys::path::const_iterator End, Entry *From) {
 #ifndef LLVM_ON_WIN32
-  assert(!isTraversalComponent(*Start) &&
- !isTraversalComponent(From->getName()) &&
+  // FIXME: `remove_dots` does not remove leading "../" anymore, might need
+  // better test here.
+  assert(!Start->equals(".") && !isTraversalComponent(From->getName()) &&
  "Paths should not contain traversal components");
 #else
   // FIXME: this is here to support windows, remove it once canonicalized


Index: lib/Basic/VirtualFileSystem.cpp
===
--- lib/Basic/VirtualFileSystem.cpp
+++ lib/Basic/VirtualFileSystem.cpp
@@ -1477,8 +1477,9 @@
 RedirectingFileSystem::lookupPath(sys::path::const_iterator Start,
   sys::path::const_iterator End, Entry *From) {
 #ifndef LLVM_ON_WIN32
-  assert(!isTraversalComponent(*Start) &&
- !isTraversalComponent(From->getName()) &&
+  // FIXME: `remove_dots` does not remove leading "../" anymore, might need
+  // better test here.
+  assert(!Start->equals(".") && !isTraversalComponent(From->getName()) &&
  "Paths should not contain traversal components");
 #else
   // FIXME: this is here to support windows, remove it once canonicalized
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D25597: Try to fix buildbot failure in VirtualFileSystem caused by r284129.

2016-10-14 Thread Eric Liu via cfe-commits
ioeric updated this revision to Diff 74631.
ioeric added a comment.

- Separate assertions to get more information.


https://reviews.llvm.org/D25597

Files:
  lib/Basic/VirtualFileSystem.cpp


Index: lib/Basic/VirtualFileSystem.cpp
===
--- lib/Basic/VirtualFileSystem.cpp
+++ lib/Basic/VirtualFileSystem.cpp
@@ -1477,9 +1477,12 @@
 RedirectingFileSystem::lookupPath(sys::path::const_iterator Start,
   sys::path::const_iterator End, Entry *From) {
 #ifndef LLVM_ON_WIN32
-  assert(!isTraversalComponent(*Start) &&
- !isTraversalComponent(From->getName()) &&
- "Paths should not contain traversal components");
+  // FIXME: `remove_dots` does not remove leading "../" anymore, might need
+  // better test here.
+  assert(!Start->equals(".") &&
+ "Start should not be \".\"");
+  assert(!isTraversalComponent(From->getName()) &&
+ "From->getName() should not contain traversal components");
 #else
   // FIXME: this is here to support windows, remove it once canonicalized
   // paths become globally default.


Index: lib/Basic/VirtualFileSystem.cpp
===
--- lib/Basic/VirtualFileSystem.cpp
+++ lib/Basic/VirtualFileSystem.cpp
@@ -1477,9 +1477,12 @@
 RedirectingFileSystem::lookupPath(sys::path::const_iterator Start,
   sys::path::const_iterator End, Entry *From) {
 #ifndef LLVM_ON_WIN32
-  assert(!isTraversalComponent(*Start) &&
- !isTraversalComponent(From->getName()) &&
- "Paths should not contain traversal components");
+  // FIXME: `remove_dots` does not remove leading "../" anymore, might need
+  // better test here.
+  assert(!Start->equals(".") &&
+ "Start should not be \".\"");
+  assert(!isTraversalComponent(From->getName()) &&
+ "From->getName() should not contain traversal components");
 #else
   // FIXME: this is here to support windows, remove it once canonicalized
   // paths become globally default.
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D25597: Try to fix buildbot failure in VirtualFileSystem caused by r284129.

2016-10-14 Thread Benjamin Kramer via cfe-commits
bkramer added a comment.

I think the assertion is correct, there's something fishy with the inputs. The 
paths coming in should be absolute, and there should never be a .. at the start 
in a absolute path. This only fails on a single buildbot and doesn't reproduce 
anywhere else. @bruno any ideas?


https://reviews.llvm.org/D25597



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D25597: Try to fix buildbot failure in VirtualFileSystem caused by r284129.

2016-10-14 Thread Bruno Cardoso Lopes via cfe-commits
bruno added a comment.

One possible reason: remove_dots is called upon a path with a leading "..", 
which then gets appended in front of another path to form the absolute path. 
I'm taking a look right now to try to figure out if there's any code path that 
might lead to this.


https://reviews.llvm.org/D25597



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D25597: Try to fix buildbot failure in VirtualFileSystem caused by r284129.

2016-10-14 Thread Krzysztof Parzyszek via cfe-commits
kparzysz added a comment.

dbgs showed that the path components were `.. target hexagon include`.
The paths are constructed in lib/Driver/ToolChains.cpp, many are based on 
"getHexagonTargetDir".


https://reviews.llvm.org/D25597



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D25597: Try to fix buildbot failure in VirtualFileSystem caused by r284129.

2016-10-14 Thread Bruno Cardoso Lopes via cfe-commits
bruno added a comment.

Krzysztof, do you have a backtrace that you can paste here or point me to the 
buidbot stderr log? There's no point in looking for relative paths inside the 
VFS, it would be nice if we fix the root cause here.


https://reviews.llvm.org/D25597



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D25597: Try to fix buildbot failure in VirtualFileSystem caused by r284129.

2016-10-14 Thread Krzysztof Parzyszek via cfe-commits
kparzysz added a comment.

Right on entry to the asserting function:

  (gdb) where
  #0  0x752b9870 in (anonymous 
namespace)::RedirectingFileSystem::lookupPath(llvm::sys::path::const_iterator, 
llvm::sys::path::const_iterator, (anonymous namespace)::Entry*) () from 
/w/bld/up/bin/../lib/libclang.so.40
  #1  0x752b9b8c in (anonymous 
namespace)::RedirectingFileSystem::lookupPath(llvm::sys::path::const_iterator, 
llvm::sys::path::const_iterator, (anonymous namespace)::Entry*) () from 
/w/bld/up/bin/../lib/libclang.so.40
  #2  0x752b929f in (anonymous 
namespace)::RedirectingFileSystem::lookupPath(llvm::Twine const&) () from 
/w/bld/up/bin/../lib/libclang.so.40
  #3  0x752b836c in (anonymous 
namespace)::RedirectingFileSystem::status(llvm::Twine const&) () from 
/w/bld/up/bin/../lib/libclang.so.40
  #4  0x752b2171 in clang::vfs::OverlayFileSystem::status(llvm::Twine 
const&) () from /w/bld/up/bin/../lib/libclang.so.40
  #5  0x75292691 in clang::FileSystemStatCache::get(llvm::StringRef, 
clang::FileData&, bool, std::__1::unique_ptr >*, clang::FileSystemStatCache*, 
clang::vfs::FileSystem&)
  () from /w/bld/up/bin/../lib/libclang.so.40
  #6  0x7528f523 in clang::FileManager::getStatValue(llvm::StringRef, 
clang::FileData&, bool, std::__1::unique_ptr >*) () from 
/w/bld/up/bin/../lib/libclang.so.40
  #7  0x7528f326 in clang::FileManager::getDirectory(llvm::StringRef, 
bool) () from /w/bld/up/bin/../lib/libclang.so.40
  #8  0x75323e23 in (anonymous 
namespace)::InitHeaderSearch::AddUnmappedPath(llvm::Twine const&, 
clang::frontend::IncludeDirGroup, bool) ()
 from /w/bld/up/bin/../lib/libclang.so.40
  #9  0x75323133 in 
clang::ApplyHeaderSearchOptions(clang::HeaderSearch&, 
clang::HeaderSearchOptions const&, clang::LangOptions const&, llvm::Triple 
const&) () from /w/bld/up/bin/../lib/libclang.so.40
  #10 0x752dc120 in 
clang::CompilerInstance::createPreprocessor(clang::TranslationUnitKind) () from 
/w/bld/up/bin/../lib/libclang.so.40
  #11 0x7531d0a7 in 
clang::FrontendAction::BeginSourceFile(clang::CompilerInstance&, 
clang::FrontendInputFile const&) ()
 from /w/bld/up/bin/../lib/libclang.so.40
  #12 0x752ccc90 in 
clang::ASTUnit::LoadFromCompilerInvocationAction(clang::CompilerInvocation*, 
std::__1::shared_ptr, 
llvm::IntrusiveRefCntPtr, clang::FrontendAction*, 
clang::ASTUnit*, bool, llvm::StringRef, bool, bool, unsigned int, bool, bool, 
bool, std::__1::unique_ptr >*)
  () from /w/bld/up/bin/../lib/libclang.so.40
  #13 0x7507e1b6 in clang_indexSourceFileFullArgv::$_0::operator()() 
const () from /w/bld/up/bin/../lib/libclang.so.40
  #14 0x75c22271 in 
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref) () from 
/w/bld/up/bin/../lib/libclang.so.40
  #15 0x75c223b4 in RunSafelyOnThread_Dispatch(void*) ()
 from /w/bld/up/bin/../lib/libclang.so.40
  #16 0x75c6d3fa in ExecuteOnThread_Dispatch(void*) ()
 from /w/bld/up/bin/../lib/libclang.so.40
  #17 0x7797d182 in start_thread (arg=0x73234700)
  at pthread_create.c:312
  #18 0x73b3047d in clone ()
  at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
  
  (gdb) cont
  Continuing.
  ..:target:hexagon:include:
  c-index-test: 
/w/src/llvm.org/tools/clang/lib/Basic/VirtualFileSystem.cpp:1485: 
ErrorOr<(anonymous namespace)::Entry *> (anonymous 
namespace)::RedirectingFileSystem::lookupPath(sys::path::const_iterator, 
sys::path::const_iterator, (anonymous namespace)::Entry *): Assertion 
`!isTraversalComponent(*Start) && !isTraversalComponent(From->getName()) && 
"Paths should not contain traversal components"' failed.
  
  Program received signal SIGABRT, Aborted.
  0x73a6ccc9 in __GI_raise (sig=sig@entry=6)
  at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
  56  ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.


https://reviews.llvm.org/D25597



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D25597: Try to fix buildbot failure in VirtualFileSystem caused by r284129.

2016-10-14 Thread Krzysztof Parzyszek via cfe-commits
kparzysz added a comment.

The `..:target:hexagon:include:` is debug code printing all the path 
components, separated by :.


https://reviews.llvm.org/D25597



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits