summaryrefslogtreecommitdiff
path: root/src/lib/eina/eina_debug_bt.c
diff options
context:
space:
mode:
authorJean Guyomarc'h <jean@guyomarch.bzh>2017-12-19 16:33:18 +0100
committerJean Guyomarc'h <jean@guyomarch.bzh>2017-12-19 16:56:22 +0100
commite835a02ebbba3ef721f44f19c2a6a0720123e9bc (patch)
tree84cc2620dd19af11c11678b1c4e95638f2652f46 /src/lib/eina/eina_debug_bt.c
parenta1e05aa0890faba20205a5c0f998f331a2ca4b24 (diff)
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
Diffstat (limited to '')
-rw-r--r--src/lib/eina/eina_debug_bt.c2
1 files changed, 1 insertions, 1 deletions
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)
67 offset = base = 0; 67 offset = base = 0;
68 // we have little choice but to hope/assume dladdr() doesn't alloc 68 // we have little choice but to hope/assume dladdr() doesn't alloc
69 // anything here 69 // anything here
70 if ((dladdr(bt[i], &info)) && (info.dli_fname[0])) 70 if ((dladdr(bt[i], &info)) && (info.dli_fname) && (info.dli_fname[0]))
71 { 71 {
72 offset = (unsigned long long)(uintptr_t)bt[i]; 72 offset = (unsigned long long)(uintptr_t)bt[i];
73 base = (unsigned long long)(uintptr_t)info.dli_fbase; 73 base = (unsigned long long)(uintptr_t)info.dli_fbase;