From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id eUs1EzE4pGBwJQAAWB0awg (envelope-from ) for ; Tue, 18 May 2021 17:57:05 -0400 Received: by simark.ca (Postfix, from userid 112) id 3D2631F11C; Tue, 18 May 2021 17:57:05 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 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 7D8501E813 for ; Tue, 18 May 2021 17:57:04 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CC6A23858034; Tue, 18 May 2021 21:57:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CC6A23858034 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1621375023; bh=jse6ALZ9cyKvAox5WLtFbq8b9v9pRtGeF7kuzPCTxZ8=; h=To:Subject:In-Reply-To:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:From; b=udKm6L1bXSQeG96jJ8BwV9RJKQ3uxnd7Q/JtsqLL0kdeW1avKtLm8vVs3R65pGluP 5M8b1jfHayHyV21WZJMsGvSSRbyzVCJodZBtHFHbchT51GdiTL7etadIMJZ06A4q3a yiYBJAo1nS6UGhcRZLUYxtHjCc348igV+esfUNvI= Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id B0E9A3858034 for ; Tue, 18 May 2021 21:57:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B0E9A3858034 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 14ILXxtd180199; Tue, 18 May 2021 17:56:47 -0400 Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0a-001b2d01.pphosted.com with ESMTP id 38mmvs1enw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 May 2021 17:56:47 -0400 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.0.43/8.16.0.43) with SMTP id 14ILTYI5025663; Tue, 18 May 2021 21:56:46 GMT Received: from b01cxnp22035.gho.pok.ibm.com (b01cxnp22035.gho.pok.ibm.com [9.57.198.25]) by ppma03dal.us.ibm.com with ESMTP id 38j5x9gwuu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 May 2021 21:56:46 +0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 14ILujwk30081446 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 May 2021 21:56:45 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A8831AC059; Tue, 18 May 2021 21:56:45 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7216FAC05B; Tue, 18 May 2021 21:56:44 +0000 (GMT) Received: from pedro.localdomain (unknown [9.65.252.78]) by b01ledav006.gho.pok.ibm.com (Postfix) with SMTP; Tue, 18 May 2021 21:56:44 +0000 (GMT) Received: by pedro.localdomain (Postfix, from userid 1000) id 53E993C0529; Tue, 18 May 2021 18:56:41 -0300 (-03) To: cel@us.ibm.com, gdb-patches@sourceware.org Subject: Re: [PATCH] kill all threadapply processes at end of test In-Reply-To: <74a4549303369eda07c3488ad0bf9dcfef9e00bc.camel@us.ibm.com> Date: Tue, 18 May 2021 18:56:38 -0300 Message-ID: <87cztn7lk9.fsf@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: -ksse9wfaWfv7XTLnQweF5CWqliGRb8V X-Proofpoint-GUID: -ksse9wfaWfv7XTLnQweF5CWqliGRb8V X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761 definitions=2021-05-18_10:2021-05-18, 2021-05-18 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 clxscore=1011 bulkscore=0 impostorscore=0 lowpriorityscore=0 mlxscore=0 spamscore=0 malwarescore=0 suspectscore=0 mlxlogscore=999 priorityscore=1501 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2105180149 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: Pedro Franco de Carvalho via Gdb-patches Reply-To: Pedro Franco de Carvalho Cc: ulrich.weigand@de.ibm.com, tom@tromey.com Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" Hello, I didn't review the patch in detail, but one concern is that this could cause a pid recycling issue. After expect gets the pid from the stopped inferior, and the gdb under expect detaches from the inferior, it could happen that the inferior finishes, there's lots and lots of processes in the test system, and that same pid might get reused for a completely different process, which GDB would attach to and kill, assuming it has ptrace privileges over it. This might be unlikely, but it would be bad for the testsuite to kill a random process in the system. I'm not sure if there's an easy and portable solution to this. Apart from that, it might be simpler to do the attaching and killing inside proc thr_apply_detach. Thanks, Pedro Franco de Carvalho