llvm-project/compiler-rt/lib
Choongwoo Han 46282fad06 [Sanitizer] Use CreateDirectoryA for report dirs
Using `_mkdir` of CRT in Asan Init leads to launch failure and hanging in Windows.

You can trigger it by calling:
> set ASAN_OPTIONS=log_path=a/a/a
> .\asan_program.exe

And their crash dump shows the following stack trace:
```
_guard_dispatch_icall_nop()
__acrt_get_utf8_acp_compatibility_codepage()
_mkdir(const char * path)
```

I guess there could be a cfg guard in CRT, which may lead to calling uninitialized cfg guard function address. Also, `_mkdir` supports UTF-8 encoding of the path and calls _wmkdir, but that's not necessary for this case since other file apis in sanitizer_win.cpp assumes only ANSI code case, so it makes sense to use CreateDirectoryA matching other file api calls in the same file.

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D114760
2021-12-03 12:34:05 -08:00
..
BlocksRuntime
asan [NFC][sanitizer] Remove SetSoftRssLimitExceededCallback 2021-12-02 14:37:02 -08:00
builtins [compiler-rt][CMake] Support powerpcspe build 2021-11-26 13:29:06 -08:00
cfi cfi: fix more -Wformat warnings 2021-11-24 21:48:17 +01:00
crt [cmake] By default do not instrument compiler-rt if LLVM_BUILD_INSTRUMENTED_COVERAGE is ON 2021-11-09 10:59:25 +01:00
dfsan [sanitizer] Switch dlsym hack to internal_allocator 2021-11-12 16:11:10 -08:00
fuzzer [libFuzzer] Disable Msan on InternalStrnlen 2021-11-05 15:24:09 -07:00
gwp_asan Fix a few warnings (signed/unsigned comparison in gtest, and missing field initializers) 2021-10-16 22:43:57 -07:00
hwasan [HWASan] Try 'google' prefixed apex directories in symbolizer. 2021-12-03 10:35:03 -08:00
interception [compiler-rt] [windows] Add more assembly patterns for interception 2021-09-21 15:51:58 -07:00
lsan [sanitizer] DEFINE_REAL_PTHREAD_FUNCTIONS for hwasan, lsan, msan 2021-12-02 10:24:04 -08:00
memprof [NFC][sanitizer] Remove SetSoftRssLimitExceededCallback 2021-12-02 14:37:02 -08:00
msan [sanitizer] DEFINE_REAL_PTHREAD_FUNCTIONS for hwasan, lsan, msan 2021-12-02 10:24:04 -08:00
orc [ORC][ORC-RT] Register type metadata from __swift5_types MachO section 2021-11-12 16:39:59 -08:00
profile [compiler-rt/profile] Include __llvm_profile_get_magic in module signature 2021-11-23 10:03:43 -08:00
safestack Revert "sanitizers: increase .clang-format columns to 100" 2021-07-28 09:40:21 +02:00
sanitizer_common [Sanitizer] Use CreateDirectoryA for report dirs 2021-12-03 12:34:05 -08:00
scudo [scudo] Handle mallinfo2 2021-11-16 19:29:37 -08:00
stats [compiler-rt] separate lsan, ubsan, stats configuration from SANITIZER_COMMON_SUPPORTED_OS 2021-11-10 19:16:20 -08:00
tsan tsan: tolerate munmap with invalid arguments 2021-12-02 17:50:51 +01:00
ubsan [compiler-rt] separate lsan, ubsan, stats configuration from SANITIZER_COMMON_SUPPORTED_OS 2021-11-10 19:16:20 -08:00
ubsan_minimal [compiler-rt] separate lsan, ubsan, stats configuration from SANITIZER_COMMON_SUPPORTED_OS 2021-11-10 19:16:20 -08:00
xray Enable -Wformat-pedantic and fix fallout. 2021-11-05 13:12:35 +01:00
CMakeLists.txt [ORC-RT] Re-apply "Initial ORC Runtime directories and build..." with fixes. 2021-04-24 16:00:20 -07:00