From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8345 invoked by alias); 1 Feb 2013 19:06:48 -0000 Received: (qmail 8332 invoked by uid 22791); 1 Feb 2013 19:06:48 -0000 X-SWARE-Spam-Status: No, hits=-5.6 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_BJ 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, 01 Feb 2013 19:06:42 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r11J6g6B001983 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 1 Feb 2013 14:06:42 -0500 Received: from host2.jankratochvil.net (ovpn-116-88.ams2.redhat.com [10.36.116.88]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r11J6cFk012343 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 1 Feb 2013 14:06:40 -0500 Date: Fri, 01 Feb 2013 19:06:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: Re: [patch] Fix assert crashes with minidebuginfo Message-ID: <20130201190637.GA15886@host2.jankratochvil.net> References: <20130201182134.GA14273@host2.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130201182134.GA14273@host2.jankratochvil.net> 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: 2013-02/txt/msg00018.txt.bz2 On Fri, 01 Feb 2013 19:21:34 +0100, Jan Kratochvil wrote: > diff --git a/gdb/symfile.c b/gdb/symfile.c > index 63bf329..6f968b7 100644 > --- a/gdb/symfile.c > +++ b/gdb/symfile.c > @@ -823,7 +823,12 @@ static void > read_symbols (struct objfile *objfile, int add_flags) > { > (*objfile->sf->sym_read) (objfile, add_flags); > - if (!objfile_has_partial_symbols (objfile)) > + > + /* find_separate_debug_file_in_section should be called only if there is > + single binary with no existing separate debug info file. */ > + if (!objfile_has_partial_symbols (objfile) > + && objfile->separate_debug_objfile == NULL > + && objfile->separate_debug_objfile_backlink == NULL) > { > bfd *abfd = find_separate_debug_file_in_section (objfile); > struct cleanup *cleanup = make_cleanup_bfd_unref (abfd); As discussed with Tom off-list: first entry: * SYM_READ reads separate .debug file. second entry, called for the .debug file: * nothing interesting as objfile_has_partial_symbols (objfile). first entry continues: * But the primary file still !objfile_has_partial_symbols (objfile), therefore minidebuginfo is read as a secondary debug info file (those are supported for MacOSX). third entry, called for the minidebuginfo * SYM_READ starts to search for separate debug info (via its PT_NOTE build-id) file for the minidebuginfo file. => crash Regards, Jan