From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id P0X5NMp46GBtHgAAWB0awg (envelope-from ) for ; Fri, 09 Jul 2021 12:26:50 -0400 Received: by simark.ca (Postfix, from userid 112) id CAEEB1EAB8; Fri, 9 Jul 2021 12:26:50 -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 0A6EA1E79C for ; Fri, 9 Jul 2021 12:26:50 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1D912398703C for ; Fri, 9 Jul 2021 16:26:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1D912398703C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1625848009; bh=aCIWUeBxMqGzYTr/SbfRUwCvVV6VufZ4LJ9jbU15wGc=; h=Subject:Date:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=EurnJMTc5oFw/BQXSm4bGRtGelFLD4flHqCGw36InWcr/HR7PF3/9s958pBd1Z39R Bzhp+xYbueYaCRwJB6d33Z7pBcv3z1Pru/7qWFDuL/ZCeiBuVo5rvKmeBlHom5ZqzX JFXctLqC955jbUu9vRwCgjmvoYNW1TZmrE15JABI= Received: from pv50p00im-ztbu10011701.me.com (pv50p00im-ztbu10011701.me.com [17.58.6.53]) by sourceware.org (Postfix) with ESMTPS id 245AF3857831 for ; Fri, 9 Jul 2021 16:26:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 245AF3857831 Received: from smtpclient.apple (c-71-231-148-226.hsd1.wa.comcast.net [71.231.148.226]) by pv50p00im-ztbu10011701.me.com (Postfix) with ESMTPSA id 177258A043E for ; Fri, 9 Jul 2021 16:26:27 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) Subject: [PATCH] Pick up Dominique Quatravaux 2cnd macOS modifications gdb Message-Id: <1E9C17B9-0F4B-42B9-B21C-C23FA8D9B4BE@me.com> Date: Fri, 9 Jul 2021 09:26:26 -0700 To: gdb-patches@sourceware.org X-Mailer: Apple Mail (2.3654.100.0.2.22) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-07-09_10:2021-07-09, 2021-07-09 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-2009150000 definitions=main-2107090082 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: Sam Warner via Gdb-patches Reply-To: Sam Warner Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" =46rom 92c389951e87ad12652d330b08f8d3a929c5ae5d Mon Sep 17 00:00:00 2001 From: Sam Warner Date: Thu, 8 Jul 2021 19:17:14 -0700 Subject: [PATCH] Pick up Dominique Quatravaux 2cnd macOS modifications = gdb 10.2 MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit As seen in https://sourceware.org/bugzilla/show_bug.cgi?id=3D24069 this code will typically wait4() a second time on the same process that was already wait4()'d a few lines above. While this used to be harmless/idempotent (when we assumed that the process already exited), this now causes a deadlock in the WIFSTOPPED case. The early (~2019) history of bug #24069 cautiously suggests to use WNOHANG instead of outright deleting the call. However, tests on the current version of Darwin (Big Sur) demonstrate that gdb runs just fine without a redundant call to wait4(), as would be expected. Notwithstanding the debatable value of conserving bug compatibility with an OS release that is more than a decade old, there is scant evidence of what that double-wait4() was supposed to achieve in the first place - A cursory investigation with `git blame` pinpoints commits bb00b29d7802 and a80b95ba67e2 from the 2008-2009 era, but fails to answer the =E2=80=9Cwhy=E2=80=9D question conclusively. --- gdb/darwin-nat.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c index a6790792fb6..413e70811c4 100644 --- a/gdb/darwin-nat.c +++ b/gdb/darwin-nat.c @@ -1106,9 +1106,6 @@ darwin_nat_target::decode_message = (mach_msg_header_t *hdr, inferior_debug (4, _("darwin_wait: pid=3D%d exit, = status=3D0x%x\n"), res_pid, wstatus); =20 - /* Looks necessary on Leopard and harmless... */ - wait4 (inf->pid, &wstatus, 0, NULL); - return ptid_t (inf->pid); } else --=20 2.32.0