From 3e6361c4aaa3febdfa72f9031506babfcdc3b872 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Wed, 17 Apr 2013 19:10:47 -0700 Subject: [PATCH 1/1] TMP: improve debugging, remove print_trace() --- common.h | 2 +- snapshot.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common.h b/common.h index 367dc6b..62c16f4 100644 --- a/common.h +++ b/common.h @@ -29,7 +29,7 @@ void assert_hook(void); do { \ if (!(expr)) { \ fprintf(stderr, "Error: assertion failed in %s at line %d\n", __FILE__, __LINE__); \ - print_trace(); \ + /* print_trace(); // Trace printing may cause dynamic memory allocation */ \ assert_hook(); \ exit(EXIT_FAILURE); \ } \ diff --git a/snapshot.cc b/snapshot.cc index 1b5b4cb..e5df30a 100644 --- a/snapshot.cc +++ b/snapshot.cc @@ -106,10 +106,10 @@ mprot_snapshotter::~mprot_snapshotter() static void mprot_handle_pf(int sig, siginfo_t *si, void *unused) { if (si->si_code == SEGV_MAPERR) { - model_print("Real Fault at %p\n", si->si_addr); - print_trace(); + model_print("Segmentation fault at %p\n", si->si_addr); model_print("For debugging, place breakpoint at: %s:%d\n", __FILE__, __LINE__); + // print_trace(); // Trace printing may cause dynamic memory allocation exit(EXIT_FAILURE); } void* addr = ReturnPageAlignedAddress(si->si_addr); -- 2.34.1