From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id qIwDOLI4K2gJPyoAWB0awg (envelope-from ) for ; Mon, 19 May 2025 09:57:06 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=I3VcirUN; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id D1BAB1E11C; Mon, 19 May 2025 09:57:06 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-10.1 required=5.0 tests=ARC_SIGNED,ARC_VALID, BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE autolearn=ham autolearn_force=no version=4.0.1 Received: from server2.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 ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 1464A1E102 for ; Mon, 19 May 2025 09:57:06 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A81933858D3C for ; Mon, 19 May 2025 13:57:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A81933858D3C Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=I3VcirUN Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 282A63858D20 for ; Mon, 19 May 2025 13:56:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 282A63858D20 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 282A63858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1747662992; cv=none; b=lTfASrmmZOKBQQWnUDXwC5nqMsfm3TRBnY9twEfmtlszPs0m9oKt0/D2GUO9WGei7l54fY3Q2/9EqKVSk1AXXSlN6H1SF2GZ3GllcgvQvf3yEV2WLEYSMQGcagt1aco6/8VYKC0w6/eIHNF8G0zYt8Se87CBkJqh6r8i+Qs+f2g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1747662992; c=relaxed/simple; bh=24qJknhs8wvldr2/zq2tZdpFLUGPvg0rkoUDaqGqYo4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=VZuI8qHR8eu/0hcCAlzQSo+QHR1H7ERLskLupGo/bzim4dV6pHf1Q2lGv7+IF0MoFqS5hup3zrUj1Mgp0uA7oZB/OTafnY1TQrxUrnsYwpLy5UH5B8UqLJEbwKTAxDc6wMKMiETSCr+ZwkFjyPQS0fQrzvEOCE9bSfOvLdyNYik= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 282A63858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1747662991; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bIrg/oY/klGKoU9vjd8WHJw3KGlQPhH4QebOPMjIT8w=; b=I3VcirUNxoggApP2GOYdr5zFVdpJyrADbvVX8a0mSaS1dnpR47JxvE1A/d5S+tNHj6M6q9 9MV241TDwE0tlMRXPyaLPld9AeDWXT2MtLgvKYXdNbnOogCfx12+RhH99fUwSSQYZdrKHy LEnlfD4xNj8hCfwNhBijwuYnU2fuVn4= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-688-q9zaEexXPWO1myHaQP4WIQ-1; Mon, 19 May 2025 09:56:30 -0400 X-MC-Unique: q9zaEexXPWO1myHaQP4WIQ-1 X-Mimecast-MFC-AGG-ID: q9zaEexXPWO1myHaQP4WIQ_1747662990 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-6f8d4461e7bso12581506d6.0 for ; Mon, 19 May 2025 06:56:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747662990; x=1748267790; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=bIrg/oY/klGKoU9vjd8WHJw3KGlQPhH4QebOPMjIT8w=; b=WYgrPiZ4CAxc4TXcQMB7z+ddQ0t3zV1Ltqu/PHPHmRZXq+TGxeenLJ3QmXVb7Dp3iQ ts4V0JYvBH4V9+cacQqczVKy3nxiQuBCZ1S0ZE4eyKrYVBTgOVCQRsSI5eS0jPCPvE+/ 0ezIm66zkn0G/qBWmI9L4buaZth+eSi06c7CrcbrLtLdPHmjw5bn2P/6uduxqcg+c6j7 bP4LhoMwWZBLxRcWmZiS0XLbBfL31tZZVEfAIsSS71h1ZQqghC3ZMG+B/TiOqhPXmccI 810iAYgfuUsC2Jox19A1L7lv4dWeQLKqbgApaP6jPlbPdPpjRdnMSbMU1zbfmnN+Q4DW l91Q== X-Forwarded-Encrypted: i=1; AJvYcCVh/jkvkkFz12M9fVSP27j1mBFVnKO4Jsl7rY1DonncNc/UcFA1/nRiO8BTY1Et92hiVQJaMtwb/d8ezQ==@sourceware.org X-Gm-Message-State: AOJu0YyznJWsBvqi4yWYakfbK2vN6aUYPe5INcQilJBiuBEjc7YlT1Tg +CEuXzJwP6YOBuwa/WPaceWBySwtFHteYWAxHaWbfQT6E1VKyGFW5F0IZN9yFQEwcNIzKj1Ex1C k2zCj9FnTgxBZrIP2G8xvuaHulUHUDg7XyAQVwLx9lHEWMeEFuTXjppm+4PV4j14hJ7iv2OE= X-Gm-Gg: ASbGncsou6clQ4QB1fJ7qtGoj2cni/EvpRlDBu7MmGy9RFNt1vcCwXnXG7L9133AIb8 vhhw14jRMB09HnrVraZToHtq3d/RnPkjFNtKESOugTB/9WBJdCS8Y/gb1ZBNhdcD18fLIo1LTkJ f8Q9TtpInhwpJNMEp48zyqhNZ99kaqVJnLWE5PZUsR8xJZFhams2tnGDk9L6bnaq+NoxFa0bWVl XipCgz9KhRNQcDgjm1aAH+GreHkp1SEKLubc5Y3lTcshE3NDtX+h7rcxRjMbfSOOg9V5PemeG4G RwESbHY9dcFkBxXHVrhud+q/1YPYaxv61mFB X-Received: by 2002:a05:6214:410:b0:6e8:fcc6:35b6 with SMTP id 6a1803df08f44-6f8b0847db8mr215591406d6.2.1747662990019; Mon, 19 May 2025 06:56:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFr93ipNqmLQgKGUO0TzDQx518148nVqmsRWJkYMFbNLIaQoyPPTPPTTAQT1dv+oLaoMIj0Ew== X-Received: by 2002:a05:6214:410:b0:6e8:fcc6:35b6 with SMTP id 6a1803df08f44-6f8b0847db8mr215591096d6.2.1747662989686; Mon, 19 May 2025 06:56:29 -0700 (PDT) Received: from localhost (30.226.159.143.dyn.plus.net. [143.159.226.30]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6f8b08ac575sm56990626d6.43.2025.05.19.06.56.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 May 2025 06:56:29 -0700 (PDT) From: Andrew Burgess To: Pedro Alves , gdb-patches@sourceware.org Subject: Re: [PATCH v2 01/47] Make default_gdb_exit resilient to failed closes In-Reply-To: <20250519132308.3553663-2-pedro@palves.net> References: <20250519132308.3553663-1-pedro@palves.net> <20250519132308.3553663-2-pedro@palves.net> Date: Mon, 19 May 2025 14:56:24 +0100 Message-ID: <878qmsn1pz.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 4OZEG5LfPZBrV40IQNNb9Je0TxiIBXX6ZlMcSR0pS7Q_1747662990 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Pedro Alves writes: > For some reason, when testing GDB on Cygwin, I get: > > child process exited abnormally > while executing > "exec sh -c "exec > /dev/null 2>&1 && (kill -2 -$spid || kill -2 $spid)"" > (procedure "close_wait_program" line 20) > invoked from within > "close_wait_program $shell_id $pid" > (procedure "standard_close" line 23) > invoked from within > "standard_close "Windows-ROCm"" > ("eval" body line 1) > invoked from within > "eval ${try}_${proc} \"$dest\" $args" > (procedure "call_remote" line 42) > invoked from within > "call_remote "" close $host" > (procedure "remote_close" line 3) > invoked from within > "remote_close host" > (procedure "log_and_exit" line 30) > invoked from within > "log_and_exit" > > When that happens from within clean_restart, clean_restart doesn't > clear the gdb_spawn_id variable, and then when clean_restart starts up > a new GDB, that sees that gdb_spawn_id is already set, so it doesn't > actually spawn a new GDB, and so clean_restart happens to reuse the > same GDB (!). Many tests happen to actually work OK with this, but > some don't, and the failure modes can be head-scratching. > > Of course, the failure to close GDB should be fixed, but when it > happens, I think it's good to not end up with the current weird state. > Connecting the "child process exit abnormally" errors at the end of a > testcase run with weird FAILs in other testcases took me a while (as > in, weeks!), it wasn't obvious to me immediately. > > Thus, this patch makes default_gdb_exit more resilient to failed > closes, so that gdb_spawn_id is unset even is closing GDB fails, and > we move on to start a new GDB. > > Change-Id: I9ec95aa61872a40095775534743525e0ad2097d2 Makes sense to me. Approved-By: Andrew Burgess Thanks, Andrew > --- > gdb/testsuite/lib/gdb.exp | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp > index 49ef0d54654..c51cea86a9d 100644 > --- a/gdb/testsuite/lib/gdb.exp > +++ b/gdb/testsuite/lib/gdb.exp > @@ -2315,7 +2315,9 @@ proc default_gdb_exit {} { > } > > if ![is_remote host] { > - remote_close host > + if {[catch { remote_close host } message]} { > + warning "closing gdb failed with: $message" > + } > } > unset gdb_spawn_id > unset ::gdb_tty_name > -- > 2.49.0