mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 02:28:21 +00:00
Use _exit() in Reporter::FatalError
Using exit() here may generally not work well since: * That will result in calling global destructors * We have global state that we potentially modify at run-time and are in the middle of modiying at the time the FatalError occurs. E.g. out-of-memory is one situation where it's likely we could call the dtor of an object in which operation on it's internal state is no longer consistent/safe.
This commit is contained in:
parent
31d30bb47e
commit
41882263db
1 changed files with 4 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
|||
// See the file "COPYING" in the main distribution directory for copyright.
|
||||
//
|
||||
|
||||
#include <unistd.h>
|
||||
#include <syslog.h>
|
||||
|
||||
#include "zeek-config.h"
|
||||
|
@ -117,7 +118,9 @@ void Reporter::FatalError(const char* fmt, ...)
|
|||
va_end(ap);
|
||||
|
||||
set_processing_status("TERMINATED", "fatal_error");
|
||||
exit(1);
|
||||
fflush(stderr);
|
||||
fflush(stdout);
|
||||
_exit(1);
|
||||
}
|
||||
|
||||
void Reporter::FatalErrorWithCore(const char* fmt, ...)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue