Blame SOURCES/rhbz1795196.patch

e5a588
commit 6053cecf4a4ffd19d1ac0a3bb3ffef100ab83fda
e5a588
Author: Frank Ch. Eigler <fche@redhat.com>
e5a588
Date:   Tue Jan 28 15:48:42 2020 -0500
e5a588
e5a588
    RHBZ1795196: tolerate partial elf + missing dwarf vmlinuz for -d kernel
e5a588
    
e5a588
    Previous code in dump_symbol_tables() couldn't tolerate the case where
e5a588
    new elfutils opened /boot/vmlinuz* as an elf file for the kernel, and
e5a588
    could not extract a symbol table from that (nor an absent -debuginfo).
e5a588
    New code instead emits a warning and moves on.  A special error code
e5a588
    triggers return to the dump_kallsyms() path that prior elfutils/stap
e5a588
    versions rely on.
e5a588
e5a588
diff --git a/testsuite/systemtap.base/kallsyms.exp b/testsuite/systemtap.base/kallsyms.exp
e5a588
index 8ee5242..13ca4ad 100644
e5a588
--- a/testsuite/systemtap.base/kallsyms.exp
e5a588
+++ b/testsuite/systemtap.base/kallsyms.exp
e5a588
@@ -5,7 +5,10 @@ if {![installtest_p]} {untested $test; return}
e5a588
 set script {"probe timer.profile {print_stack(backtrace()); exit()}"}
e5a588
 set passed 0
e5a588
 
e5a588
+# don't let stap find kernel debuginfo!
e5a588
 setenv SYSTEMTAP_DEBUGINFO_PATH $srcdir
e5a588
+setenv DEBUGINFOD_URLS ""
e5a588
+setenv DEBUGINFOD_CACHE_PATH "/dev/null"
e5a588
 
e5a588
 eval spawn stap --all-modules -e $script
e5a588
 expect {
e5a588
diff --git a/translate.cxx b/translate.cxx
e5a588
index f142667..9e30427 100644
e5a588
--- a/translate.cxx
e5a588
+++ b/translate.cxx
e5a588
@@ -6786,7 +6786,17 @@ dump_symbol_tables (Dwfl_Module *m,
e5a588
   dwfl_module_info (m, NULL, NULL, &end, NULL, NULL, NULL, NULL);
e5a588
 
e5a588
   int syments = dwfl_module_getsymtab(m);
e5a588
-  DWFL_ASSERT (_F("Getting symbol table for %s", modname), syments >= 0);
e5a588
+  if (syments < 0) // RHBZ1795196: elfutils 0.178+ can open vmlinuz as elf.main but fail here
e5a588
+    {
e5a588
+      c->session.print_warning(_F("libdwfl failure getting symbol table for %s: %s",
e5a588
+                                  modname, dwfl_errmsg(-1)));
e5a588
+      return DWARF_CB_ABORT;
e5a588
+
e5a588
+      // signal to dump_unwindsyms() to not let things proceed all the way to
e5a588
+      // dump_unwindsym_cxt(), which then believes it has all the info for a
e5a588
+      // complete record about this module.  In the kernel's case, this allows
e5a588
+      // PR17921 fallback to /proc/kallsyms via dump_kallsyms().
e5a588
+    }
e5a588
 
e5a588
   // Look up the relocation basis for symbols
e5a588
   int n = dwfl_module_relocations (m);
e5a588
commit 3d571c2ab5797b41d07b51a7bbff626270d1e263
e5a588
Author: Craig Ringer <craig.ringer@2ndquadrant.com>
e5a588
Date:   Sun Dec 29 14:51:47 2019 -0500
e5a588
e5a588
    PR25265: fix strict-prototypes nit autoconf-stack-trace-save-regs.c
e5a588
e5a588
diff --git a/runtime/linux/autoconf-stack-trace-save-regs.c b/runtime/linux/autoconf-stack-trace-save-regs.c
e5a588
index 8bf3339..1fd515f 100644
e5a588
--- a/runtime/linux/autoconf-stack-trace-save-regs.c
e5a588
+++ b/runtime/linux/autoconf-stack-trace-save-regs.c
e5a588
@@ -1,6 +1,6 @@
e5a588
 #include <linux/stacktrace.h>
e5a588
 
e5a588
-unsigned int foo ()
e5a588
+unsigned int foo (void)
e5a588
 {
e5a588
         unsigned long e[10];
e5a588
         struct pt_regs* r = 0;