From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19355 invoked by alias); 14 Feb 2014 03:26:48 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 19332 invoked by uid 48); 14 Feb 2014 03:26:48 -0000 From: "brobecker at gnat dot com" To: gdb-prs@sourceware.org Subject: [Bug symtab/16581] GDB crash on inherit_abstract_dies infinite recursion Date: Fri, 14 Feb 2014 03:26:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: symtab X-Bugzilla-Version: 7.7 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: brobecker at gnat dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: brobecker at gnat dot com X-Bugzilla-Target-Milestone: 7.8 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-q1/txt/msg00182.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=16581 --- Comment #1 from Joel Brobecker --- >>From https://www.sourceware.org/ml/gdb-patches/2014-01/msg00805.html: For the record, we've actually seen the exact same behavior from with GNAT a few years ago. The problem occured when when we had the following situation: procedure Outer (...) is [...] procedure Inner (...) is [...] -- Recurse by calling Outer.. Outer (...); end Inner; begin [...] Inner (...); In that case, when compiled at -O3, the compiler generated an Abstract Instance Root (AIR) for procedure Outer, which owned/contained a DIE defining procedure Inner (an out-of-line instance), which itself contains a Concrete Instance Entry (CIIE) corresponding to the inlined version of Outer's AIR. The CIIE has a reference to its AIR via the DW_AT_abstract_origin attribute, hence the cycle. Not being all quite sure how to make sense of the cycle in terms of inheritance, we initially tried to fix in the compiler. Although the patch was initially approved in GCC, it was noted that the output appeared to be conformant with the DWARF specifications (version 3,i at the time, now version 4), particularly in light of the examples in section D.7 of the specifications (3rd example). Eventually, it was found that our GCC patch was causing some issues, and thus was reverted. So far, we've kept the patch in AdaCore's GCC tree, with a note to look into a GDB fix at some point. We are indeed very close to the example from the DWARF specs cited above, but it does not deal with recursion as we do here, so I think that the DWARF specifications do have a hole when it comes to that. Logically speaking, its seems that the sensible thing to do is to inherit the whole Abstract Instance Tree (AIT) but excluding oneself. -- You are receiving this mail because: You are on the CC list for the bug.