From: Rafal Pietruch Date: Fri, 30 Dec 2016 07:38:29 +0000 (+0100) Subject: crash-stack: disable unw_get_proc_name prediction X-Git-Tag: accepted/tizen/3.0/common/20170222.125537~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=098709a003f000075227c92348cd8c54b5439112;p=platform%2Fcore%2Fsystem%2Fcrash-worker.git crash-stack: disable unw_get_proc_name prediction libunwind unw_get_proc_name function may return the name of a label or a preceeding, nearby procedure; although the value of the returned name plus the returned offset will be equal to the instruction-pointer of the stack frame, developers can find a exact symbol with related code position in debug packages Change-Id: I2471c2a9483b577844110f25128a6d539d39e5ad --- diff --git a/src/crash-stack/crash-stack-libunw.c b/src/crash-stack/crash-stack-libunw.c index f013e63..b9b9c35 100644 --- a/src/crash-stack/crash-stack-libunw.c +++ b/src/crash-stack/crash-stack-libunw.c @@ -23,8 +23,6 @@ #include "crash-stack.h" #include -#include - #define MAXPROCNAMELEN 512 void _create_crash_stack(Dwfl *dwfl, Elf *core, pid_t pid, Mappings *mappings, Callstack *callstack) @@ -59,10 +57,8 @@ void _create_crash_stack(Dwfl *dwfl, Elf *core, pid_t pid, Mappings *mappings, C proc_name[0] = '\0'; unw_word_t off; - unw_get_proc_name(&cursor, proc_name, sizeof(proc_name), &off); - if (strlen(proc_name) > 0) - callstack->proc[callstack->elems].name = strdup(proc_name); - callstack->proc[callstack->elems].offset = off; + if (unw_get_proc_name(&cursor, proc_name, sizeof(proc_name), &off) == 0) + callstack->proc[callstack->elems].offset = off; if (unw_step(&cursor) <= 0) break;