Repository navigation
Conversation
|
It's a "Error: Process completed with exit code 2304." right away in the top flaky |
|
A more closely related PR was 4e203f6 #17054, edit: or perhaps give the gentle kill another chance after #22487? |
There was a problem hiding this comment.
Pull request overview
Adds a build-time switch to disable the Win32 hidden-window message loop used by the test servers on Windows, enabling the servers to run as plain console apps (including in CI) while keeping UWP behavior consistent.
Changes:
- Introduces/uses
CURL_NO_WIN32_WNDto compile out the hidden window + message loop on Windows (tests/server/util.c). - Makes UWP builds implicitly behave as “no Win32 window handler” via a compatibility define (
tests/server/util.c). - Updates Windows CI jobs to compile with
-DCURL_NO_WIN32_WND(.github/workflows/windows.yml).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/server/util.c | Adds CURL_NO_WIN32_WND gating for the hidden window/thread used for WM_CLOSE-based termination. |
| .github/workflows/windows.yml | Forces CI builds to define CURL_NO_WIN32_WND so servers run without the hidden window handler. |
Suppressed comments (1)
tests/server/util.c:643
WaitForSingleObjectEx()returnsWAIT_OBJECT_0(0) on success, so the currentif(WaitForSingleObjectEx(...))condition skips the success path and can leakthread_main_window(and, withbAlertable=TRUE, may also treatWAIT_IO_COMPLETIONas success and close the handle before the thread has exited). Consider looping pastWAIT_IO_COMPLETIONand explicitly checking forWAIT_OBJECT_0before closing the handle and clearing the IDs.
if(WaitForSingleObjectEx(thread_main_window, INFINITE, TRUE)) {
if(CloseHandle(thread_main_window)) {
thread_main_window = NULL;
thread_main_id = 0;
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
That's what Copilot generated as a low-confidence report. They are often legit. (it's also unrelated to the change in this PR, I mean besides disabling this partical code in CI) tests/server/util.c:643 if(WaitForSingleObjectEx(thread_main_window, INFINITE, TRUE)) {
if(CloseHandle(thread_main_window)) {
thread_main_window = NULL;
thread_main_id = 0;
} |
d1a2e35 to
3d69669
Compare
|
FTR, this too: |
|
Letting this sit for a few days to see if previous changes made any difference. |
But, when using vcpkg with cmake, it seems that the configuration display ends up not showing certain settings, that were actually passed through the command-line.
curl already built like this in UWP mode; add a macro to allow building
regular Win32 targets too, meaning without the hidden GUI window, window
handler, and thus without support for shutting down
servers.exegracefully. To test the server in CI as a plain console app and remove
one component/variable from the system, in an effort chasing flaky runs.
The graceful option was used by
taskkill(without-f) in runtests,and it has been disabled (in favor of always
-f(forced) kill), in anattempt to avoid taskkill hanging. Those resolved, but general CI
flakiness remained. We see
taskkillinvoked seldom per job, and inmost of these cases it doesn't find the PID requested. It means the
graceful option is not actually used since 2025-04, and rather rarely
before that. Also just today, the callback and main loop received a few
updates to avoid potentially unsafe calls and interaction with the ctrl
handler.
Not expecting anything breakthrough here. Also graceful shutdown
is a useful feature to cleanup properly and to be in sync with other
platforms.
Also: GHA/windows: enable in Windows CI jobs.
Ref: https://learn.microsoft.com/windows/console/registering-a-control-handler-function#listen-with-hidden-window-example
Follow-up to 7db9947 #22045
Follow-up to 9ea4881 #22487
Follow-up to b11e002 #22495
Follow-up to 208b877 #21039
Follow-up to f450f38 #19897
Follow-up to 2701ac6 #19421
Follow-up to 4e203f6 #17054
Note: this may interact with #22487, which aims to simplify signal
handling and removes a
raise()call in favor of a direct functioncall to trigger shutdown in the window handler. It also interacts with
#22495 (and its history PRs) which enables/disables the use of
taskkillin CI runtests. It may also interact with #22045, which aims to remove
potentially unsafe calls made from handlers, amonst them the window
handler, and the window event processing loop.