From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3039 invoked by alias); 5 Apr 2011 08:51:38 -0000 Received: (qmail 3021 invoked by uid 22791); 5 Apr 2011 08:51:36 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_BJ,T_RP_MATCHES_RCVD 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; Tue, 05 Apr 2011 08:51:31 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p358pU0C020247 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 5 Apr 2011 04:51:31 -0400 Received: from host1.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p358pSwZ013419 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 5 Apr 2011 04:51:30 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p358pSWd029686; Tue, 5 Apr 2011 10:51:28 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p358pS2Q029685; Tue, 5 Apr 2011 10:51:28 +0200 Date: Tue, 05 Apr 2011 08:51:00 -0000 From: Jan Kratochvil To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: [patch] Regression: Re: FYI: remove free_symtab Message-ID: <20110405085128.GB28800@host1.jankratochvil.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) 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: 2011-04/txt/msg00072.txt.bz2 Hi Tom, heavy crash regression on Fedora 15, in fact on any system using .gdb_index. One of such testfiles is for example gdb.base/cursal.exp. 3405069491ed7249b28958123166f160d7fe7fcb is the first bad commit commit 3405069491ed7249b28958123166f160d7fe7fcb Author: Tom Tromey Date: Mon Apr 4 15:19:54 2011 +0000 * symtab.h (free_symtab): Remove. (forget_cached_source_info_for_objfile): Declare. * symmisc.c (free_symtab): Remove. * source.c (forget_cached_source_info_for_objfile): New function. (forget_cached_source_info): Use it. * objfiles.c (free_objfile): Simplify check before calling clear_current_source_symtab_and_line. Call forget_cached_source_info_for_objfile. :040000 040000 be020dc3c59fd93e1e2dd2372227733c585a9e83 2ab4f20b502413ce56eafe87828ae10f7f7f1ee8 M gdb bisect run success Program received signal SIGSEGV, Segmentation fault. 0x0000000000488b0e in objfile_data (objfile=0x2128400, data=0x1e25a20) at objfiles.c:1480 1480 return objfile->data[data->index]; (gdb) p *objfile $1 = {next = 0x0, name = 0x20fdf60 "/usr/lib/debug/lib64/ld-2.13.90.so.debug", objfile->data is already NULL. #0 in objfile_data (objfile=0x2128400, data=0x1e25a20) at objfiles.c:1480 #1 in dw2_setup (objfile=0x2128400) at dwarf2read.c:2139 #2 in dw2_forget_cached_source_info (objfile=0x2128400) at dwarf2read.c:2308 #3 in forget_cached_source_info_for_objfile (objfile=0x2128400) at source.c:360 #4 in free_objfile (objfile=0x2128400) at objfiles.c:640 #5 in objfile_purge_solibs () at objfiles.c:988 #6 in no_shared_libraries (ignored=0x0, from_tty=0) at solib.c:1308 #7 in target_pre_inferior (from_tty=0) at target.c:2390 #8 in run_command_1 (args=0x0, from_tty=0, tbreak_at_main=0) at infcmd.c:506 #9 in run_command (args=0x0, from_tty=0) at infcmd.c:610 I do not see any deep design in the freeing order so I have just reshuffled it so that it started working again. No regressions on {x86_64,x86_64-m32,i686}-fedora{13,14,15,-rawhide}-linux-gnu together with the debugformat (as has been posted along) fix against yesterday. I will check it in today. Thanks, Jan gdb/ 2011-04-05 Jan Kratochvil Fix crash regression on systems featuring .gdb_index. * objfiles.c (free_objfile): Move the forget_cached_source_info_for_objfile call earlier. Comment it. Extend the comment for objfile_free_data. --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -583,6 +583,10 @@ free_objfile (struct objfile *objfile) lists. */ preserve_values (objfile); + /* It still may reference data modules have associated with the objfile and + the symbol file data. */ + forget_cached_source_info_for_objfile (objfile); + /* First do any symbol file specific actions required when we are finished with a particular symbol file. Note that if the objfile is using reusable symbol information (via mmalloc) then each of @@ -595,7 +599,8 @@ free_objfile (struct objfile *objfile) (*objfile->sf->sym_finish) (objfile); } - /* Discard any data modules have associated with the objfile. */ + /* Discard any data modules have associated with the objfile. The function + still may reference objfile->obfd. */ objfile_free_data (objfile); gdb_bfd_unref (objfile->obfd); @@ -637,8 +642,6 @@ free_objfile (struct objfile *objfile) clear_current_source_symtab_and_line (); } - forget_cached_source_info_for_objfile (objfile); - /* The last thing we do is free the objfile struct itself. */ xfree (objfile->name);