From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id khT7Aa6QiGqRbDQAWB0awg (envelope-from ) for ; Fri, 21 Aug 2026 13:53:50 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=SZ9w7g6Q; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id E6ED41E0A3; Fri, 21 Aug 2026 13:53:49 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 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 autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (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 F32C41E033 for ; Fri, 21 Aug 2026 13:53:48 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7B3694BB1C35 for ; Fri, 21 Aug 2026 17:53:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7B3694BB1C35 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=SZ9w7g6Q Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 1F2A74BA900D for ; Fri, 21 Aug 2026 17:53:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1F2A74BA900D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1F2A74BA900D Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2001:470:142:3::10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1787334805; cv=none; b=tgA6+mJusNGTK89CAhz4p5R1H5qQfIWDXjsTJ2zOxCKgbLTb/w49j9Sl9ZzO9yOVz7o1HhpNeC/PSqnlo53AwOgg9vklqy7pNkmrgDRLPQj/T8zxe5+RNf2Cv1mHOcpy+txk3CuBlR+bJFNTAGC8VaAnb2ziRf5wKvfT8m6g+Ko= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1787334805; c=relaxed/simple; bh=/pNquGamrv4A4TGjBh9V+QbQ9wYr8MZwMOy8c1g2C0U=; h=DKIM-Signature:Date:Message-Id:From:To:Subject; b=OoK09XWX4OJa3kIVFBz8k45hbT87xGG7WT0W3sakbHbVpUIZHHtXo5KucuWc9No4YQ/Os2WK1tlZ/tcI6XzmXCa7SbWgUNbrjvayVu9ql9i4h3BNCxl/7NHUIlFSthgbWGscdJzVP56Q7E9rZyzHi+rM9bX14wemSHRS/pAKUTo= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=SZ9w7g6Q DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1F2A74BA900D Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wxTQg-0000y0-Pu; Fri, 21 Aug 2026 13:53:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=NCL6OlJliw98Ad0tSlo9f2BrY6DXaNnAgnywYBRE+Sc=; b=SZ9w7g6QJ9u8 8c2MNe2Vmn6BGVL8Hsr37LdIMY09xDnSJW2gzqbSoDnraMa9IwejfpZr6TD583ruaJBNekkC/tQuh 4KkUFGNIKCv4sN57DBUBUQ/6ETMjB0CohIjA1SuzTlqjSLsOU/8qjBqVcZDwb/ASoN9Sk2p/S+11G 41ewHXpyJJt2R5MWtQfUg1BUd8E4X3F2G03JZZT84xwqNYVS+n7MqFhClSs6OP4Wbtk68vS/pocRU Gqr3lUM1BFQEXP4mdWmSYt6RPyQg30gnUBC2CO46kJummN9wMGSiPhrzrWbAhjZrrUuCiiBo7bGDt coEk5C3v1t9/1+uoggI3xQ==; Date: Fri, 21 Aug 2026 20:53:19 +0300 Message-Id: <86mrufz7g0.fsf@gnu.org> From: Eli Zaretskii To: Tom Tromey Cc: gdb-patches@sourceware.org In-Reply-To: <20260821161828.1836622-1-tromey@adacore.com> (message from Tom Tromey on Fri, 21 Aug 2026 10:18:28 -0600) Subject: Re: [PATCH] Ignore the last EXIT_THREAD_DEBUG_EVENT on Windows References: <20260821161828.1836622-1-tromey@adacore.com> 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 > From: Tom Tromey > Cc: Tom Tromey > Date: Fri, 21 Aug 2026 10:18:28 -0600 > > The Windows non-stop series caused some regressions in the internal > AdaCore test suite. I filed this as PR tdep/34195. I finally found > some time to look into the problem, and this patch is the result. > > The symptom of the problem is that some fairly ordinary tests -- like > a test to simply run a do-nothing program to completion -- would fail > because gdb would print "No unwaited-for children left." > > I bisected the problem to commit ae2f226d ("Windows gdb: Add non-stop > support"). > > Instrumenting the test suite to enable logging showed something > strange: in the failing case, we'd see and EXIT_THREAD_DEBUG_EVENT for > each thread, but never an EXIT_PROCESS_DEBUG_EVENT. > > And, since gdb didn't see or handle an EXIT_PROCESS_DEBUG_EVENT, the > process would remain live -- one of the internal AdaCore tests checks > this (via some "ps" equivalent), causing a separate failure. > > After a lot of experimentation I came up with this patch. It changes > gdb to ignore the final EXIT_THREAD_DEBUG_EVENT, waiting instead for > an EXIT_PROCESS_DEBUG_EVENT to do the cleanup. This fixed the > regressions in my testing. How can we know that a given thread is a "final" one, when Windows is known to start its own threads for the program being debugged? Are you sure there are no such threads left running after all the threads known to GDB exit, and cause this issue? > 1. It only happened under load, I was never able to reproduce it by > running a single test case. What do you mean by "load" in this case? what kind of load? Thanks.