From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id BB4693858425 for ; Mon, 4 Sep 2023 11:47:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BB4693858425 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 03C3521863; Mon, 4 Sep 2023 11:47:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1693828025; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/AZdxZCl2C+bdruGj75c4DF9gerJuiGdcQ44TzDkfG4=; b=ZB9CX/dm9dz0Emvl7WnIcthuFTmjQjYMmB5Uouv98f5PU7M4JtZq/iTb2RoPb+zdRbLJ/U YFWbbIeK6UAcfJU3V+4NOzy2ZdCBxoqmdoc+to5wIyPEVbvzSGmyPqhOYXD9lYVgIct8w0 D5AA0mnnLCKtgW8KJPArBZ7HFugoVcE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1693828025; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/AZdxZCl2C+bdruGj75c4DF9gerJuiGdcQ44TzDkfG4=; b=j/C0DiwZ6FAL2SlTK1wz+c/zbIqyHbRdPbBRT7BY66Acpo7d+LeY+Jkd9hf0Vs66grb5MN MWasFbipU1bcoZDA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id E285913425; Mon, 4 Sep 2023 11:47:04 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 05M4NrjD9WTrTwAAMHmgww (envelope-from ); Mon, 04 Sep 2023 11:47:04 +0000 Message-ID: <3b3216d6-dd6f-fbb5-3060-fa7e1c0b6c3b@suse.de> Date: Mon, 4 Sep 2023 13:47:08 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] [gdb/symtab] Handle self-reference in inherit_abstract_dies Content-Language: en-US To: Tom Tromey , Tom de Vries via Gdb-patches References: <20230828063633.3590-1-tdevries@suse.de> <875y4zuuiw.fsf@tromey.com> From: Tom de Vries In-Reply-To: <875y4zuuiw.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 8/28/23 16:11, Tom Tromey wrote: >>>>>> "Tom" == Tom de Vries via Gdb-patches writes: > > Tom> Building gdb with gcc 7.5.0 and -flto -O2 -flto-partition=one generates a > Tom> self-referencing DIE: > Tom> ... > Tom> <2><91dace>: Abbrev Number: 405 (DW_TAG_label) > Tom> <91dad0> DW_AT_abstract_origin: <0x91dace> > Tom> ... > > Tom> When encountering the self-reference DIE in inherit_abstract_dies we loop > Tom> following the abstract origin, effectively hanging gdb. > > Tom> Fix this by handling self-referencing DIEs in the loop in > Tom> inherit_abstract_dies. > > I wonder if these have ever happened from compiler bugs, or only from > hand-made tests. > > Anyway, seems fine. If we're ever worried about chains of inheritance > that form loops, we can do some kind of tortoise/hare thing. FTR, filed as https://sourceware.org/bugzilla/show_bug.cgi?id=30822 . Thanks, - Tom