summaryrefslogtreecommitdiff
path: root/src/mongo/util/quick_exit.cpp
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2016-08-26 16:55:06 -0400
committerMark Benvenuto <mark.benvenuto@mongodb.com>2016-08-26 17:06:21 -0400
commitbaad0b470b7865f1525ff7c8f1590031f97352c4 (patch)
tree0eb7970c38d1e9aec0ad01eb3fc4848d9a76be6b /src/mongo/util/quick_exit.cpp
parent1653251f733b4b807da5b386534b4289aef77873 (diff)
downloadmongo-baad0b470b7865f1525ff7c8f1590031f97352c4.tar.gz
SERVER-25079 Bypass Windows CRT when exiting
Diffstat (limited to 'src/mongo/util/quick_exit.cpp')
-rw-r--r--src/mongo/util/quick_exit.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mongo/util/quick_exit.cpp b/src/mongo/util/quick_exit.cpp
index 6a1aa9e22fb..5697b74540c 100644
--- a/src/mongo/util/quick_exit.cpp
+++ b/src/mongo/util/quick_exit.cpp
@@ -98,9 +98,11 @@ void quickExit(int code) {
__lsan_do_leak_check();
#endif
-#if defined(_WIN32) && defined(MONGO_CONFIG_DEBUG_BUILD)
- // SERVER-23860: VS 2015 Debug Builds abort during _exit for unknown reasons.
- // Bypass _exit CRT shutdown code and call ExitProcess directly instead.
+#if defined(_WIN32)
+ // SERVER-23860: VS 2015 Debug Builds abort and Release builds AV when _exit is called on
+ // multiple threads. Each call to _exit shuts down the CRT, and so subsequent calls into the
+ // CRT result in undefined behavior. Bypass _exit CRT shutdown code and call ExitProcess
+ // directly instead.
::ExitProcess(code);
#else
::_exit(code);