public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [patch] Fix a symbol_file_clear crash regression
@ 2010-04-26 14:51 Jan Kratochvil
  2010-04-27 17:33 ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kratochvil @ 2010-04-26 14:51 UTC (permalink / raw)
  To: gdb-patches

Hi,

there is a recent regression

 PASS: gdb.python/py-value.exp: kill the inferior
-PASS: gdb.python/py-value.exp: Discard the symbols
-PASS: gdb.python/py-value.exp: cast arg0 to PTR
-PASS: gdb.python/py-value.exp: delete PTR type
-PASS: gdb.python/py-value.exp: print value's type
+ERROR: Process no longer exists
+UNRESOLVED: gdb.python/py-value.exp: Discard the symbols
+ERROR: Couldn't send python castval = arg0.cast(ptrtype.pointer()) to GDB.
+UNRESOLVED: gdb.python/py-value.exp: cast arg0 to PTR
+ERROR: Couldn't send python ptrtype = None to GDB.
+UNRESOLVED: gdb.python/py-value.exp: delete PTR type
+ERROR: Couldn't send python print castval.type to GDB.
+UNRESOLVED: gdb.python/py-value.exp: print value's type
 PASS: gdb.python/py-value.exp: continue to breakpoint: break to inspect pointer by reference

by my
	Re: [patch] Fix dangling displays in separate debug
	http://sourceware.org/ml/gdb-patches/2010-04/msg00772.html

as reported by Phil Muldoon.

While I have regression tested it my script is ignoring various flipping
results and unfortunately the ignore rules were too vague and have not caught
this regression.

This bug was mostly unrelated to my dangling-displays patch and it mostly was
not a bug before as nobody was dereferencing objfile pointer that time.

No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu, checked without
the ignore rules.  There is just some problem with gdb.pascal/gdb11492.exp but
that is unrelated to this patch.

Added also a sanity check in free_all_objfiles.  The other possibility would be
to clear objfile from master_so_list when being freed by free_objfile (but that
would be quadratic).


Sorry,
Jan


2010-04-26  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* objfiles.c: Include solist.h.
	(free_all_objfiles): New variable so.  Check stale solist objfiles.
	* symfile.c (symbol_file_clear): Swap the order of free_all_objfiles
	and no_shared_libraries.

--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -53,6 +53,7 @@
 #include "observer.h"
 #include "complaints.h"
 #include "psymtab.h"
+#include "solist.h"
 
 /* Prototypes for local functions */
 
@@ -688,6 +689,11 @@ void
 free_all_objfiles (void)
 {
   struct objfile *objfile, *temp;
+  struct so_list *so;
+
+  /* Any objfile referencewould become stale.  */
+  for (so = master_so_list (); so; so = so->next)
+    gdb_assert (so->objfile == NULL);
 
   ALL_OBJFILES_SAFE (objfile, temp)
   {
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -1228,13 +1228,12 @@ symbol_file_clear (int from_tty)
 	  : !query (_("Discard symbol table? "))))
     error (_("Not confirmed."));
 
-  free_all_objfiles ();
-
-  /* solib descriptors may have handles to objfiles.  Since their
-     storage has just been released, we'd better wipe the solib
-     descriptors as well.  */
+  /* solib descriptors may have handles to objfiles.  Wipe them before their
+     objfiles get stale by free_all_objfiles.  */
   no_shared_libraries (NULL, from_tty);
 
+  free_all_objfiles ();
+
   gdb_assert (symfile_objfile == NULL);
   if (from_tty)
     printf_unfiltered (_("No symbol file now.\n"));

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] Fix a symbol_file_clear crash regression
  2010-04-26 14:51 [patch] Fix a symbol_file_clear crash regression Jan Kratochvil
@ 2010-04-27 17:33 ` Tom Tromey
  2010-04-27 20:07   ` Jan Kratochvil
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2010-04-27 17:33 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: gdb-patches

>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:

Jan> 2010-04-26  Jan Kratochvil  <jan.kratochvil@redhat.com>
Jan> 	* objfiles.c: Include solist.h.
Jan> 	(free_all_objfiles): New variable so.  Check stale solist objfiles.
Jan> 	* symfile.c (symbol_file_clear): Swap the order of free_all_objfiles
Jan> 	and no_shared_libraries.

This is ok.  Thanks.

Tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] Fix a symbol_file_clear crash regression
  2010-04-27 17:33 ` Tom Tromey
@ 2010-04-27 20:07   ` Jan Kratochvil
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Kratochvil @ 2010-04-27 20:07 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On Tue, 27 Apr 2010 19:32:51 +0200, Tom Tromey wrote:
> >>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:
> 
> Jan> 2010-04-26  Jan Kratochvil  <jan.kratochvil@redhat.com>
> Jan> 	* objfiles.c: Include solist.h.
> Jan> 	(free_all_objfiles): New variable so.  Check stale solist objfiles.
> Jan> 	* symfile.c (symbol_file_clear): Swap the order of free_all_objfiles
> Jan> 	and no_shared_libraries.
> 
> This is ok.  Thanks.

Checked-in:
	http://sourceware.org/ml/gdb-cvs/2010-04/msg00264.html


Sorry,
Jan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-04-27 20:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-26 14:51 [patch] Fix a symbol_file_clear crash regression Jan Kratochvil
2010-04-27 17:33 ` Tom Tromey
2010-04-27 20:07   ` Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).