arphaman requested changes to this revision.
arphaman added a comment.
This revision now requires changes to proceed.

@kousikk Thanks, I understand your patch better now. It makes more sense for 
sure.

When we're opening the file we shouldn't `stat` before calling `open`, as 
there's a race condition introduced, where the value of the `stat` could change 
between the call between `stat` and `open` is performed. We've seen problems 
like this before, and it ends up in crashes and mismatch size errors as Clang 
is getting invalid size from the stat if the file is modified in that time. We 
should still call `open` + `fstat` like we used. So I would recommend not 
changing the `createFileEntry` function to take in a stat, and do the fstat 
after opening the file like it used to.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68193/new/

https://reviews.llvm.org/D68193



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

Reply via email to