freeze();
}
-_noreturn_ static void crash(int sig) {
+_noreturn_ static void crash(int sig, siginfo_t *siginfo, void *context) {
struct sigaction sa;
pid_t pid;
siginfo_t status;
int r;
+ if (siginfo) {
+ _cleanup_free_ char *cmdline = NULL;
+ pid_t sender_pid = siginfo->si_pid;
+
+ (void) get_process_cmdline(sender_pid, SIZE_MAX, 0, &cmdline);
+ log_emergency("Caught <%s> from PID "PID_FMT" (%s)", signal_to_string(sig), sender_pid, strna(cmdline));
+ }
+
/* Order things nicely. */
r = wait_for_terminate(pid, &status);
if (r < 0)
static void install_crash_handler(void) {
static const struct sigaction sa = {
- .sa_handler = crash,
- .sa_flags = SA_NODEFER, /* So that we can raise the signal again from the signal handler */
+ .sa_sigaction = crash,
+ .sa_flags = SA_NODEFER | SA_SIGINFO, /* So that we can raise the signal again from the signal handler */
};
int r;