[compiler-rt] r286395 - [asan/win] Use TerminateProcess when we want to exit abnormally
Reid Kleckner via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 9 13:27:58 PST 2016
Author: rnk
Date: Wed Nov 9 15:27:58 2016
New Revision: 286395
URL: http://llvm.org/viewvc/llvm-project?rev=286395&view=rev
Log:
[asan/win] Use TerminateProcess when we want to exit abnormally
ExitProcess still runs some code which can lead to ASan interceptors
running after CHECK failure. This can lead to deadlock if it CHECK fails
again. Avoid that mess by really exiting immediately.
Modified:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc?rev=286395&r1=286394&r2=286395&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_win.cc Wed Nov 9 15:27:58 2016
@@ -656,7 +656,8 @@ uptr internal_sched_yield() {
}
void internal__exit(int exitcode) {
- ExitProcess(exitcode);
+ // ExitProcess runs some finalizers, so use TerminateProcess to avoid that.
+ TerminateProcess(GetCurrentProcess(), 3);
}
uptr internal_ftruncate(fd_t fd, uptr size) {
More information about the llvm-commits
mailing list