Skip to content

processhelp.pm: use Win32::Process* perl modules if available#18308

Closed
vszakats wants to merge 1 commit intocurl:masterfrom
vszakats:t-win32p
Closed

processhelp.pm: use Win32::Process* perl modules if available#18308
vszakats wants to merge 1 commit intocurl:masterfrom
vszakats:t-win32p

Conversation

@vszakats
Copy link
Member

@vszakats vszakats commented Aug 18, 2025

Win32::Process::List and Win32::Process.

To replace external calls to tasklist.exe and taskkill.exe.

The perl modules are wrappers/binding to Win32 API calls. They avoid
launching external processes with a command shell (including MSYS2),
the external tool, and creating command-lines and parsing tool output.

According to local tests and the CI, one test session calls
tasklist.exe 350-400 times. taskkill.exe is rarely called:
https://github.com/curl/curl/actions/runs/17012376726?pr=18296

It's hard to predict any possible side-effect of dynamically loading
the two necessary, module DLLs into the Perl process. The MSYS2 runtime
if prone to fail when doing this in fork operations, as seen earlier
with the Win32.DLL module. But, is looks like a symptom, not the root
cause for these failures, because the failures are present with or
without perl.exe loading the Win32.DLL.
Ref: be01b60 #18287

Cherry-picked from #18296

`Win32::Process::List` and `Win32::Process`.

To replace external calls to `tasklist.exe` and `taskkill.exe`.

The perl modules are more efficient by not launching a command shell
(including MSYS2) and an external process, then parse their output.

According to local tests and the CI, one test session calls
`tasklist.exe` 350-400 times. `taskkill.exe` is rarely called and often
not called at all:
https://github.com/curl/curl/actions/runs/17012376726?pr=18296

Cherry-picked from curl#18296
@vszakats vszakats added tests Windows Windows-specific labels Aug 18, 2025
@vszakats vszakats closed this in 2388b0e Aug 18, 2025
@vszakats vszakats deleted the t-win32p branch August 18, 2025 21:47
vszakats added a commit that referenced this pull request Aug 19, 2025
To make the CI jobs use native Win32 API calls instead of calling
external tools to look up and kill PIDs of native Windows test server
processes.

Follow-up to 2388b0e #18308
Closes #18296
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Windows Windows-specific

Development

Successfully merging this pull request may close these issues.

1 participant