[compiler-rt] [Sanitizer] Option to fallback to stderr if unable to open logfile (PR #158687)

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 16 13:49:57 PDT 2025


================
@@ -36,9 +36,16 @@ void RawWrite(const char *buffer) {
 
 void ReportFile::ReopenIfNecessary() {
   mu->CheckLocked();
-  if (fd == kStdoutFd || fd == kStderrFd) return;
+  if (!lastOpenFailed)
+    if (fd == kStdoutFd || fd == kStderrFd)
+      return;
 
   uptr pid = internal_getpid();
+  if (lastOpenFailed && fd_pid != pid) {
+    fd = kInvalidFd;
+    lastOpenFailed = false;
+  }
+
----------------
SharonXSharon wrote:

Could you add a comment explaining what this scenario is?


https://github.com/llvm/llvm-project/pull/158687


More information about the llvm-commits mailing list