jayji pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=e835a02ebbba3ef721f44f19c2a6a0720123e9bc

commit e835a02ebbba3ef721f44f19c2a6a0720123e9bc
Author: Jean Guyomarc'h <[email protected]>
Date:   Tue Dec 19 16:33:18 2017 +0100

    eina: fix random segfaults when displaying BT
    
    Under some circumstances, eina crashes when attempting to display the
    backtrace, because dladdr() may yield a dli_fname that is NULL. This is
    especially annoying in realease, when the backtrace is shown by default
    when CRI/ERR are thrown.
    
    @fix
---
 src/lib/eina/eina_debug_bt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/eina/eina_debug_bt.c b/src/lib/eina/eina_debug_bt.c
index c9bf23c541..21b067c395 100644
--- a/src/lib/eina/eina_debug_bt.c
+++ b/src/lib/eina/eina_debug_bt.c
@@ -67,7 +67,7 @@ _eina_debug_dump_fhandle_bt(FILE *f, void **bt, int btlen)
         offset = base = 0;
         // we have little choice but to hope/assume dladdr() doesn't alloc
         // anything here
-        if ((dladdr(bt[i], &info)) && (info.dli_fname[0]))
+        if ((dladdr(bt[i], &info)) && (info.dli_fname) && (info.dli_fname[0]))
           {
              offset = (unsigned long long)(uintptr_t)bt[i];
              base = (unsigned long long)(uintptr_t)info.dli_fbase;

-- 


Reply via email to