Skip to content

Commit

Permalink
Log crashes from the signal handler.
Browse files Browse the repository at this point in the history
  • Loading branch information
dashea committed Sep 25, 2015
1 parent b4026da commit c800cd0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pyanaconda/isys/isys.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <syslog.h>

static PyObject * doSignalHandlers(PyObject *s, PyObject *args);
static PyObject * doSetSystemTime(PyObject *s, PyObject *args);
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit c800cd0

Please sign in to comment.