From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 3976A3858D20 for ; Fri, 27 Jan 2023 05:47:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3976A3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca Received: from [10.0.0.170] (unknown [217.28.27.60]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id C58A31E110; Fri, 27 Jan 2023 00:47:57 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1674798478; bh=2XNbwLtCWZSm3wHTUTtvNjv0dvAlHVkb/QeXDAbRxTg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=ALCZTy/fxBcmXMUTf8ncTKe3bXHDBiCY8zuXWREAzwNI7Iqj1oWqvrYQ5X03t++JV C3M21SOJOXRToo/Yb+cSmZF1SODfiWP7cjBZCR8RpOypAh8F/T6Pp3q8XUSDbsxhKi wqj5RP607TMfzBeGiy+DOhsa9buiRoxoI0z8ec+I= Message-ID: <26ba8dcf-3f4e-983d-bbb8-a61c4b94c47d@simark.ca> Date: Fri, 27 Jan 2023 00:47:57 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH v2 4/4] Fix parameter-less template regression in new DWARF reader Content-Language: fr To: Tom Tromey Cc: gdb-patches@sourceware.org References: <20230110183338.2623088-1-tromey@adacore.com> <20230110183338.2623088-5-tromey@adacore.com> <871qnt2bob.fsf@tromey.com> From: Simon Marchi In-Reply-To: <871qnt2bob.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS,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 1/17/23 14:39, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi writes: > > Simon> Starting with this patch, I get (using _GLIBCXX_DEBUG): > [...] > > Ugh, sorry about that. > I've reproduce it and I'm working on a fix. > > Tom I started to look into this, using that other patch I sent that dumps the contents of the cooked index. You probably already know this, as you have been looking at the problem already, but it can perhaps help pothers. The specific instance I look at is: $ ./gdb -nx -q --data-directory=data-directory testsuite/outputs/gdb.cp/cpexprs/cpexprs -ex start -ex "print policy1::function" -batch When searching in the cooked index, the search string (canonicalized version of the input, I think) is: "policy >::function" The problem is that the lower bound function used in cooked_index::find (cooked_index_entry::compare) is invalid for these two consecutive entries: [365] ((cooked_index_entry *) 0x621000115080) name: policy canonical: policy DWARF tag: DW_TAG_subprogram flags: 0x0 [] DIE offset: 0x3951 parent: ((cooked_index_entry *) 0x6210001137a0) [policy >] [366] ((cooked_index_entry *) 0x621000113740) name: policy > canonical: policy > DWARF tag: DW_TAG_class_type flags: 0x0 [] DIE offset: 0x22a3 parent: ((cooked_index_entry *) 0) It returns that [365] greater or equal to our search string, but also that [366] is less than our search string. This is a contradiction, because elements are supposed to be sorted according to the comparison function. Simon