[all-commits] [llvm/llvm-project] 634da7: [sanitizer] Check if directory exists before tryin...

Teresa Johnson via All-commits all-commits at lists.llvm.org
Sun Feb 13 07:00:35 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 634da7a1c61ee8c173e90a841eb1f4ea03caa20b
      https://github.com/llvm/llvm-project/commit/634da7a1c61ee8c173e90a841eb1f4ea03caa20b
  Author: Teresa Johnson <tejohnson at google.com>
  Date:   2022-02-13 (Sun, 13 Feb 2022)

  Changed paths:
    M compiler-rt/lib/sanitizer_common/sanitizer_file.cpp
    M compiler-rt/lib/sanitizer_common/sanitizer_file.h
    M compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
    M compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp
    M compiler-rt/lib/sanitizer_common/sanitizer_win.cpp
    M compiler-rt/lib/sanitizer_common/tests/sanitizer_libc_test.cpp
    M compiler-rt/test/asan/TestCases/log-path_test.cpp
    M compiler-rt/test/memprof/TestCases/log_path_test.cpp
    M compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_set_report_path_test.cpp

  Log Message:
  -----------
  [sanitizer] Check if directory exists before trying to create

Add a DirExists mechanism, modeled after FileExists. Use it to guard
creation of the report path directory.

This should avoid failures running the sanitizer in a sandbox where the
file creation attempt causes hard failures, even for an existing
directory. Problem reported on D109794 for ChromeOS in sandbox
(https://issuetracker.google.com/209296420).

Differential Revision: https://reviews.llvm.org/D119495




More information about the All-commits mailing list