[PATCH] gdb: Fix an assertion failure in the dw2_find_pc_sect_compunit_symtab()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a backported patch from gdb. Without the patch, the "dis -rl"
command may abort due to an assertion failure in the gdb's
dw2_find_pc_sect_compunit_symtab():

  crash> dis -rl ffffffff96ad716c
  dwarf2/read.c:4928: internal-error: compunit_symtab* dw2_find_pc_sect_compunit_symtab(objfile*, bound_minimal_symbol, CORE_ADDR, obj_section*, int): Assertion `result != NULL' failed.
  A problem internal to GDB has been detected,
  further debugging may prove unreliable.
  Quit this debugging session? (y or n) dwarf2/read.c:4928: internal-error: compunit_symtab* dw2_find_pc_sect_compunit_symtab(objfile*, bound_minimal_symbol, CORE_ADDR, obj_section*, int): Assertion `result != NULL' failed.
  A problem internal to GDB has been detected,
  further debugging may prove unreliable.
  Aborted (core dumped)

The gdb commit 834eaf9201c1 ("Fix crash in new DWARF indexer")
solved the current issue.

Reported-by: Buland Kumar Singh <bsingh@xxxxxxxxxx>
Signed-off-by: Lianbo Jiang <lijiang@xxxxxxxxxx>
---
 gdb-10.2.patch | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/gdb-10.2.patch b/gdb-10.2.patch
index aa34743501ad..d762680eb472 100644
--- a/gdb-10.2.patch
+++ b/gdb-10.2.patch
@@ -12,7 +12,8 @@ tar xvzmf gdb-10.2.tar.gz \
 	gdb-10.2/gdb/symtab.c \
 	gdb-10.2/gdb/printcmd.c \
 	gdb-10.2/gdb/symfile.c \
-	gdb-10.2/gdb/Makefile.in
+	gdb-10.2/gdb/Makefile.in \
+	gdb-10.2/gdb/dwarf2/read.c
 
 exit 0
 
@@ -2078,3 +2079,16 @@ exit 0
  
    return new_type;
  }
+--- gdb-10.2/gdb/dwarf2/read.c.orig
++++ gdb-10.2/gdb/dwarf2/read.c
+@@ -4925,7 +4925,10 @@ dw2_find_pc_sect_compunit_symtab (struct objfile *objfile,
+   result = recursively_find_pc_sect_compunit_symtab
+     (dw2_instantiate_symtab (data, per_objfile, false), pc);
+ 
+-  gdb_assert (result != NULL);
++  if (warn_if_readin && result == nullptr)
++    warning (_("(Error: pc %s in address map, but not in symtab.)"),
++            paddress (objfile->arch (), pc));
++
+   return result;
+ }
-- 
2.37.1

--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/crash-utility
Contribution Guidelines: https://github.com/crash-utility/crash/wiki




[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux