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

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