From: Eli Zaretskii <eliz@gnu.org>
To: Hannes Domani <ssbssa@yahoo.de>, Tom Tromey <tromey@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Windows gdb: Don't abort get_windows_debug_event with no threads
Date: Wed, 26 Aug 2026 21:32:06 +0300 [thread overview]
Message-ID: <86ld9sohqx.fsf@gnu.org> (raw)
In-Reply-To: <20260826182037.757713-1-ssbssa@yahoo.de> (message from Hannes Domani on Wed, 26 Aug 2026 20:20:37 +0200)
> 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?
next prev parent reply other threads:[~2026-08-26 18:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260826182037.757713-1-ssbssa.ref@yahoo.de>
2026-08-26 18:20 ` Hannes Domani
2026-08-26 18:32 ` Eli Zaretskii [this message]
2026-08-27 15:25 ` Tom Tromey
2026-08-27 16:18 ` Hannes Domani
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86ld9sohqx.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=ssbssa@yahoo.de \
--cc=tromey@adacore.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox