From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id qXmCCnyTgWDOXgAAWB0awg (envelope-from ) for ; Thu, 22 Apr 2021 11:17:16 -0400 Received: by simark.ca (Postfix, from userid 112) id 1826A1F104; Thu, 22 Apr 2021 11:17:16 -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.9 required=5.0 tests=DKIM_SIGNED, MAILING_LIST_MULTI,T_DKIM_INVALID,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 41B4D1E54D for ; Thu, 22 Apr 2021 11:17:15 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AD7D5394FC1E; Thu, 22 Apr 2021 15:17:14 +0000 (GMT) Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id E731C389682B for ; Thu, 22 Apr 2021 15:17:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E731C389682B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=andrew.burgess@embecosm.com Received: by mail-wr1-x430.google.com with SMTP id w4so41466708wrt.5 for ; Thu, 22 Apr 2021 08:17:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=RQ0WwX3yEFtllXkwoSFMKpogBWIYlCfAYxICrRMKYHQ=; b=LRnghmtX3CjR00q00W3GbLp2QZ1hJ0jqVu9OiEnjCpUSucVDK274M4jAm7fhbXw1Tn Dby6OUZT46Fs1zPoNwayhUPYK8nYHUJFAn17V822d+hA/00j/ZS2Gj0M/nqjpwMSOZta Fs7aLmE6XEs0NObluxCB4ouUiLJzjw3w0jLhbJJqJxp+hb+86ul1MmsAqMwrpXOMtg6h yZfODi1+Q6PUpA2E4sF5ZX9oACpRoq0QAVia/88pDWp9qLafl1Q2WBek6mGogKLaXiI2 6mv/ifXDV3FaRllAV+jNmqZy9JRAjSBUUino2FYhbyLKg6u2UJo0WhL9zJKcXzYdEl55 DaVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=RQ0WwX3yEFtllXkwoSFMKpogBWIYlCfAYxICrRMKYHQ=; b=Ec1QMVM5KGcSQkSVW4MlDoYj1FFd7WMOpUC1orTAbFygb14lNsWpQ8C00U6sTNle11 ZkxjYm7OFUnGmG2X61UuQgUaM0EqV+64E8Jj2AsRsMNWXp15MmsjguvS7pk0+6rfJVyE oPULuYY5GlaEg5Ki+BgwYZtyT31euCm7optHobkbXr983GkIJ/CQihohOGoyZYFFGjsM Buh7zdg7AQGJw4j9yty7wj2ard4f9lYVY5ahyOEEoRZmDGPgZwQi6sHkP907Mwwxzxos fh6Ek4pxk/AQ1VUkS+l/ELca4jcF3SMAtcoaagGC0X2brdarxJYbvGW4UxrXIzcIwbGd +4Ww== X-Gm-Message-State: AOAM531j7qi9YRb5LfXYgoTj/Hi7H7CK2cW9W8c6lh1RIctrEehmQxkn +OF0/2pjHx1CqS7Cbl66e1siyw== X-Google-Smtp-Source: ABdhPJy7MDqhzZ7gLMox+XulaGe3bdX2xqLNlMTo/4MsJyIC1MQ2cZH+3OgYe+KjRBkg3QB2T9XxDA== X-Received: by 2002:a5d:5407:: with SMTP id g7mr4849062wrv.149.1619104622100; Thu, 22 Apr 2021 08:17:02 -0700 (PDT) Received: from localhost (host109-151-46-70.range109-151.btcentralplus.com. [109.151.46.70]) by smtp.gmail.com with ESMTPSA id u3sm3672432wmg.48.2021.04.22.08.17.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Apr 2021 08:17:01 -0700 (PDT) Date: Thu, 22 Apr 2021 16:17:00 +0100 From: Andrew Burgess To: Simon Marchi Subject: Re: [PATCH][gdb] Fix assert in remote_async_get_pending_events_handler Message-ID: <20210422151700.GP2610@embecosm.com> References: <20210422085127.GA7572@delia> <20210422101919.GO2610@embecosm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: Linux/5.8.18-100.fc31.x86_64 (x86_64) X-Uptime: 16:16:05 up 12 days, 2:03, X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] 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: , Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" * Simon Marchi [2021-04-22 09:33:28 -0400]: > 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. I agree, I'm certainly not blocking the patch. Thanks, Andrew