From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by sourceware.org (Postfix) with ESMTPS id 9A5963858D35 for ; Tue, 7 Jul 2020 01:29:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9A5963858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=alves.ped@gmail.com Received: by mail-wr1-f68.google.com with SMTP id o11so43414000wrv.9 for ; Mon, 06 Jul 2020 18:29:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=cjeOPMtHAiOu4QUEWfFXRznZPvwXSJwYKmSnaxP4jBU=; b=lQxXK56uyZyDjKABTxsqr5EpLmDidUF1mdkIShd516kzkB7oLiZefBkU6O+kywzqtF 4v6ShsCG1on5y13YkpJWW3FJRredW5KSngnx6eW2Vg/70/N24j8vYyhWg7c8BlC7xY4H Lbp7cp75rDDKKChnSgiVCCRCGHMZwmoz2qqvXitqbuHp06RAcI2cJWNa0AiKRfiUd9zi yRNszGmAoBuuHQ99t+1PZkIqBZxS/QzQzpfmst6u2H22uSomuhw0xftWsuphaoIb8p8t tO7SlNl27q/T7hkIzXBkouqzD95tMBeNCclCq9Aqt2ZOpaPU2T0fR+aWWFhqcK3ZxfsT GO4A== X-Gm-Message-State: AOAM533xu3/mB36eHp1OLbLyMjmzH/bhqGwHdSnauuBcM22w30IfVVOy J0eu85DT5OgBsPae3Ys2liJGMlJ7U8A= X-Google-Smtp-Source: ABdhPJw8FEsH342wHz/BLa1eztFBXjcA/9rodJYmSkXivnAaWjF+TZe+nqsCJOTGsnUP80KLOv0Kfw== X-Received: by 2002:adf:ded2:: with SMTP id i18mr51714510wrn.109.1594085346355; Mon, 06 Jul 2020 18:29:06 -0700 (PDT) Received: from ?IPv6:2001:8a0:f91a:c400:8728:8fef:5b85:5934? ([2001:8a0:f91a:c400:8728:8fef:5b85:5934]) by smtp.gmail.com with ESMTPSA id v3sm26490544wrq.57.2020.07.06.18.29.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Jul 2020 18:29:05 -0700 (PDT) Subject: Re: [PATCH 0/7] GDB busy loop when interrupting non-stop program (PR 26199) From: Pedro Alves To: Simon Marchi , gdb-patches@sourceware.org References: <20200706190252.22552-1-pedro@palves.net> <8e6b5643-02a4-f371-1854-ef193fb0c202@palves.net> Message-ID: <4bcb8c63-560d-6597-27b3-3b3130277661@palves.net> Date: Tue, 7 Jul 2020 02:29:02 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <8e6b5643-02a4-f371-1854-ef193fb0c202@palves.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Tue, 07 Jul 2020 01:29:08 -0000 On 7/7/20 2:27 AM, Pedro Alves wrote: > The issue is that the remote target is unpushed while within scoped_restore_current_thread' dtor's I meant ctor, not dtor. > get_frame_id call, which results in threads being deleted. However, back in > scoped_restore_current_thread's ctor, we only increment the refcount after get_frame_id > returns. Incrementing the refcounts earlier fixes it.