Commit b0c964b2 authored by Jean Guyomarc'h's avatar Jean Guyomarc'h Committed by Carsten Haitzler (Rasterman)

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
parent 73b5982a
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment