diff options
| author | Maxime Coste <mawww@kakoune.org> | 2018-12-13 21:29:33 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2018-12-13 21:29:33 +1100 |
| commit | d2f2c3d0c72ee8f6cade911f06b3a07ee449b687 (patch) | |
| tree | f59ddf4863ee89b745d7384d6d19c6cdd332ca3d /src | |
| parent | e49a0d258101826154ac78887456042fe249f7cd (diff) | |
Generate a coredump on quit due to SIGSEGV
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.cc b/src/main.cc index 35fc86e4..608aefac 100644 --- a/src/main.cc +++ b/src/main.cc @@ -897,6 +897,12 @@ void signal_handler(int signal) if (signal == SIGTERM) exit(-1); + else if (signal == SIGSEGV) + { + // generate core dump + ::signal(SIGSEGV, SIG_DFL); + kill(getpid(), SIGSEGV); + } else abort(); } |
