From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ZGqnDu0T42CoYAAAWB0awg (envelope-from ) for ; Mon, 05 Jul 2021 10:15:09 -0400 Received: by simark.ca (Postfix, from userid 112) id 2D9E81F1F2; Mon, 5 Jul 2021 10:15:09 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id B36C61E940 for ; Mon, 5 Jul 2021 10:15:07 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 69033386486C for ; Mon, 5 Jul 2021 14:15:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 69033386486C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1625494507; bh=piOf5ehOrs3UoY6XXHd/vscNb0ROj6dXq2zC2Kq6iYg=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=wgRzeIy6GIbTLm4+rHLR3BV52j222HQ/Ho8rxwrcVRfVVrk8eu36dwxTHnnVBzM4l TD4nQfnOYmPUsLbyfDelELQyAhL+CNpd4q5yrp3UPQRarixroVzaDZn5u6lJ/fa6WY uv0GC7j0ZQ0wlLCHi9/IKME4/Wx/dLxhYx2v9gPs= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id BC4313858031 for ; Mon, 5 Jul 2021 14:14:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BC4313858031 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 165EEdIH020773 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 5 Jul 2021 10:14:44 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 165EEdIH020773 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 9E9D61E940; Mon, 5 Jul 2021 10:14:39 -0400 (EDT) Subject: Re: [PATCHv2 1/2] gdb: prevent an assertion when computing the frame_id for an inline frame To: Pedro Alves , Andrew Burgess , gdb-patches@sourceware.org References: <0bb59b0323e01b0fe5d3b7e101418b05f7b8d43d.1624304637.git.andrew.burgess@embecosm.com> <9c6022ea-4f2b-bae9-6c41-8b0c87952c5a@palves.net> Message-ID: <598dbed0-85c7-64e8-54d6-2f50bb2591f2@polymtl.ca> Date: Mon, 5 Jul 2021 10:14:39 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <9c6022ea-4f2b-bae9-6c41-8b0c87952c5a@palves.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 5 Jul 2021 14:14:39 +0000 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 2021-07-05 7:39 a.m., Pedro Alves wrote: > Hi Andrew, > > I've read this, and I think you came up with a reasonable solution. I discussed this with Andrew on IRC, and my bad, I didn't post the summary of our discussions here. I suggested that this was confusing because get_prev_frame_if_no_cycle now becomes get_prev_frame_if_no_cycle_except_in_some_cases, and it makes get_prev_frame_if_no_cycle alter its behavior based on what it thinks its caller is doing. And it causes the inline frame's this_id method to "lie" if it can't successfully compute the frame id, instead of properly reporting failure. The problem, in my opinion, is that: - inline_frame_this_id is currently not allowed to fail (return null_frame_id) - inline_frame_this_id uses get_prev_frame_if_no_cycle, which is allowed to fail (return nullptr) So the question, in my opinion, is: how to propagate the get_prev_frame_if_no_cycle failure up the stack. I suggested that the this_id method could throw a "FRAME_CYCLE_ERROR" in that case, caught by the get_prev_frame_if_no_cycle call up the stack. It would then set the last physical frame's stop reason to UNWIND_SAME_ID. I made a prototype here, which passes Andrew's test: https://review.lttng.org/c/binutils-gdb/+/6122 I prefer this option because it avoids adding special cases. If the id can't be computed, this_id throws and that's it, the caller decides what to do with it. But if people prefer the original solution, I don't mind :). Simon