From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 3F6473858D34 for ; Wed, 8 Jul 2020 16:52:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3F6473858D34 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [172.16.0.95] (192-222-181-218.qc.cable.ebox.net [192.222.181.218]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id B94621E5F9; Wed, 8 Jul 2020 12:52:07 -0400 (EDT) Subject: Re: [PATCH] Don't compare the pid returned from wait() against inferior_ptid. To: John Baldwin , Gary Benson Cc: Pedro Alves , gdb-patches@sourceware.org References: <20200708004605.91238-1-jhb@FreeBSD.org> <20200708094831.GA9636@blade.nx> <700ffd93-43eb-22c7-b21a-8f4defdd7034@FreeBSD.org> From: Simon Marchi Message-ID: <6891f4e5-7dc3-e2f5-05be-510607ed0485@simark.ca> Date: Wed, 8 Jul 2020 12:52:07 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <700ffd93-43eb-22c7-b21a-8f4defdd7034@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: tl Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Wed, 08 Jul 2020 16:52:12 -0000 On 2020-07-08 12:46 p.m., John Baldwin wrote: > On 7/8/20 2:48 AM, Gary Benson wrote: >> Hi John, >> >> John Baldwin wrote: >>> inf_ptrace::wait() needs to discard termination events reported by >>> detached child processes. Previously it compared the returned pid >>> against the pid in inferior_ptid to determine if a termination event >>> should be discarded or reported. inferior_ptid is now null_ptid in >>> wait() target methods, so this was always failing and never >>> reporting exit events. Instead, report termination events whose pid >>> matches any inferior belonging to the current target. >>> >>> gdb/ChangeLog: >>> >>> * inf-ptrace.c (inf_ptrace_target::wait): Don't compare against >>> inferior_ptid. >> >> Did the bug you've fixed cause any tests to fail? And, if not, is >> this something it's possible to write a test for? > > It did cause regressions in some tests on FreeBSD. I am still letting > a before-after testsuite run, but gdb.base/a2-run.exp at least failed > all tests due to this bug and is back to passing on FreeBSD with the fix. Here's the context, for Gary and others: https://sourceware.org/pipermail/gdb-patches/2020-July/170238.html In the commit message, you should point out that commit xYZ caused some existing tests to fail, and that this patch makes them pass again. This way it's implied that there doesn't need to be new tests added, and it gives a paper trail to understand why this fix has come to be needed. Simon