Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch] Crash with -lmcheck && --enable-targets=all(spu)
@ 2009-09-18 16:16 Jan Kratochvil
  2009-09-18 17:27 ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kratochvil @ 2009-09-18 16:16 UTC (permalink / raw)
  To: gdb-patches

Hi,

CFLAGS="-O0 -g" LDFLAGS="-lmcheck" ./configure --enable-targets=all; make; ./gdb/gdb -nx -ex r -ex bt --args ./gdb/gdb -nx -ex 'set confirm no' -ex start -ex symbol ./gdb/gdb

Program received signal SIGSEGV, Segmentation fault.
0x0000000000860ab6 in bfd_get_arch (abfd=0x9595959595959595) at ./archures.c:838
838       return abfd->arch_info->arch;
#0  0x0000000000860ab6 in bfd_get_arch (abfd=0x9595959595959595) at ./archures.c:838
#1  0x00000000005437d1 in spu_multiarch_solib_unloaded (so=0x20f2e30) at spu-multiarch.c:347
#2  0x0000000000479690 in observer_solib_unloaded_notification_stub (data=0x543796, args_data=0x7fffffffcf70) at observer.inc:227
#3  0x00000000004791a2 in generic_observer_notify (subject=0x1be0a10, args=0x7fffffffcf70) at observer.c:166
#4  0x0000000000479722 in observer_notify_solib_unloaded (solib=0x20f2e30) at observer.inc:252
#5  0x00000000007162cd in clear_solib () at solib.c:986
#6  0x00000000007163be in no_shared_libraries (ignored=0x0, from_tty=0) at solib.c:1081
#7  0x000000000062f899 in symbol_file_clear (from_tty=0) at symfile.c:1151
#8  0x000000000063037e in symbol_file_command (args=0x0, from_tty=0) at symfile.c:1478
#9  0x00000000005b50fd in do_cfunc (c=0x1be3100, args=0x0, from_tty=0) at ./cli/cli-decode.c:67
#10 0x00000000005b8056 in cmd_func (cmd=0x1be3100, args=0x0, from_tty=0) at ./cli/cli-decode.c:1738
#11 0x000000000047d5d8 in execute_command (p=0x7fffffffd7b1 "", from_tty=1) at top.c:453
#12 0x0000000000654e76 in catch_command_errors (command=0x47d343 <execute_command>, arg=0x7fffffffd7ab "symbol", from_tty=1, mask=6) at exceptions.c:525
#13 0x00000000004749e4 in captured_main (data=0x7fffffffd330) at ./main.c:861
#14 0x0000000000654dd3 in catch_errors (func=0x473a3b <captured_main>, func_args=0x7fffffffd330, errstring=0xceb307 "", mask=6) at exceptions.c:510
#15 0x0000000000474b3d in gdb_main (args=0x7fffffffd330) at ./main.c:911
#16 0x0000000000473716 in main (argc=9, argv=0x7fffffffd438) at gdb.c:33

No regressions on {x86_64,x86_64-m32}-fedora11-linux-gnu.

The fix should go also to the 7.0 branch.

I already found the comment as confusing ("mark it unallocated") + excessive.


Thanks,
Jan


2009-09-18  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* objfiles.c (free_objfile): Clear SYMFILE_OBJFILE if it is OBJFILE.
	* rs6000-nat.c (vmap_ldinfo): Only assertion check SYMFILE_OBJFILE now.
	* symfile.c (syms_from_objfile, symbol_file_clear): Likewise.

--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -459,8 +459,8 @@ free_objfile (struct objfile *objfile)
 
   unlink_objfile (objfile);
 
-  /* If we are going to free the runtime common objfile, mark it
-     as unallocated.  */
+  if (objfile == symfile_objfile)
+    symfile_objfile = NULL;
 
   if (objfile == rt_common_objfile)
     rt_common_objfile = NULL;
--- a/gdb/rs6000-nat.c
+++ b/gdb/rs6000-nat.c
@@ -915,7 +915,7 @@ If in fact that file has symbols which the mapped files listed by\n\
 symbols to the proper address)."),
 	       symfile_objfile->name);
       free_objfile (symfile_objfile);
-      symfile_objfile = NULL;
+      gdb_assert (symfile_objfile == NULL);
     }
   breakpoint_re_set ();
 }
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -786,7 +786,7 @@ syms_from_objfile (struct objfile *objfile,
       if (symfile_objfile != NULL)
 	{
 	  free_objfile (symfile_objfile);
-	  symfile_objfile = NULL;
+	  gdb_assert (symfile_objfile == NULL);
 	}
 
       /* Currently we keep symbols from the add-symbol-file command.
@@ -1150,7 +1150,7 @@ symbol_file_clear (int from_tty)
      descriptors as well.  */
   no_shared_libraries (NULL, from_tty);
 
-  symfile_objfile = NULL;
+  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] Crash with -lmcheck && --enable-targets=all(spu)
  2009-09-18 16:16 [patch] Crash with -lmcheck && --enable-targets=all(spu) Jan Kratochvil
@ 2009-09-18 17:27 ` Tom Tromey
  2009-09-18 17:42   ` Jan Kratochvil
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2009-09-18 17:27 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: gdb-patches

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

Jan> 2009-09-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
Jan> 	* objfiles.c (free_objfile): Clear SYMFILE_OBJFILE if it is OBJFILE.
Jan> 	* rs6000-nat.c (vmap_ldinfo): Only assertion check SYMFILE_OBJFILE now.
Jan> 	* symfile.c (syms_from_objfile, symbol_file_clear): Likewise.

This is ok.

Tom


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

* Re: [patch] Crash with -lmcheck && --enable-targets=all(spu)
  2009-09-18 17:27 ` Tom Tromey
@ 2009-09-18 17:42   ` Jan Kratochvil
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Kratochvil @ 2009-09-18 17:42 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches, Ulrich Weigand

On Fri, 18 Sep 2009 19:26:49 +0200, Tom Tromey wrote:
> >>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:
> 
> Jan> 2009-09-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
> Jan> 	* objfiles.c (free_objfile): Clear SYMFILE_OBJFILE if it is OBJFILE.
> Jan> 	* rs6000-nat.c (vmap_ldinfo): Only assertion check SYMFILE_OBJFILE now.
> Jan> 	* symfile.c (syms_from_objfile, symbol_file_clear): Likewise.
> 
> This is ok.

Checked-in:
	http://sourceware.org/ml/gdb-cvs/2009-09/msg00107.html
	http://sourceware.org/ml/gdb-cvs/2009-09/msg00108.html (gdb_7_0-branch)


Thanks,
Jan


FYI updated ChangeLog there:

-2009-09-19  Ulrich Weigand  <uweigand@de.ibm.com>
+2009-09-18  Ulrich Weigand  <uweigand@de.ibm.com>


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

end of thread, other threads:[~2009-09-18 17:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-18 16:16 [patch] Crash with -lmcheck && --enable-targets=all(spu) Jan Kratochvil
2009-09-18 17:27 ` Tom Tromey
2009-09-18 17:42   ` Jan Kratochvil

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