From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 682 invoked by alias); 24 Feb 2014 21:43:23 -0000 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 Received: (qmail 666 invoked by uid 89); 24 Feb 2014 21:43:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 24 Feb 2014 21:43:21 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s1OLhJwH029262 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 24 Feb 2014 16:43:19 -0500 Received: from host2.jankratochvil.net (ovpn-116-18.ams2.redhat.com [10.36.116.18]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s1OLhFP1022894 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Mon, 24 Feb 2014 16:43:18 -0500 Date: Mon, 24 Feb 2014 21:43:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Subject: [patch] gdb_assert -> complaint for weird DWARF Message-ID: <20140224214314.GA5700@host2.jankratochvil.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="6TrnltStXW4iwmi0" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2014-02/txt/msg00731.txt.bz2 --6TrnltStXW4iwmi0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 602 Hi, PR 16581: GDB crash on inherit_abstract_dies infinite recursion https://sourceware.org/bugzilla/show_bug.cgi?id=16581 fixed crash from an infinite recursion. But in rare cases the new code can now gdb_assert() due to weird DWARF file. I do not yet fully understand why the DWARF is as it is but just GDB should never crash due to invalid DWARF anyway. The "invalid" DWARF I see only in Fedora GCC build, not in FSF GCC build, more info at: https://bugzilla.redhat.com/show_bug.cgi?id=1069382 http://people.redhat.com/jkratoch/gcc-debuginfo-4.8.2-7.fc20.x86_64-gnatbind.debug Thanks, Jan --6TrnltStXW4iwmi0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="complaint.patch" Content-length: 723 gdb/ 2014-02-24 Jan Kratochvil * dwarf2read.c (process_die): Change gdb_assert to complaint. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 3eaa0b1..71f5d34 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -8029,7 +8029,13 @@ process_die (struct die_info *die, struct dwarf2_cu *cu) struct cleanup *in_process; /* We should only be processing those not already in process. */ - gdb_assert (!die->in_process); + if (die->in_process) + { + complaint (&symfile_complaints, + _("DIE at 0x%x attempted to be processed twice"), + die->offset.sect_off); + return; + } die->in_process = 1; in_process = make_cleanup (reset_die_in_process,die); --6TrnltStXW4iwmi0--