From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 0D507385800A for ; Sun, 7 Aug 2022 15:32:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0D507385800A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz 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 3726D34E2D; Sun, 7 Aug 2022 15:32:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1659886356; 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=purjTPrNGm0aYAjf3g/3saomC2DStMG0IegjL+pdIxA=; b=M8oviM/oCR6rqKpEV9kQtlclo3iozTDqIPEvyvdgepJlNKiVAZ9RiH8ARzxBpX+j2EZiVf 4KLFv49d/pRofiT2T5zy7uO5tnHKSit9dpTNU8g9tx8ZuI7bawQji+JvCDuK4gsBuIyZ0W h1nMqrsnun8PzkNlWXYj/mtoni0lSo8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1659886356; 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=purjTPrNGm0aYAjf3g/3saomC2DStMG0IegjL+pdIxA=; b=MEI/V4mgbsxDS81szQFbYpvZYB/4nQcRO8A8bOwL7RDFlQFVUE3FeOACYyDjhJmgn8bony uSllQAgWPaDaFnCQ== 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 121F51333E; Sun, 7 Aug 2022 15:32:36 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id QqFQAxTb72LsNgAAMHmgww (envelope-from ); Sun, 07 Aug 2022 15:32:36 +0000 Message-ID: <9e0718ee-39d7-5236-419f-d0fcf903ccca@suse.cz> Date: Sun, 7 Aug 2022 17:32:35 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.1.0 Subject: Re: [PATCH] tests: do not fail on zero sized DIEs (binutils-2.39 compatible) To: Sergei Trofimovich , elfutils-devel@sourceware.org References: <20220806085310.2603348-1-slyich@gmail.com> Content-Language: en-US From: =?UTF-8?Q?Martin_Li=c5=a1ka?= In-Reply-To: <20220806085310.2603348-1-slyich@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Aug 2022 15:32:38 -0000 On 8/6/22 10:53, Sergei Trofimovich via Elfutils-devel wrote: Hi. Thanks for catching this. Btw. I've also noticed the elfutils failure in openSUSE staging project. > binutils started producing 0-sized DIEs on functions interspersed > by nested sections (".section ...; .previous). This led to > run-low_high_pc.sh failure in form of: > > FAIL: run-low_high_pc.sh > ======================== > > [b] main.c > [2d] main > > [b] ../sysdeps/i386/start.S > [26] _start > [40] ../sysdeps/x86/abi-note.c > [b52] init.c > [b8e] static-reloc.c > [2dba] _dl_relocate_static_pie > [2dd8] ../sysdeps/i386/crti.S > [2def] _init > lowpc: 8049000, highpc: 8049000lx > ../sysdeps/i386/crti.S: [2def] '_init' highpc <= lowpc > FAIL run-low_high_pc.sh (exit status: 255) > > To work it around let's allow lowpc == highpc special case. > > https://sourceware.org/bugzilla/show_bug.cgi?id=29450 > > Signed-off-by: Sergei Trofimovich > --- > tests/ChangeLog | 4 ++++ > tests/low_high_pc.c | 3 +++ > 2 files changed, 7 insertions(+) > > diff --git a/tests/ChangeLog b/tests/ChangeLog > index 0c6f68ef..8296e0b6 100644 > --- a/tests/ChangeLog > +++ b/tests/ChangeLog > @@ -1,3 +1,7 @@ > +2022-08-04 Sergei Trofimovich > + > + * low_high_pc.c (handle_die): Allow zero sized DIEs for binutils-2.39. > + > 2022-08-01 Mark Wielaard > > * run-debuginfod-percent-escape.sh: Add initial scan wait_ready. > diff --git a/tests/low_high_pc.c b/tests/low_high_pc.c > index cd022b1c..80c83b6d 100644 > --- a/tests/low_high_pc.c > +++ b/tests/low_high_pc.c > @@ -70,6 +70,9 @@ handle_die (Dwarf_Die *die, void *arg) > if (dwarf_hasattr (die, DW_AT_low_pc) > && dwarf_hasattr (die, DW_AT_high_pc) > && highpc <= lowpc > + /* gas-2.39 produces zero sized DIEs sometimes: > + https://sourceware.org/PR29451. */ > + && highpc != lowpc What about rather changing 'highpc <= lowpc' to 'highpc < lowpc' and note that ... > && ! (dwarf_tag (die) == DW_TAG_compile_unit && highpc == lowpc)) ... here 'highpc == lowpc' would be always false and the entire condition: '&& ! (dwarf_tag (die) == DW_TAG_compile_unit && highpc == lowpc))' always true. Cheers, Martin > { > printf("lowpc: %" PRIx64 ", highpc: %" PRIx64 "\n", lowpc, highpc);