Clear g_procs before closing light processes
Otherwise, the SIGCHLD handler will trigger a server shutdown. The only time this is bad is when LightProcess::Close is called from the segfault handler, because it triggers a server shutdown while we're dealing with the initial crash, which almost always leads to misleading core dumps.
Esse commit está contido em:
@@ -423,11 +423,15 @@ bool LightProcess::initShadow(const std::string &prefix, int id,
|
||||
}
|
||||
|
||||
void LightProcess::Close() {
|
||||
for (int i = 0; i < g_procsCount; i++) {
|
||||
g_procs[i].closeShadow();
|
||||
}
|
||||
boost::scoped_array<LightProcess> procs;
|
||||
procs.swap(g_procs);
|
||||
int count = g_procsCount;
|
||||
g_procs.reset();
|
||||
g_procsCount = 0;
|
||||
|
||||
for (int i = 0; i < count; i++) {
|
||||
procs[i].closeShadow();
|
||||
}
|
||||
}
|
||||
|
||||
void LightProcess::closeShadow() {
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário