main: handle exceptions during startup
If we don't, std::terminate() causes a core dump, even though an exception is sort-of-expected here and can be handled. Add an exception handler to fix. Fixes #1379. Message-Id: <1466595221-20358-1-git-send-email-avi@scylladb.com>
This commit is contained in:
6
main.cc
6
main.cc
@@ -278,6 +278,7 @@ verify_seastar_io_scheduler(bool has_max_io_requests, bool developer_mode) {
|
||||
}
|
||||
|
||||
int main(int ac, char** av) {
|
||||
try {
|
||||
// early check to avoid triggering
|
||||
if (!cpu_sanity()) {
|
||||
_exit(71);
|
||||
@@ -626,6 +627,11 @@ int main(int ac, char** av) {
|
||||
});
|
||||
}).or_terminate();
|
||||
});
|
||||
} catch (...) {
|
||||
// reactor may not have been initialized, so can't use logger
|
||||
fprint(std::cerr, "FATAL: Exception during startup, aborting: %s\n", std::current_exception());
|
||||
return 7; // 1 has a special meaning for upstart
|
||||
}
|
||||
}
|
||||
|
||||
namespace debug {
|
||||
|
||||
Reference in New Issue
Block a user