Fix crash regression from the dlopen of libpthread.so fix (BZ 911712).

This commit is contained in:
Jan Kratochvil 2013-03-21 19:45:17 +01:00
parent d2a0d84101
commit 9929ad182e
2 changed files with 67 additions and 1 deletions

View File

@ -0,0 +1,60 @@
https://bugzilla.redhat.com/show_bug.cgi?id=911712
--- ./gdb/objfiles.c-orig 2013-03-21 18:51:00.141957331 +0100
+++ ./gdb/objfiles.c 2013-03-21 19:20:25.615519748 +0100
@@ -615,6 +615,7 @@ free_objfile (struct objfile *objfile)
obstack_free (&objfile->objfile_obstack, 0);
/* Rebuild section map next time we need it. */
+ gdb_assert (!get_objfile_pspace_data (objfile->pspace)->inhibit_updates);
get_objfile_pspace_data (objfile->pspace)->objfiles_changed_p = 1;
xfree (objfile);
@@ -1284,6 +1285,21 @@ bsearch_cmp (const void *key, const void
return 1;
}
+static void
+update_space_info_sections (struct objfile_pspace_info *pspace_info)
+{
+ if (pspace_info->objfiles_changed_p && !pspace_info->inhibit_updates)
+ {
+ update_section_map (current_program_space,
+ &pspace_info->sections,
+ &pspace_info->num_sections);
+
+ /* Don't need updates to section map until objfiles are added,
+ removed or relocated. */
+ pspace_info->objfiles_changed_p = 0;
+ }
+}
+
/* Returns a section whose range includes PC or NULL if none found. */
struct obj_section *
@@ -1298,16 +1314,7 @@ find_pc_section (CORE_ADDR pc)
return s;
pspace_info = get_objfile_pspace_data (current_program_space);
- if (pspace_info->objfiles_changed_p && !pspace_info->inhibit_updates)
- {
- update_section_map (current_program_space,
- &pspace_info->sections,
- &pspace_info->num_sections);
-
- /* Don't need updates to section map until objfiles are added,
- removed or relocated. */
- pspace_info->objfiles_changed_p = 0;
- }
+ update_space_info_sections (pspace_info);
/* The C standard (ISO/IEC 9899:TC2) requires the BASE argument to
bsearch be non-NULL. */
@@ -1471,6 +1478,7 @@ objfiles_changed (void)
void
inhibit_section_map_updates (void)
{
+ update_space_info_sections (get_objfile_pspace_data (current_program_space));
get_objfile_pspace_data (current_program_space)->inhibit_updates = 1;
}

View File

@ -34,7 +34,7 @@ Version: 7.5.1
# 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: 36%{?dist}
Release: 37%{?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
@ -511,6 +511,7 @@ Patch548: gdb-test-expr-cumulative-archer.patch
Patch579: gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch
# Fix dlopen of libpthread.so, patched glibc required (Gary Benson, BZ 669432).
# Fix crash regression from the dlopen of libpthread.so fix (BZ 911712).
#=push
Patch618: gdb-dlopen-stap-probe-1of7.patch
Patch717: gdb-dlopen-stap-probe-2of7.patch
@ -522,6 +523,7 @@ Patch722: gdb-dlopen-stap-probe-7of7.patch
Patch619: gdb-dlopen-stap-probe-test.patch
Patch723: gdb-dlopen-stap-probe-test2.patch
Patch822: gdb-dlopen-stap-probe-mapfailed.patch
Patch826: gdb-dlopen-stap-probe-inhibit.patch
# Work around PR libc/13097 "linux-vdso.so.1" warning message.
#=push
@ -909,6 +911,7 @@ find -name "*.info*"|xargs rm -f
%patch722 -p1
%patch723 -p1
%patch822 -p1
%patch826 -p1
%patch619 -p1
%patch627 -p1
%patch634 -p1
@ -1444,6 +1447,9 @@ fi
%endif # 0%{!?el5:1} || "%{_target_cpu}" == "noarch"
%changelog
* Thu Mar 21 2013 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.5.1-37.fc18
- Fix crash regression from the dlopen of libpthread.so fix (BZ 911712).
* Fri Feb 8 2013 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.5.1-36.fc18
- Re-enable PDF in gdb-doc after texinfo RH BZ 876710 has been fixed.