mirror of https://gitee.com/bigwinds/arangodb
wait for suicide to actually take place before we fail this
This commit is contained in:
parent
2537e270e8
commit
0aed0312ec
|
@ -83,13 +83,18 @@ void TRI_SegfaultDebugging(char const* message) {
|
||||||
TRI_FlushDebugging();
|
TRI_FlushDebugging();
|
||||||
|
|
||||||
// and now crash
|
// and now crash
|
||||||
#ifndef __APPLE__
|
#ifdef _WIN32
|
||||||
// on MacOS, the following statement makes the server hang but not crash
|
auto hSelf = GetCurrentProcess();
|
||||||
*((char*)-1) = '!';
|
TerminateProcess(hSelf, -999);
|
||||||
|
// TerminateProcess is async, alright wait here for selfdestruct (we will never exit wait)
|
||||||
|
WaitForSingleObject(hSelf, INFINITE);
|
||||||
|
#else
|
||||||
|
kill(getpid(), SIGKILL); //to kill the complete process tree.
|
||||||
|
std::this_thread::sleep_for(std::chrono::seconds(5));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ensure the process is terminated
|
// ensure the process is terminated
|
||||||
abort();
|
TRI_ASSERT(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @brief check whether we should fail at a specific failure point
|
/// @brief check whether we should fail at a specific failure point
|
||||||
|
|
Loading…
Reference in New Issue