public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/gdb] gdb-17.2-rebase-f44: Fix loading of core files without build-ids but with build-ids in executables.
@ 2026-06-27 23:55 Jan Kratochvil
  0 siblings, 0 replies; only message in thread
From: Jan Kratochvil @ 2026-06-27 23:55 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/gdb
Branch : gdb-17.2-rebase-f44
Commit : 3d3c8f2d4ae2755aabc201c7c98ac68434689777
Author : Jan Kratochvil <jan.kratochvil@redhat.com>
Date   : 2012-03-17T12:41:20+01:00
Stats  : +65/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/gdb/c/3d3c8f2d4ae2755aabc201c7c98ac68434689777?branch=gdb-17.2-rebase-f44

Log:
Fix loading of core files without build-ids but with build-ids in executables.

---
diff --git a/gdb-6.6-buildid-locate-solib-missing-ids.patch b/gdb-6.6-buildid-locate-solib-missing-ids.patch
new file mode 100644
index 0000000..9a6a15e
--- /dev/null
+++ b/gdb-6.6-buildid-locate-solib-missing-ids.patch
@@ -0,0 +1,57 @@
+--- gdb-7.4.50.20120120/gdb/solib-svr4.c.orig	2012-03-17 10:23:11.000000000 +0100
++++ gdb-7.4.50.20120120/gdb/solib-svr4.c	2012-03-17 10:36:22.265628529 +0100
+@@ -1228,14 +1228,27 @@ svr4_read_so_list (CORE_ADDR lm, struct
+ 	}
+ 
+       {
+-	struct build_id *build_id;
++	struct build_id *build_id = NULL;
+ 
+ 	strncpy (new->so_original_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
+ 	new->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
+ 	/* May get overwritten below.  */
+ 	strcpy (new->so_name, new->so_original_name);
+ 
+-	build_id = build_id_addr_get (new->lm_info->l_ld);
++	/* In the case the main executable was found according to its build-id
++	   (from a core file) prevent loading a different build of a library
++	   with accidentally the same SO_NAME.
++
++	   It suppresses bogus backtraces (and prints "??" there instead) if
++	   the on-disk files no longer match the running program version.
++
++	   If the main executable was not loaded according to its build-id do
++	   not do any build-id checking of the libraries.  There may be missing
++	   build-ids dumped in the core file and we would map all the libraries
++	   to the only existing file loaded that time - the executable.  */
++	if (symfile_objfile != NULL
++	    && (symfile_objfile->flags & OBJF_BUILD_ID_CORE_LOADED) != 0)
++	  build_id = build_id_addr_get (new->lm_info->l_ld);
+ 	if (build_id != NULL)
+ 	  {
+ 	    char *name, *build_id_filename;
+@@ -1250,23 +1263,7 @@ svr4_read_so_list (CORE_ADDR lm, struct
+ 		xfree (name);
+ 	      }
+ 	    else
+-	      {
+-		debug_print_missing (new->so_name, build_id_filename);
+-
+-		/* In the case the main executable was found according to
+-		   its build-id (from a core file) prevent loading
+-		   a different build of a library with accidentally the
+-		   same SO_NAME.
+-
+-		   It suppresses bogus backtraces (and prints "??" there
+-		   instead) if the on-disk files no longer match the
+-		   running program version.  */
+-
+-		if (symfile_objfile != NULL
+-		    && (symfile_objfile->flags
+-			& OBJF_BUILD_ID_CORE_LOADED) != 0)
+-		  new->so_name[0] = 0;
+-	      }
++	      debug_print_missing (new->so_name, build_id_filename);
+ 
+ 	    xfree (build_id_filename);
+ 	    xfree (build_id);

diff --git a/gdb.spec b/gdb.spec
index a275a41..251914b 100644
--- a/gdb.spec
+++ b/gdb.spec
@@ -33,7 +33,7 @@ Version: 7.4.50.%{snap}
 
 # The release always contains a leading reserved number, start it at 1.
 # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
-Release: 31%{?dist}
+Release: 32%{?dist}
 
 License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain
 Group: Development/Debuggers
@@ -299,6 +299,9 @@ Patch271: gdb-6.5-bz243845-stale-testing-zombie-test.patch
 # New locating of the matching binaries from the pure core file (build-id).
 #=push
 Patch274: gdb-6.6-buildid-locate.patch
+# Fix loading of core files without build-ids but with build-ids in executables.
+#=push
+Patch659: gdb-6.6-buildid-locate-solib-missing-ids.patch
 #=push
 Patch353: gdb-6.6-buildid-locate-rpm.patch
 #=push
@@ -786,6 +789,7 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
 %patch263 -p1
 %patch271 -p1
 %patch274 -p1
+%patch659 -p1
 %patch353 -p1
 %patch276 -p1
 %patch282 -p1
@@ -1325,6 +1329,9 @@ fi
 %endif # 0%{!?el5:1} || "%{_target_cpu}" == "noarch"
 
 %changelog
+* Sat Mar 17 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.4.50.20120120-32.fc17
+- Fix loading of core files without build-ids but with build-ids in executables.
+
 * Fri Mar  9 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.4.50.20120120-31.fc17
 - Fix an implied regression by the inferior calls fix below (BZ 799531).
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-27 23:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-27 23:55 [rpms/gdb] gdb-17.2-rebase-f44: Fix loading of core files without build-ids but with build-ids in executables Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox