From: PRATEEK MOHAN PRABHU -X (pratepra - XORIANT CORPORATION at Cisco) Date: Mon, 10 Jul 2023 11:58:17 +0000 (+0000) Subject: Pull request #3895: helpers: added additional log in print_backtrace for debugging... X-Git-Tag: 3.1.66.0~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3de5c89edfc8d460e6cbfd2bd631abed01e304e;p=thirdparty%2Fsnort3.git Pull request #3895: helpers: added additional log in print_backtrace for debugging purpose Merge in SNORT/snort3 from ~PRATEPRA/snort3:crash_fix to master Squashed commit of the following: commit 35814367e25bb035806998c65d27ac8b3e3d1aaf Author: PRATEEK MOHAN PRABHU -X (pratepra - XORIANT CORPORATION at Cisco) Date: Wed Jun 28 12:44:25 2023 +0530 helpers: added additional log in print_backtrace for debugging purpose --- diff --git a/src/helpers/process.cc b/src/helpers/process.cc index ae042bc75..a7b4c098b 100644 --- a/src/helpers/process.cc +++ b/src/helpers/process.cc @@ -228,8 +228,10 @@ static void print_backtrace(SigSafePrinter& ssp) char sym[256]; unw_word_t offset; - if (unw_get_proc_name(&cursor, sym, sizeof(sym), &offset) == 0) + if ((ret = unw_get_proc_name(&cursor, sym, sizeof(sym), &offset)) == 0) ssp.printf(" in %s+0x%x", sym, offset); + else + ssp.printf(" unw_get_proc_name failed: %s (%d)", unw_strerror(ret), ret); Dl_info dlinfo; if (dladdr((void *)(uintptr_t)(pip.start_ip + offset), &dlinfo)