From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id cOIaNzN7gWD1WgAAWB0awg (envelope-from ) for ; Thu, 22 Apr 2021 09:33:39 -0400 Received: by simark.ca (Postfix, from userid 112) id D556A1F104; Thu, 22 Apr 2021 09:33:39 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.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 2E1DB1E783 for ; Thu, 22 Apr 2021 09:33:39 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AB998398D041; Thu, 22 Apr 2021 13:33:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AB998398D041 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1619098418; bh=Fh+XBBzkYgHgFnDiWDv44qcigDFCP0mPhd4nNjZjLpg=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=C10UWkf0XD+xUrQUbqoL3xa66PvYkGchcohqFz+uO7WCVyd5GBrqrImM3wfHEMS1T nSWKj8/+mwV8AuYsgHsUAe2ItK8sjNriOl+1X0DNLZ4xvYJgVIRgn56I+lbyWF0LwJ 2uirvlQ9ITMw8d6U7iFTlX6sJq6wR70c1RJOxZ5Y= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 045FA394FC12 for ; Thu, 22 Apr 2021 13:33:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 045FA394FC12 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 13MDXTr0016076 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Apr 2021 09:33:33 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 13MDXTr0016076 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) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id CB3401E783; Thu, 22 Apr 2021 09:33:28 -0400 (EDT) Subject: Re: [PATCH][gdb] Fix assert in remote_async_get_pending_events_handler To: Tom de Vries , Andrew Burgess References: <20210422085127.GA7572@delia> <20210422101919.GO2610@embecosm.com> Message-ID: Date: Thu, 22 Apr 2021 09:33:28 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: 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 Thu, 22 Apr 2021 13:33:29 +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 Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 2021-04-22 7:03 a.m., Tom de Vries wrote: > On 4/22/21 12:19 PM, Andrew Burgess wrote: >> * Tom de Vries [2021-04-22 10:51:29 +0200]: >> >>> Hi, >>> >>> Occassionally I run into the following assert: >>> ... >>> (gdb) PASS: gdb.multi/multi-target-continue.exp: inferior 5 >>> Remote debugging from host ::1, port 49990^M >>> Process multi-target-continue created; pid = 31241^M >>> src/gdb/remote-notif.c:113: internal-error: \ >>> void remote_async_get_pending_events_handler(gdb_client_data): \ >>> Assertion `target_is_non_stop_p ()' failed.^M >>> ... >>> >>> The assert checks target_is_non_stop_p, which is related to the current >>> target. >>> >>> Fix this by changing the assert such that it checks non-stopness related to >>> the event it's handling. >>> >>> Tested on x86_64-linux. >>> >>> Any comments? >> >> This seems fine to me. I wonder though if you considered converting >> target_is_non_stop_p into a member function on target_ops? >> If we did >> then we would avoid having to switch targets just to ask this >> question. All of the helper functions that target_is_non_stop_p calls >> are already available as member functions so there would be no >> additional changes needed I think. >> > > Um, I'm the one who ran into the problem, Simon is the one who came up > with the fix, so I guess this is a question for him. I'm afraid I'm not > familiar with this code at all. This was proposed in the bug as well: https://sourceware.org/bugzilla/show_bug.cgi?id=27710#c16 I am not against it, but I think Tom's patch is OK, given it follows current practices. Simon