forked from OSchip/llvm-project
[Support] Fix Windows dump file hang with multi-threaded crashes
Prevents deadlock between MiniDumpWriteDump and CryptAcquireContextW (called via fs::createTemporaryFile) in WriteWindowsDumpFile. However, there's no guarantee that deadlock can't still occur between MiniDumpWriteDump and some other Win32 API call. But that would appear to be the "accepted" risk of using MiniDumpWriteDump in this manner. Differential Revision: https://reviews.llvm.org/D129004
This commit is contained in:
parent
1d27f26426
commit
86a2f2e2db
|
@ -731,6 +731,11 @@ static bool GetDumpType(HKEY Key, MINIDUMP_TYPE &ResultType) {
|
|||
/// otherwise.
|
||||
static std::error_code WINAPI
|
||||
WriteWindowsDumpFile(PMINIDUMP_EXCEPTION_INFORMATION ExceptionInfo) {
|
||||
struct ScopedCriticalSection {
|
||||
ScopedCriticalSection() { EnterCriticalSection(&CriticalSection); }
|
||||
~ScopedCriticalSection() { LeaveCriticalSection(&CriticalSection); }
|
||||
} SCS;
|
||||
|
||||
using namespace llvm;
|
||||
using namespace llvm::sys;
|
||||
|
||||
|
|
Loading…
Reference in New Issue