From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8417 invoked by alias); 18 Sep 2009 16:16:04 -0000 Received: (qmail 8408 invoked by uid 22791); 18 Sep 2009 16:16:03 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 18 Sep 2009 16:15:58 +0000 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8IGFt0u016894 for ; Fri, 18 Sep 2009 12:15:56 -0400 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n8IGFpKO011066 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 18 Sep 2009 12:15:54 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.3/8.14.3) with ESMTP id n8IGFpGU030673 for ; Fri, 18 Sep 2009 18:15:51 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.3/8.14.3/Submit) id n8IGFoEB030672 for gdb-patches@sourceware.org; Fri, 18 Sep 2009 18:15:50 +0200 Date: Fri, 18 Sep 2009 16:16:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Subject: [patch] Crash with -lmcheck && --enable-targets=all(spu) Message-ID: <20090918161550.GA30667@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-09/txt/msg00598.txt.bz2 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 , 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 , 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 * 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")); }