From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id F06213858CDA for ; Sat, 13 Aug 2022 21:28:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F06213858CDA Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from reform (unknown [178.226.90.55]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 6877F300B351; Sat, 13 Aug 2022 23:28:11 +0200 (CEST) Received: by reform (Postfix, from userid 1000) id 04B042E808D6; Sat, 13 Aug 2022 23:28:08 +0200 (CEST) Date: Sat, 13 Aug 2022 23:28:08 +0200 From: Mark Wielaard To: Ulrich Drepper Cc: elfutils-devel@sourceware.org Subject: Re: cannot skip augment string handling Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no 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: Sat, 13 Aug 2022 21:28:16 -0000 Hi Ulrich, On Tue, Aug 09, 2022 at 08:01:43PM +0200, Ulrich Drepper via Elfutils-devel wrote: > He dwarf_next_cfi function has some clever code which skips over the > processing of the augmentation string content if the first character is 'z' > (for sized augmentation). This would be OK if it wouldn't be for the fact > that the augment processing loop produces additional information, namely, > it fills in the fde_augmentation_data_size fields. That information isn't > available elsewhere. > > In addition, the loop over the augment string is incorrect because the > interpretation of the P, L, and R entries depends on 'z' being present. in > the absence of 'z', when the loop would be executed in the current version, > the interpretation of those entries is not the same. > > In the patch below I've removed the shortcut and fixed the handling of the > P, L, and R entries. I've also added an additional test checking that the > entries of the augmentation string don't guide the code to consume more > data then is indicated in the 'z' data. Looks good. Thanks for catching this. Please do add a Signed-off-by line next time. See the CONTRIBUTING file. I was wondering why this hasn't caused an issue before. But it looks like internally when we use the result of dwarf_next_cfi in cie.c and fde.c we always call __libdw_intern_cie or intern_new_cie which recalculates the fde_augmentation_data_size by reading the augmentation string and data again. Thanks, Mark