From: Eli Zaretskii <eliz@gnu.org>
To: Tom Tromey <tromey@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Ignore the last EXIT_THREAD_DEBUG_EVENT on Windows
Date: Fri, 21 Aug 2026 20:53:19 +0300 [thread overview]
Message-ID: <86mrufz7g0.fsf@gnu.org> (raw)
In-Reply-To: <20260821161828.1836622-1-tromey@adacore.com> (message from Tom Tromey on Fri, 21 Aug 2026 10:18:28 -0600)
> From: Tom Tromey <tromey@adacore.com>
> Cc: Tom Tromey <tromey@adacore.com>
> 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.
next prev parent reply other threads:[~2026-08-21 17:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-21 16:18 Tom Tromey
2026-08-21 17:53 ` Eli Zaretskii [this message]
2026-08-21 18:18 ` Tom Tromey
2026-08-22 5:47 ` Eli Zaretskii
2026-08-27 15:27 ` Tom Tromey
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=86mrufz7g0.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--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