From 9dbc6adcda947b571d6af22c3b306f12f912c1a9 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 23 Jan 2013 13:46:18 +0100 Subject: [PATCH] add a SIGSEGV handler --- src/main.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main.cc b/src/main.cc index 269f4e5b..e0e3de3f 100644 --- a/src/main.cc +++ b/src/main.cc @@ -712,10 +712,18 @@ RemoteClient* connect_to(const String& pid, const String& init_command) return remote_client; } +void sigsegv_handler(int) +{ + endwin(); + on_assert_failed("Kakoune SEGFAULT !"); + abort(); +} + int main(int argc, char* argv[]) { try { + signal(SIGSEGV, sigsegv_handler); std::vector params; for (size_t i = 1; i < argc; ++i) params.push_back(argv[i]);