diff --git a/src/gvmd.c b/src/gvmd.c index 5494e4c8e..ccf4656a4 100644 --- a/src/gvmd.c +++ b/src/gvmd.c @@ -966,7 +966,7 @@ handle_sigabrt (int given_signal) frame_count = 0; } for (index = 0; index < frame_count; index++) - g_debug ("%s", frames_text[index]); + g_debug ("BACKTRACE: %s", frames_text[index]); free (frames_text); #endif @@ -998,6 +998,24 @@ handle_termination_signal (int signal) static void handle_sigsegv (/* unused */ int given_signal) { +#ifndef NDEBUG + void *frames[BA_SIZE]; + int frame_count, index; + char **frames_text; + + /* Print a backtrace. */ + frame_count = backtrace (frames, BA_SIZE); + frames_text = backtrace_symbols (frames, frame_count); + if (frames_text == NULL) + { + perror ("backtrace symbols"); + frame_count = 0; + } + for (index = 0; index < frame_count; index++) + g_debug ("BACKTRACE: %s", frames_text[index]); + free (frames_text); +#endif + manage_cleanup_process_error (given_signal); /* This previously called "cleanup", but it seems that the regular manager