From 643a5154fb1e90725c6d102d83f47eb311f353bc Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Thu, 13 Sep 2012 14:47:44 -0700 Subject: [PATCH] snapshot: print stack trace on segfault --- snapshot.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/snapshot.cc b/snapshot.cc index 95a6593..b7e4ec1 100644 --- a/snapshot.cc +++ b/snapshot.cc @@ -17,6 +17,8 @@ #include #include +#include "common.h" + #define FAILURE(mesg) { printf("failed in the API: %s with errno relative message: %s\n", mesg, strerror( errno ) ); exit(EXIT_FAILURE); } #ifdef CONFIG_SSDEBUG @@ -86,6 +88,7 @@ static void initSnapShotRecord(unsigned int numbackingpages, unsigned int numsna static void HandlePF( int sig, siginfo_t *si, void * unused){ if( si->si_code == SEGV_MAPERR ){ printf("Real Fault at %p\n", si->si_addr); + print_trace(); exit( EXIT_FAILURE ); } void* addr = ReturnPageAlignedAddress(si->si_addr); -- 2.34.1