From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id NS+vDtcBCGMbTi0AWB0awg (envelope-from ) for ; Thu, 25 Aug 2022 19:12:23 -0400 Received: by simark.ca (Postfix, from userid 112) id 2E3D51E4A7; Thu, 25 Aug 2022 19:12:23 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=BGm1o+PH; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 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 44D101E13B for ; Thu, 25 Aug 2022 19:12:19 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id ADA12385C33A for ; Thu, 25 Aug 2022 23:12:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ADA12385C33A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1661469138; bh=CDoybHAB67LsGDri1HS4Z2Kt7B3qMc7SLBkHXGiD4uY=; h=References:To:Subject:In-reply-to:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=BGm1o+PH9IzY23WzB2NVm7o6thTdU1DgMHJOzd95JVsXW8PgDTtxdPAena1YaAW+u MOhx8ztgQL5Y1VG1gUpYVwxEqSewhbOiCmWSTASIzOnzgOkToWmtWkNxsSH7RU0nIS iKzFmaMfHswSyMpkG297mIHmAyGvBIVLFYce+eU4= Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com [IPv6:2607:f8b0:4864:20::22e]) by sourceware.org (Postfix) with ESMTPS id 8A5BC3856278 for ; Thu, 25 Aug 2022 23:11:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8A5BC3856278 Received: by mail-oi1-x22e.google.com with SMTP id n124so30370oih.7 for ; Thu, 25 Aug 2022 16:11:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:in-reply-to:subject:cc:to:from :user-agent:references:x-gm-message-state:from:to:cc; bh=CDoybHAB67LsGDri1HS4Z2Kt7B3qMc7SLBkHXGiD4uY=; b=nc5uWF8o55agwstklIEDygPOXTpyDGrnBuN9oJMBNiE4bbqA8BvOox00/nRG1dPALJ SsLSS5/5i4N7On4RuJfgG+0ScpRKXBsqDV00vvsACJvVL0rUsPc8t/DTkOKvtNbd+8cW IVJ++SztDeykhrL2a6W9/73x8oEXElPnRl0NTtxE9lcs2PWqxghtM7wz1bqnZrET1LNE 0BPppGMD5fesgAiPO2iCBMQuq0WXXe4nBjdgHXCbUg/loBJKbQpfYFIh6WmWUF2+NTgP Uj5+9ArRsFnwVXKRr21BG0ofrXf5HkVaDLcUn+iNGv1qIYHcr0cPG3Sc1vAB2nwGVEwS GanA== X-Gm-Message-State: ACgBeo3N0j6mVHTGx/qzjtfIZ7P3rneSIqucIIcRiAljXo2C0eZPLIdc 7aOFfofCMv9nrRV+Z6TPecxniw== X-Google-Smtp-Source: AA6agR5p61gglEZolnAI4Ylc2LPfiviBDgHBLU0PahnKNTo9V8XUqQADF+tfiGsVq1A+QE4Lkt5Uhw== X-Received: by 2002:a05:6808:30a0:b0:343:5e60:b1f3 with SMTP id bl32-20020a05680830a000b003435e60b1f3mr502376oib.242.1661469117875; Thu, 25 Aug 2022 16:11:57 -0700 (PDT) Received: from localhost ([2804:14c:8780:89d8:9238:a6ce:8505:b0a4]) by smtp.gmail.com with ESMTPSA id q7-20020a05683022c700b00636ee04e7aesm171328otc.67.2022.08.25.16.11.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Aug 2022 16:11:57 -0700 (PDT) References: <20220523180056.1415229-1-eduard.sargsyan@intel.com> <20220523180056.1415229-2-eduard.sargsyan@intel.com> User-agent: mu4e 1.8.9; emacs 28.1 To: Eduard Sargsyan Subject: Re: [PATCH 1/2] gdb: Fix deleted thread when issuing next command In-reply-to: <20220523180056.1415229-2-eduard.sargsyan@intel.com> Date: Thu, 25 Aug 2022 23:11:54 +0000 Message-ID: <87wnavex51.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain 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: Thiago Jung Bauermann via Gdb-patches Reply-To: Thiago Jung Bauermann Cc: Aleksandar Paunovic , gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hello Eduard, Eduard Sargsyan via Gdb-patches writes: > From: Aleksandar Paunovic > > When issuing "next" command the thread got deleted even though it was still > alive and running. This happened because the thread was examined under a > wrong inferior. > > The fixed scenario: > ~~~ > $ gdb -q breakpoint-running-inferior-1-exe > (gdb) set schedule-multiple off > (gdb) break breakpoint-running-inferior-1.c:26 > (gdb) run > (gdb) add-inferior -no-connection > (gdb) inferior 2 > (gdb) spawn gdbserver :2346 breakpoint-running-inferior-2-exe > (gdb) target remote :2346 > (gdb) break breakpoint-running-inferior-2.c:26 > (gdb) continue > (gdb) thread 1.1 > (gdb) clear breakpoint-running-inferior-2.c:26 > (gdb) set schedule-multiple on > (gdb) next > (gdb) thread 1.1 > ~~~ > > Before: > ~~~ > Thread ID 1.1 has terminated. > ~~~ > > Now: > ~~~ > Switching to thread 1.1 > ~~~ > > gdb/ChangeLog: > 2021-04-30 Aleksandar Paunovic > > * infrun.c (keep_going_stepped_thread): Switch to correct > inferior and check if thread is executing. > > gdb/testsuite/ChangeLog: > 2021-04-30 Aleksandar Paunovic > > * gdb.base/breakpoint-running-inferior-1.c: New file. > * gdb.base/breakpoint-running-inferior-2.c: New file. > * gdb.base/breakpoint-running-inferior.exp: New file. > > Signed-off-by: Aleksandar Paunovic > --- > gdb/infrun.c | 2 + > .../gdb.base/breakpoint-running-inferior-1.c | 39 +++++++++ > .../gdb.base/breakpoint-running-inferior-2.c | 39 +++++++++ > .../gdb.base/breakpoint-running-inferior.exp | 84 +++++++++++++++++++ > 4 files changed, 164 insertions(+) > create mode 100644 gdb/testsuite/gdb.base/breakpoint-running-inferior-1.c > create mode 100644 gdb/testsuite/gdb.base/breakpoint-running-inferior-2.c > create mode 100644 gdb/testsuite/gdb.base/breakpoint-running-inferior.exp Aleksandar last posted version 4 of this patch, but this email seems to contain either v1 or v2. Consequently, Simon's review comments aren't addressed here. Was there a reason to return to the older version? Also, I applied the patch to a commit from a few days ago which I had handy (f8bfbd5b751b) and there were some failures when running the test: === gdb Summary === # of expected passes 10 # of unexpected failures 3 # of duplicate test names 1 Are the tests passing for you? Interestingly, running the testcase with the infun.c change reverted produced one less failure: === gdb Summary === # of expected passes 11 # of unexpected failures 2 # of duplicate test names 1 -- Thiago