| Message ID | 20260826182037.757713-1-ssbssa@yahoo.de |
|---|---|
| State | New |
| Headers |
Return-Path: <gdb-patches-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DE5C64BA799C for <patchwork@sourceware.org>; Wed, 26 Aug 2026 18:21:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DE5C64BA799C Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=yahoo.de header.i=@yahoo.de header.a=rsa-sha256 header.s=s2048 header.b=Hn/RHe8d X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from sonic.asd.mail.yahoo.com (sonic-euwe4-0022.asd.mail.yahoo.com [34.2.86.21]) by sourceware.org (Postfix) with ESMTPS id 773564BA2E30 for <gdb-patches@sourceware.org>; Wed, 26 Aug 2026 18:20:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 773564BA2E30 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=yahoo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=yahoo.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 773564BA2E30 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=34.2.86.21 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1787768457; cv=none; b=vX3twX0KEMH7TlIj6ErDKShFNcf/y4nMBv8MuM0S77DzR9BRvKq8i/y9sDUigKzdG2HsaiUwmKoWtm+rnOt4Gm5lQRra+m1S/JZL+sqYJJOKUoZwJR8DvdMTlH85bI7a1m0KMo23MFcFSxyWr2BuABSU73n4P7ZnHtSF/ekainQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1787768457; c=relaxed/simple; bh=fHUUUYdZI42TP3976DmA6xweIul9MRF+sjrkRrJVRFQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=nzT6v7jIaDr3XBn+l4TaShSBZ0NWLJHcuPuEr4NdOyxFUT5vbQgGhRzjVY64krvgugNdblgN7GB/K+i85vD57cBMRZlDTk0QRlvSLl86lMAhQ6mpOYf45Y/a82XDHgDgNdG+yJ0re67FbL5XmrcDfqxbfaGR6GfWx9EP0wL9kG4= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=yahoo.de header.i=@yahoo.de header.a=rsa-sha256 header.s=s2048 header.b=Hn/RHe8d DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 773564BA2E30 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s2048; t=1787768455; bh=Lmsr3bzwrDxabK9DhON7rme5ur+tW7XjcGMbqN07u/o=; h=From:To:Subject:Date:References:From:Subject:Reply-To; b=Hn/RHe8dh0IddmXQ/87GeLN1JNyYPmEhnRmTdXrvXgmf7DKPhDo5DCSHKFycLqTBur1e2b/WnKkFt/z0ucs96lMqeOBHgelUPGQbsFH1+qydRvKw0Ijtet7H+HhEMAGx62luevjZXFfWQTqFxS0JT+oqvuBV6z7a8LCPe4EgByb1ERswPjNfzOrBbMCITC98AruLj+ZL15WS7qaEkuJLvyOceHRgq+jf53cC/RojpIOd/NsW8iN1aqiR97oMtzLIKlEV5ouJEU8lIw77aRngDsQhe66PQxzUxdCmCINZOFNDYErDLRtBgXFrWhJzhPUtLWOiUK6XS5mnevK3icxyPw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1787768455; bh=K/pKvqlJrEIb4CM48n+KtpVOO6KqujT6rPUj8wcU6YS=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=MsJj5WFnl283+1KTZa5on8Ww4ZCGq9nVAtG2CyLK9hKRjSeZXWJ/ZopBoNTvWzkHflU2YDtGbG584FroymPQf/IBTnu3q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uviVdyn2pFhOSooct7jOPLgN2oKiKVRJj5ZbJCLuxvRwaqQxTY OyKOjEfwHKyHn8_w61CAKFJvOeVEv_dU6wv.NzECKvgCFB5vWhaYsMM8.0Qu2KrAVJwNg1bSIpcR Th8TgYObzxJyQAkG1mrefveKXH3vH0Vj1x_tf9wqUxP.uJfpd X-Sonic-MF: <ssbssa@yahoo.de> X-Sonic-ID: f3e1f852-bced-439c-8223-335ea9498ee7 Received: from sonic.gate.mail.ne1.yahoo.com by mail-asdoutdeli-p-cin-euwe4-prod-sonicconsumer-svc-101 with HTTP; Wed, 26 Aug 2026 18:20:55 +0000 Received: from dip164.lsn.ir2.yahoo.com ([87.248.99.173]) by hello (SMTP) with SMTP ID 37d7a214c2d2030473d54f94eb38fda5 for <gdb-patches@sourceware.org>; Wed, 26 Aug 2026 18:20:54 +0000 (UTC) From: Hannes Domani <ssbssa@yahoo.de> To: gdb-patches@sourceware.org Subject: [PATCH] Windows gdb: Don't abort get_windows_debug_event with no threads Date: Wed, 26 Aug 2026 20:20:37 +0200 Message-ID: <20260826182037.757713-1-ssbssa@yahoo.de> X-Mailer: git-send-email 2.54.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit References: <20260826182037.757713-1-ssbssa.ref@yahoo.de> X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> Errors-To: gdb-patches-bounces~patchwork=sourceware.org@sourceware.org |
| Series |
Windows gdb: Don't abort get_windows_debug_event with no threads
|
|
Checks
| Context | Check | Description |
|---|---|---|
| linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 | success | Build passed |
| linaro-tcwg-bot/tcwg_gdb_build--master-arm | success | Build passed |
| linaro-tcwg-bot/tcwg_gdb_check--master-arm | fail | Patch failed to apply |
| linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 | fail | Patch failed to apply |
Commit Message
Hannes Domani
Aug. 26, 2026, 6:20 p.m. UTC
When a machine is under heavy load, windows sometimes provides the debug
events in a weird order:
[windows events] get_windows_debug_event: kernel event for pid=22208 tid=0x6df0 code=CREATE_PROCESS_DEBUG_EVENT
[windows events] get_windows_debug_event: kernel event for pid=22208 tid=0xe74 code=CREATE_THREAD_DEBUG_EVENT
[windows events] get_windows_debug_event: kernel event for pid=22208 tid=0xe74 code=EXIT_THREAD_DEBUG_EVENT
[windows events] get_windows_debug_event: kernel event for pid=22208 tid=0x6df0 code=EXIT_THREAD_DEBUG_EVENT
At this point the process has seemingly no threads, even though for the last
thread there should be EXIT_PROCESS_DEBUG_EVENT instead of
EXIT_THREAD_DEBUG_EVENT. But the next event shows that a new thread was
created, which then finally got EXIT_PROCESS_DEBUG_EVENT:
[windows events] get_windows_debug_event: kernel event for pid=22208 tid=0x5a7c code=CREATE_THREAD_DEBUG_EVENT
[windows events] get_windows_debug_event: kernel event for pid=22208 tid=0x5a7c code=EXIT_PROCESS_DEBUG_EVENT
Since the introduction of non-stop support, gdb fails with this error at
the point of no threads:
No unwaited-for children left.
It's because it added this check which prevents getting the next debug
event:
/* If there are no resumed threads left, bail. */
if (windows_process->windows_initialization_done
&& !any_resumed_thread ())
{
ourstatus->set_no_resumed ();
return minus_one_ptid;
}
This fixes it by changing any_resumed_thread to return true if there is
no thread at all.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34195
---
gdb/windows-nat.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
Comments
> From: Hannes Domani <ssbssa@yahoo.de> > Date: Wed, 26 Aug 2026 20:20:37 +0200 > > When a machine is under heavy load, windows sometimes provides the debug > events in a weird order: > > [windows events] get_windows_debug_event: kernel event for pid=22208 tid=0x6df0 code=CREATE_PROCESS_DEBUG_EVENT > [windows events] get_windows_debug_event: kernel event for pid=22208 tid=0xe74 code=CREATE_THREAD_DEBUG_EVENT > [windows events] get_windows_debug_event: kernel event for pid=22208 tid=0xe74 code=EXIT_THREAD_DEBUG_EVENT > [windows events] get_windows_debug_event: kernel event for pid=22208 tid=0x6df0 code=EXIT_THREAD_DEBUG_EVENT > > At this point the process has seemingly no threads, even though for the last > thread there should be EXIT_PROCESS_DEBUG_EVENT instead of > EXIT_THREAD_DEBUG_EVENT. But the next event shows that a new thread was > created, which then finally got EXIT_PROCESS_DEBUG_EVENT: > > [windows events] get_windows_debug_event: kernel event for pid=22208 tid=0x5a7c code=CREATE_THREAD_DEBUG_EVENT > [windows events] get_windows_debug_event: kernel event for pid=22208 tid=0x5a7c code=EXIT_PROCESS_DEBUG_EVENT > > Since the introduction of non-stop support, gdb fails with this error at > the point of no threads: > > No unwaited-for children left. > > It's because it added this check which prevents getting the next debug > event: > > /* If there are no resumed threads left, bail. */ > if (windows_process->windows_initialization_done > && !any_resumed_thread ()) > { > ourstatus->set_no_resumed (); > return minus_one_ptid; > } > > This fixes it by changing any_resumed_thread to return true if there is > no thread at all. Thanks. Tom, it sounds like this is the root cause of the problem you tried to fix in https://sourceware.org/pipermail/gdb-patches/2026-August/229659.html, no?
>>>>> "Hannes" == Hannes Domani <ssbssa@yahoo.de> writes:
Hannes> This fixes it by changing any_resumed_thread to return true if there is
Hannes> no thread at all.
Hannes> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34195
Thanks, this is ok.
Please apply it to gdb-18 as well.
Tom
Am Donnerstag, 27. August 2026 um 17:25:28 MESZ hat Tom Tromey <tom@tromey.com> Folgendes geschrieben: > >>>>> "Hannes" == Hannes Domani <ssbssa@yahoo.de> writes: > > Hannes> This fixes it by changing any_resumed_thread to return true if there is > Hannes> no thread at all. > > Hannes> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34195 > > Thanks, this is ok. > Please apply it to gdb-18 as well. Thanks. I've pushed it to master and gdb-18-branch after adding this: Approved-By: Tom Tromey <tom@tromey.com> Hannes
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 4cd301d4959..2fa15ada27a 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -1367,15 +1367,20 @@ windows_nat_target::thread_events (bool enable) m_report_thread_events = enable; } -/* True if there is any resumed thread. */ +/* True if there is any resumed thread, or no thread at all. */ bool windows_nat_target::any_resumed_thread () { + bool has_thread = false; for (thread_info &thread : all_non_exited_threads (this)) - if (thread.internal_state () == THREAD_INT_RUNNING) - return true; - return false; + { + has_thread = true; + if (thread.internal_state () == THREAD_INT_RUNNING) + return true; + } + DEBUG_EVENTS ("any_resumed_thread: has_thread=%d", has_thread); + return !has_thread; } /* Called for both EXIT_THREAD_DEBUG_EVENT and