]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #3895: helpers: added additional log in print_backtrace for debugging...
authorPRATEEK MOHAN PRABHU -X (pratepra - XORIANT CORPORATION at Cisco) <pratepra@cisco.com>
Mon, 10 Jul 2023 11:58:17 +0000 (11:58 +0000)
committerOleksii Shumeiko -X (oshumeik - SOFTSERVE INC at Cisco) <oshumeik@cisco.com>
Mon, 10 Jul 2023 11:58:17 +0000 (11:58 +0000)
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) <pratepra@cisco.com>
Date:   Wed Jun 28 12:44:25 2023 +0530

    helpers: added additional log in print_backtrace for debugging purpose

src/helpers/process.cc

index ae042bc757c2abc786b27babb2b8e2729fc0b828..a7b4c098b60f9135d56263842d853a2414a2f607 100644 (file)
@@ -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)