Blame SOURCES/satyr-0.13-core_unwind-fix-the-missing-frame-build_id-and-file.patch

f41043
From d34232858880672a9e6b88ff5ebd966969aabb9f Mon Sep 17 00:00:00 2001
f41043
From: Jakub Filak <jfilak@redhat.com>
f41043
Date: Mon, 7 Sep 2015 08:08:16 +0200
f41043
Subject: [PATCH] core_unwind: fix the missing frame build_id and file_name
f41043
f41043
The documentation of dwfl_module_build_id() says:
f41043
f41043
  This returns 0 when the module's main ELF file has not yet been loaded
f41043
  and its build ID bits were not reported.  To ensure the ID is always
f41043
  returned when determinable, call dwfl_module_getelf first.
f41043
f41043
  /usr/include/elfutils/libdwfl.h
f41043
f41043
ABRT upstream commit 88c6b3683a129c0e369071204b29fbca94772d3b verifies
f41043
this patch.
f41043
f41043
Discovered by Richard Marko <rmarko@redhat.com>
f41043
Resolved by Mark Wielaard <mjw@redhat.com>
f41043
f41043
Related: #1210599
f41043
f41043
Signed-off-by: Jakub Filak <jfilak@redhat.com>
f41043
---
f41043
 lib/core_unwind.c | 7 ++++++-
f41043
 1 file changed, 6 insertions(+), 1 deletion(-)
f41043
f41043
diff --git a/lib/core_unwind.c b/lib/core_unwind.c
f41043
index cf9973a..c30f9db 100644
f41043
--- a/lib/core_unwind.c
f41043
+++ b/lib/core_unwind.c
f41043
@@ -278,9 +278,14 @@ resolve_frame(Dwfl *dwfl, Dwarf_Addr ip, bool minus_one)
f41043
         int ret;
f41043
         const unsigned char *build_id_bits;
f41043
         const char *filename, *funcname;
f41043
-        GElf_Addr bid_addr;
f41043
+        GElf_Addr bias, bid_addr;
f41043
         Dwarf_Addr start;
f41043
 
f41043
+        /* Initialize the module's main Elf for dwfl_module_build_id and dwfl_module_info */
f41043
+        /* No need to deallocate the variable 'bias' and the return value.*/
f41043
+        if (NULL == dwfl_module_getelf(mod, &bias))
f41043
+            warn("The module's main Elf was not found");
f41043
+
f41043
         ret = dwfl_module_build_id(mod, &build_id_bits, &bid_addr);
f41043
         if (ret > 0)
f41043
         {
f41043
-- 
f41043
2.4.3
f41043