From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 7DEAC3858C52 for ; Fri, 31 May 2024 16:04:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7DEAC3858C52 Authentication-Results: sourceware.org; dmarc=pass (p=none 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 7DEAC3858C52 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=1717171498; cv=none; b=EWmlIgtfYjZGhcuMMTm5kCbpA4w2W9c1m5UXeOgwCHIvMktc7FMpbTlf6Fc3fzkVQw7TnfnnSEVCBN2tQIq+pFUovYGuo5iR8SiG+l6ffU7MAGyG0L1QrMe4rc77bIHuMKQdWc+4DA/HdVt1vwXI6RpRZnSMt5Z5o5tUB9UYKTo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717171498; c=relaxed/simple; bh=USx6gRugRILWSC4JJAHuAEOOKGbTaUzrsdtwftZUe/U=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=EVSTe2A0eNpMRk5xagoi+k97JUwXv2Z+X+Q3b8lPJ/6EFCzamfI/T2dCD0VthElxgoOmRKGYjd0mIAA/wWfpJUAAXgU20liTYRt9RkIfNpowRd06h8rhvvp/pgtrhE040RCDAGYT7NfIyry+XDAdoEt3anPupl/q2iFReoLYL6U= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1717171496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WAMr/+camp7HeTyGetDe3r2syoa52k5WQpTt1eI6HK4=; b=DTqgMn5nYeRsGLME0ur3HliYKkOswO90hbL7qDt8JcrkhWIO7pOE8mnDRT0SU7LLkdv0oK JfamQiIN7Hd5DaMHOOiW28Yr4ruxMJzvrQlHyttVbxMtFHWdpM3CGyIjBEXB0wNy+jukws qayn11xOs7qTNYwslg4hcOZ0aF2BAMY= Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-500-cGziCDjoMLOSE9Ks98JwTg-1; Fri, 31 May 2024 12:04:54 -0400 X-MC-Unique: cGziCDjoMLOSE9Ks98JwTg-1 Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-1f627ab7cf7so13772195ad.0 for ; Fri, 31 May 2024 09:04:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717171493; x=1717776293; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=WAMr/+camp7HeTyGetDe3r2syoa52k5WQpTt1eI6HK4=; b=eLNqgBkcYlI7dAm5CkWscTwdsxT491xWb3udFISEhtVbhOPV6AXCvw2gDcqfhDjP1g 0TTViZW5tCQSe0efXU4CqUrrPRrvwyEZb/68f4TEueEJQ03G9th0D72GQ58wTrB2kxut WR8tnuZ7ILsluhYXfoMXPP7CbLyBu2PbOABeBG+tb/0Kmk6TO8A1MvS6t1xgL0AkES8d qSZt/KMwAohAbOipLYJeO3kdEwnwG8IYpXP8dgy8HLfJhMdqcBoMs9+GnAJMIFPb7vMS sAw55Dnt/H4vJyLWiPw+8Q88GqCPzZPZe1jYH5C5WHGwY7IQFClvT+Km3ytFKutaiyDr EPsQ== X-Forwarded-Encrypted: i=1; AJvYcCUpXDfyfpw+QiJx9z1tXg7N0rl8eTAP2+14eR2EHK4YAd6IPpYvtRdieY5IOybGyGb6N/xorg4qIkzRGTw3UhayUyKbq02JBDw8lQ== X-Gm-Message-State: AOJu0Yxjgt14Q5j5EpgQ+ic4EAgb0QP7ai1yQopOKbCJ/vHElJhd7E+F +kvicy+wpTAwWMSdbu9lkA869N0Y8T3boMZh2NDBgYRxQ+kiM3iKJOzZeTNSwIs/hLAq56ra1g2 fbl5OYTAharHoO7QjTeO+Pk9es57adItldCyMy5zgfr9BGJYUNNJkbwumjKRaW7Ii/qc= X-Received: by 2002:a17:902:d344:b0:1f5:e4ea:9869 with SMTP id d9443c01a7336-1f6359a6329mr35228865ad.9.1717171493035; Fri, 31 May 2024 09:04:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFWiFAJykviFjAYrXHm8i6Nt10VXwo5Tu64G1L3W7Tv6c5ZK34/y4bD2G/CYS/ElPh0paS/vw== X-Received: by 2002:a17:902:d344:b0:1f5:e4ea:9869 with SMTP id d9443c01a7336-1f6359a6329mr35228405ad.9.1717171492364; Fri, 31 May 2024 09:04:52 -0700 (PDT) Received: from ?IPV6:2804:14d:8084:92c5::1001? ([2804:14d:8084:92c5::1001]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f6323dde39sm18579585ad.167.2024.05.31.09.04.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 31 May 2024 09:04:51 -0700 (PDT) Message-ID: <425c602d-8cad-403e-87c4-ffeaf27f1238@redhat.com> Date: Fri, 31 May 2024 13:04:49 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] [gdbserver] Imply --once if connecting via stdio To: William Ferreira , gdb-patches@sourceware.org References: <20240524211541.378520-1-wqferr@gmail.com> From: Guinevere Larsen In-Reply-To: <20240524211541.378520-1-wqferr@gmail.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham 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 5/24/24 18:15, William Ferreira wrote: > Currently, gdbserver hangs after stdin is closed while it tries to > write: "Remote side has terminated connection. GDBserver will reopen > the connection." This hang disappears if --once is also given. Since > the stdin connection won't ever reopen if it's closed, it's safe to > assume --once is desired. > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29796 > --- Hi William! Thanks for the patch! Since I helped you develop this patch and its not an area I'm all too familiar with, I don't think its fair for me to review this patch. However, I have tested the patch with both native-gdbserver and native-extended-gdbserver, and I see no regressions, so feel free to add my tested tag to this! Tested-By: Guinevere Larsen -- Cheers, Guinevere Larsen She/Her/Hers > gdbserver/server.cc | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/gdbserver/server.cc b/gdbserver/server.cc > index 789af36d9a4..3ab7a1eed14 100644 > --- a/gdbserver/server.cc > +++ b/gdbserver/server.cc > @@ -4204,6 +4204,10 @@ captured_main (int argc, char *argv[]) > /* "-" specifies a stdio connection and is a form of port > specification. */ > port = STDIO_CONNECTION_NAME; > + > + /* Implying --once here prevents a hang after stdin has been closed. */ > + run_once = true; > + > next_arg++; > break; > }