From c800cd02d781f98deb1652a7a1dd5ef2de92fb43 Mon Sep 17 00:00:00 2001 From: David Shea Date: Thu, 24 Sep 2015 16:53:35 -0400 Subject: [PATCH] Log crashes from the signal handler. --- pyanaconda/isys/isys.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pyanaconda/isys/isys.c b/pyanaconda/isys/isys.c index 6cbadf20f99..76ec39fa622 100644 --- a/pyanaconda/isys/isys.c +++ b/pyanaconda/isys/isys.c @@ -30,6 +30,7 @@ #include #include #include +#include static PyObject * doSignalHandlers(PyObject *s, PyObject *args); static PyObject * doSetSystemTime(PyObject *s, PyObject *args); @@ -102,6 +103,13 @@ static void sync_signal_handler(int signum) { size = backtrace (array, 20); backtrace_symbols_fd(array, size, STDOUT_FILENO); + /* Log the crash. Hopefully this is happening after logging has started + * and livemedia-creator will get the message. */ + openlog("anaconda", 0, LOG_USER); + syslog(LOG_CRIT, "Anaconda crashed on signal %d", signum); + closelog(); + + /* Try call gcore on ourself to write out a core file */ pid_size = snprintf(NULL, 0, "%d", getpid()); if (pid_size <= 0) {