Repository: kythe/kythe (language: rust)

Issue:
Segmentation fault when indexing chromium compilation 
Hello,
I finished building the chromium compilation and got chromium_linux.kzip (Here is the [link](https://drive.google.com/file/d/1e0-Zre1xAzYHZCr-_KY4h2Tf5DeDyqpz/view?usp=sharing)) around 4GBs. I want to get its graph representation and I used cxx indexer to index it as `/opt/kythe/indexers/cxx_indexer chromium_linux.kzip > chromium_linux.entries`. However, I got a Segmentation fault when the entries file is around 125GBs like 
```
warning: could not detect path style for 
warning: working directory  is not absolute
*** SIGSEGV received at time=1686842396 on cpu 8 ***
PC: @     0x55999e976bb1  (unknown)  kythe::IndexVFS::FileRecordForPath()
    @     0x5599a3356f3c         64  absl::WriteFailureInfo()
    @     0x5599a3356bd8        288  absl::AbslFailureSignalHandler()
    @     0x7fa21b242520  970895328  (unknown)
    @     0x55999e9780ad       1232  kythe::IndexVFS::FileRecordForPathRoot()
    @     0x55999e977061       1904  kythe::IndexVFS::FileRecordForPath()
    @     0x55999e9780ad       1232  kythe::IndexVFS::FileRecordForPathRoot()
    @     0x55999e977061       1904  kythe::IndexVFS::FileRecordForPath()
    @     0x55999e9780ad       1232  kythe::IndexVFS::FileRecordForPathRoot()
    @     0x55999e977061       1904  kythe::IndexVFS::FileRecordForPath()
    @     0x55999e9780ad       1232  kythe::IndexVFS::FileRecordForPathRoot()
    @     0x55999e977061       1904  kythe::IndexVFS::FileRecordForPath()
    @     0x55999e9780ad       1232  kythe::IndexVFS::FileRecordForPathRoot()
    @     0x55999e977061       1904  kythe::IndexVFS::FileRecordForPath()
    @     0x55999e9780ad       1232  kythe::IndexVFS::FileRecordForPathRoot()
    @     0x55999e977061       1904  kythe::IndexVFS::FileRecordForPath()
    @     0x55999e9780ad       1232  kythe::IndexVFS::FileRecordForPathRoot()
    @     0x55999e977061       1904  kythe::IndexVFS::FileRecordForPath()
    @     0x55999e9780ad       1232  kythe::IndexVFS::FileRecordForPathRoot()
    @     0x55999e977061       1904  kythe::IndexVFS::FileRecordForPath()
    @     0x55999e9780ad       1232  kythe::IndexVFS::FileRecordForPathRoot()
    @     0x55999e977061       1904  kythe::IndexVFS::FileRecordForPath()
    @     0x55999e9780ad       1232  kythe::IndexVFS::FileRecordForPathRoot()
    @     0x55999e977061       1904  kythe::IndexVFS::FileRecordForPath()
    @     0x55999e9780ad       1232  kythe::IndexVFS::FileRecordForPathRoot()
    @     0x55999e977061       1904  kythe::IndexVFS::FileRecordForPath()
    @     0x55999e9780ad       1232  kythe::IndexVFS::FileRecordForPathRoot()
    @     0x55999e977061       1904  kythe::IndexVFS::FileRecordForPath()
    @     0x55999e9780ad       1232  kythe::IndexVFS::FileRecordForPathRoot()
    @     0x55999e977061       1904  kythe::IndexVFS::FileRecordForPath()
    @     0x55999e9780ad       1232  kythe::IndexVFS::FileRecordForPathRoot()
    @     0x55999e977061       1904  kythe::IndexVFS::FileRecordForPath()
    @     0x55999e9780ad       1232  kythe::IndexVFS::FileRecordForPathRoot()
    @ ... and at least 1000 more frames
Segmentation fault (core dumped)
```
Am I building the kzip file incorrectly or using the indexer incorrectly? Any help is appreciated.  

OS: Ubuntu 22.04.2 LTS
CPU: AMD x86_64
RAM: 128GBs
kythe release version: 0.0.61 (passed all bazel tests)


Discussion / hints:
I would expect running the C++ indexer as a single binary over a 4GB kzip to take until the heat death of the universe to complete. I'm a little surprised by the stack-overflow segmentation fault, but given the `warning: working directory  is not absolute` the comment https://github.com/kythe/kythe/blob/7880a91002f0fb41f161b43ad7e0e4be76d0dbe9/kythe/cxx/indexer/cxx/KytheVFS.cc#L186 is clearly incorrect.

Fix patch:
diff --git a/kythe/cxx/indexer/cxx/KytheVFS.cc b/kythe/cxx/indexer/cxx/KytheVFS.cc
index 210546fb0f..be14bc5482 100644
--- a/kythe/cxx/indexer/cxx/KytheVFS.cc
+++ b/kythe/cxx/indexer/cxx/KytheVFS.cc
@@ -65,8 +65,9 @@ IndexVFS::IndexVFS(absl::string_view working_directory,
           style)) {
   if (!llvm::sys::path::is_absolute(working_directory_,
                                     llvm::sys::path::Style::posix)) {
-    absl::FPrintF(stderr, "warning: working directory %s is not absolute\n",
-                  working_directory_);
+    LOG(WARNING) << "working directory " << working_directory_
+                 << " is not absolute";
+    working_directory_ = absl::StrCat("/", working_directory_);
   }
   for (const auto& data : virtual_files) {
     std::string path = FixupPath(data.info().path(), style);


Test patch: