From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by sourceware.org (Postfix) with ESMTPS id D054D3858002 for ; Mon, 13 Nov 2023 14:13:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D054D3858002 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D054D3858002 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699884791; cv=none; b=PFTD0sO8HAUUNCLH0CRSIL6U5xTNq/nSYb36gCXmi7D4RxpxhwlrsSWLns81NErbM/Xp58UqN3hqCPTcd7/QFTUZ3fuNVsN/QidUbe6ESABsoQ9MmQmWC9xzGx/G49hlNioH+aLWTKAIHdIJx+mMzwcR99dFxxZAXolZfTHQhRM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699884791; c=relaxed/simple; bh=cFD9pf9LcfOsveHxgCKVH9aUTQVrl5RuDCo/gJDCgnM=; h=Message-ID:Date:MIME-Version:Subject:To:From; b=CBcnGYS4nA5f/tke6KJYG55E9P9AqXvfZ9ZAVnNwPnesVKi77azHvmaUsICqX9EmWw22WAqjLe9W55D6thzfSrZE66yJWOLmzdnmIaFjBb42eN698TpTyX6lNQu9Rqd5RYhK3HnjzOViZIHN47e9JdmLobviWwssLCghnj3B0mU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-40842752c6eso36594165e9.1 for ; Mon, 13 Nov 2023 06:13:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699884789; x=1700489589; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=h2iVp1DG2qeDdFyDs6Z+ZnzbYRr7uINyZUdqVo0S5I8=; b=X7FLnLBDM5MNIYgoKgacpcBzy+h4YWRwHYaPk9Vi6NyOcqOpIfVLKRm3R44KM/etti yLJNxCA/1IDwyibLuvbmrtO9oFa/zdtIrmFmyaNdnmGPqpjHTD9/GImYn1zWd91NsQry BrPVG+MxIIwPrZ/ClonQ4jcTa7Tq5S+DYYkkbIw7Lm23VCUIf+6CNtacuR3HO/ztXtpw KLLn7x9pv6jPvfXOvfGWNnpUokmqmfg0ZFTHfz7anw94zHOe8t6Hdp85cwDvCs+WYcEr fqaN2iRykh1OYlFtx1hP6G0TeFC9901TkgHWyYodbehxqKqoC6z/ussc2raRx/giYM6b 3VUw== X-Gm-Message-State: AOJu0YyFCfP1HA1AE/afvSU8pSYwLjUy/QPmCd6wfVnroY78ihgjQy9t nvFLKY8DElvtyghoO9QRl08Nhri+/3c= X-Google-Smtp-Source: AGHT+IEW/chvQDdT+l5ezvoWfM7cDtTk+LM/5fCGBdA0jBNJ1x/5S7uS+nAtfEN4nOz4V8P362NMnw== X-Received: by 2002:a05:600c:3b15:b0:40a:49c1:94d9 with SMTP id m21-20020a05600c3b1500b0040a49c194d9mr5583891wms.27.1699884788524; Mon, 13 Nov 2023 06:13:08 -0800 (PST) Received: from ?IPV6:2001:8a0:f91e:1a00:8060:1e54:fb28:9635? ([2001:8a0:f91e:1a00:8060:1e54:fb28:9635]) by smtp.gmail.com with ESMTPSA id he9-20020a05600c540900b0040a48430837sm9830701wmb.13.2023.11.13.06.13.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Nov 2023 06:13:08 -0800 (PST) Message-ID: <787f2553-70a5-4175-a125-bf91f30d5192@palves.net> Date: Mon, 13 Nov 2023 14:13:07 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 25/31] Ignore failure to read PC when resuming Content-Language: en-US To: Andrew Burgess , gdb-patches@sourceware.org References: <20221212203101.1034916-1-pedro@palves.net> <20221212203101.1034916-26-pedro@palves.net> <87ilbvy5cl.fsf@redhat.com> From: Pedro Alves In-Reply-To: <87ilbvy5cl.fsf@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.5 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,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2023-06-10 11:33, Andrew Burgess wrote: > Pedro Alves writes: > >> If GDB sets a GDB_THREAD_OPTION_EXIT option on a thread, and the >> thread exits, the server reports the corresponding thread exit event, >> and forgets about the thread, i.e., removes the exited thread from its >> thread list. >> >> On the GDB side, GDB set the GDB_THREAD_OPTION_EXIT option on a >> thread, GDB delays deleting the thread from its thread list until it >> sees the corresponding thread exit event, as that event needs special >> handling in infrun. >> >> When a thread disappears from the target, but it still exists on GDB's >> thread list, in all-stop RSP mode, it can happen that GDB ends up >> trying to resume such an already-exited-thread that GDB doesn't yet >> know is gone. When that happens, against GDBserver, typically the >> ongoing execution command fails with this error: > > I'm slightly confused here. If GDB doesn't know the thread has exited > doesn't that mean the server hasn't yet reported the exit, and so should > be holding onto the thread? > > I wanted to investigate this a bit more to try and understand more about > what's going on, but I couldn't find a test that was triggering the code > added in this patch. Do you know if there's a test I can run to see > this issue? I think there was an existing testcase that would sometimes fail for this problem, but looks like I didn't write that anywhere, and now I don't remember... :-/ Sorry about this. I wasn't able to reproduce the problem in a few test runs, so I will drop this patch from the series for now until I find a better rationale, and we can discuss how to fix it then. Sorry again, and many thanks for the review and ideas. Pedro Alves