Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Paul Pluzhnikov <ppluzhnikov@google.com>
Cc: Tom Tromey <tromey@redhat.com>, gdb-patches@sources.redhat.com
Subject: [patch] Fix a reread_symbols regression by mmap  [Re: [patch] Use 	mmap instead of obstack_alloc for dwarf debug   sections.]
Date: Tue, 23 Jun 2009 15:03:00 -0000	[thread overview]
Message-ID: <20090623150322.GA7654@host0.dyn.jankratochvil.net> (raw)
In-Reply-To: <8ac60eac0906161407s6498913cu5e50e930d599be77@mail.gmail.com>

Hi Paul,

while sure your patch is great it has a regression.  Assuming a regression
reproducer needs to link GDB with -lmcheck (but did verify it).

(I do not try to advocate reread_symbols but its code is there now.)


Thanks,
Jan


This patch will fix back (tested on {x86_64,i686}-fedora-linux-gnu):

-FAIL: gdb.ada/exec_changed.exp: start second
-dwarf2read.c:10943: internal-error: munmap_section_buffer: Assertion `munmap ((void *) map_begin, map_length) == 0' failed.^M
+PASS: gdb.ada/exec_changed.exp: start second

-FAIL: gdb.base/chng-syms.exp: (timeout) running with invalidated bpt condition after executable changes
-dwarf2read.c:10943: internal-error: munmap_section_buffer: Assertion `munmap ((void *) map_begin, map_length) == 0' failed.^M
+PASS: gdb.base/chng-syms.exp: running with invalidated bpt condition after executable changes

-FAIL: gdb.base/reread.exp: run to foo() second time (timeout)
-dwarf2read.c:10943: internal-error: munmap_section_buffer: Assertion `munmap ((void *) map_begin, map_length) == 0' failed.^M
-FAIL: gdb.base/reread.exp: shell mv /home/jkratoch/hammock/20090623build-gdbcvs/fedora-11-i386/build/src/gdb/testsuite.unix.-m32/gdb.base/reread /home/jkratoch/hammock/20090623build-gdbcvs/fedora-11-i386/build/src/gdb/testsuite.unix.-m32/gdb.base/reread2 (GDB internal error)
-ERROR: Could not resync from internal error (timeout)
-[more mess]
+PASS: gdb.base/reread.exp: run to foo() second time
+PASS: gdb.base/reread.exp: second pass: breakpoint foo in first file
+PASS: gdb.base/reread.exp: second pass: run to foo()
+PASS: gdb.base/reread.exp: second pass: continue to completion
+PASS: gdb.base/reread.exp: second pass: run to foo() second time
 
munmap(0x9595959595959000, 10778685752873425706) = -1 EINVAL (Invalid argument)
write(1, "dwarf2read.c:10943: internal-error: munmap_section_buffer: Assertion `munmap ((void *) map_begin, map_length) == 0' failed.\nA problem internal to GDB has been detected,\nfurther debugging may prove unre"..., 209) = 209


2009-06-23  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Fix a regression by the mmap patch from 2009-06-16.
	* symfile.c (reread_symbols): Move sym_finish and clear_objfile_data
	calls before deleting the OBJFILE obstack.  Extend the comment.

--- gdb/symfile.c	17 Jun 2009 18:34:34 -0000	1.232
+++ gdb/symfile.c	23 Jun 2009 14:56:34 -0000
@@ -2334,7 +2334,16 @@ reread_symbols (void)
 
 	      /* Nuke all the state that we will re-read.  Much of the following
 	         code which sets things to NULL really is necessary to tell
-	         other parts of GDB that there is nothing currently there.  */
+	         other parts of GDB that there is nothing currently there.
+		 
+		 Try to keep the freeing order compatible with free_objfile.  */
+
+	      if (objfile->sf != NULL)
+		{
+		  (*objfile->sf->sym_finish) (objfile);
+		}
+
+	      clear_objfile_data (objfile);
 
 	      /* FIXME: Do we have to free a whole linked list, or is this
 	         enough?  */
@@ -2371,11 +2380,6 @@ reread_symbols (void)
 		      sizeof (objfile->msymbol_hash));
 	      memset (&objfile->msymbol_demangled_hash, 0,
 		      sizeof (objfile->msymbol_demangled_hash));
-	      clear_objfile_data (objfile);
-	      if (objfile->sf != NULL)
-		{
-		  (*objfile->sf->sym_finish) (objfile);
-		}
 
 	      objfile->psymbol_cache = bcache_xmalloc ();
 	      objfile->macro_cache = bcache_xmalloc ();


  parent reply	other threads:[~2009-06-23 15:03 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-27  0:12 [patch] Use mmap instead of obstack_alloc for dwarf debug sections Paul Pluzhnikov
2009-05-28  1:16 ` Tom Tromey
2009-05-28 16:57   ` Paul Pluzhnikov
2009-05-30 22:36     ` Tom Tromey
2009-06-11  1:40       ` Paul Pluzhnikov
2009-06-11  1:43         ` Paul Pluzhnikov
2009-06-16 19:19           ` Tom Tromey
2009-06-16 20:43             ` Paul Pluzhnikov
2009-06-16 20:59               ` Tom Tromey
2009-06-16 21:07                 ` Paul Pluzhnikov
2009-06-18  9:20                   ` Ken Werner
2009-06-18 14:06                     ` Paul Pluzhnikov
2009-06-18 14:11                       ` Paul Pluzhnikov
2009-06-18 15:02                       ` Ken Werner
2009-06-18 16:33                         ` Paul Pluzhnikov
2009-06-19  7:10                           ` Ken Werner
2009-06-23 15:03                   ` Jan Kratochvil [this message]
2009-06-23 17:35                     ` [patch] Fix a reread_symbols regression by mmap [Re: [patch] Use mmap instead of obstack_alloc for dwarf debug sections.] Paul Pluzhnikov
2009-06-23 18:08                     ` Tom Tromey
2009-06-23 18:21                       ` Jan Kratochvil
2009-06-23 20:00                         ` Tom Tromey
2009-06-25 19:21                           ` [patch] Replace reread_symbols by load+free calls Jan Kratochvil
2009-06-25 19:57                             ` Pedro Alves
2009-06-25 23:25                               ` Jan Kratochvil
2009-08-02 21:04                                 ` cancelled: " Jan Kratochvil
2009-08-14 23:09                             ` Tom Tromey
2009-08-14 23:12                               ` Pedro Alves
2009-08-17 15:41                                 ` Tom Tromey
2011-12-18 11:54                                 ` Jan Kratochvil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090623150322.GA7654@host0.dyn.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=ppluzhnikov@google.com \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox