Skip to content

runtests: assume Time::HiRes, drop Perl Win32 dependency#18287

Closed
vszakats wants to merge 7 commits intocurl:masterfrom
vszakats:t-w1
Closed

runtests: assume Time::HiRes, drop Perl Win32 dependency#18287
vszakats wants to merge 7 commits intocurl:masterfrom
vszakats:t-w1

Conversation

@vszakats
Copy link
Copy Markdown
Member

@vszakats vszakats commented Aug 14, 2025

Time::HiRes was already used unconditionally before this patch in
servers.pm. This package, and functions used by runtests (sleep and
gettimeofday) are supported by the minimum Perl version required for
curl:

https://perldoc.perl.org/5.8.0/Time::HiRes


Most likely doesn't make a difference in practice.

@vszakats vszakats marked this pull request as draft August 14, 2025 11:37
@github-actions github-actions bot added the tests label Aug 14, 2025
@vszakats vszakats changed the title processhelp.pm: try to avoid loading Win32.dll processhelp.pm: try to avoid a Win32-specific call Aug 14, 2025
@vszakats vszakats changed the title processhelp.pm: try to avoid a Win32-specific call processhelp.pm: try to avoid Win32-specific sleep call Aug 14, 2025
@vszakats vszakats changed the title processhelp.pm: try to avoid Win32-specific sleep call processhelp.pm: avoid Win32-specific sleep call Aug 14, 2025
@vszakats vszakats marked this pull request as ready for review August 14, 2025 12:39
it's present in all supported Perl versions.
It's also already used unconditionally from servers.pm.

https://perldoc.perl.org/5.8.0/Time::HiRes
@vszakats vszakats changed the title processhelp.pm: avoid Win32-specific sleep call processhelp.pm: drop Win32-specific sleep call, and sleep wrapper Aug 14, 2025
@vszakats vszakats changed the title processhelp.pm: drop Win32-specific sleep call, and sleep wrapper processhelp.pm: drop sleep wrapper, and the Win32 dependency with it Aug 14, 2025
@vszakats vszakats changed the title processhelp.pm: drop sleep wrapper, and the Win32 dependency with it runtests: assume Time::HiRes, drop Win32 dependency Aug 14, 2025
@vszakats vszakats marked this pull request as draft August 14, 2025 13:06
@vszakats vszakats changed the title runtests: assume Time::HiRes, drop Win32 dependency runtests: assume Time::HiRes, drop Perl Win32 dependency Aug 14, 2025
@vszakats vszakats marked this pull request as ready for review August 14, 2025 13:39
@vszakats vszakats added Windows Windows-specific tidy-up labels Aug 14, 2025
@vszakats vszakats closed this in be01b60 Aug 14, 2025
@vszakats vszakats deleted the t-w1 branch August 14, 2025 14:34
@vszakats
Copy link
Copy Markdown
Member Author

vszakats commented Aug 14, 2025

And indeed the fork error remains, but it's now happening not with Win32.dll, but
some other components, this time without a name:

  === End of file commands.log
        0 [main] sh 8300 dofork: child -1 - forked process 13096 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
  sh: fork: retry: Resource temporarily unavailable
        0 [main] sh 8302 dofork: child -1 - forked process 12976 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
  sh: fork: retry: Resource temporarily unavailable
        0 [main] sh 8304 dofork: child -1 - forked process 2800 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
  sh: fork: retry: Resource temporarily unavailable
        0 [main] sh 8305 dofork: child -1 - forked process 13112 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
  sh: fork: retry: Resource temporarily unavailable
        0 [main] sh 8308 dofork: child -1 - forked process 11900 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
  sh: fork: retry: Resource temporarily unavailable
  1011832 [main] sh 8300 dofork: child -1 - forked process 10456 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
  sh: fork: retry: Resource temporarily unavailable
  1003261 [main] sh 8302 dofork: child -1 - forked process 8424 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
  sh: fork: retry: Resource temporarily unavailable
        0 [main] sh 8314 dofork: child -1 - forked process 13244 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
  sh: fork: retry: Resource temporarily unavailable
        0 [main] sh 8315 dofork: child -1 - forked process 10868 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
  sh: fork: retry: Resource temporarily unavailable
  1004164 [main] sh 8304 dofork: child -1 - forked process 11892 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
   998926 [main] sh 8305 dofork: child -1 - forked process 9436 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
  sh: fork: retry: Resource temporarily unavailable
  sh: fork: retry: Resource temporarily unavailable
  1009453 [main] sh 8308 dofork: child -1 - forked process 4808 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
  sh: fork: retry: Resource temporarily unavailable
  1003113 [main] sh 8314 dofork: child -1 - forked process 9608 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
  sh: fork: retry: Resource temporarily unavailable
   999918 [main] sh 8315 dofork: child -1 - forked process 12792 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
  sh: fork: retry: Resource temporarily unavailable
  3013327 [main] sh 8300 dofork: child -1 - forked process 13080 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
  sh: fork: retry: Resource temporarily unavailable
  3007128 [main] sh 8302 dofork: child -1 - forked process 7556 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
  sh: fork: retry: Resource temporarily unavailable
  3008969 [main] sh 8304 dofork: child -1 - forked process 6224 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
  3004024 [main] sh 8305 dofork: child -1 - forked process 6440 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
  sh: fork: retry: Resource temporarily unavailable
  sh: fork: retry: Resource temporarily unavailable
  3012533 [main] sh 8308 dofork: child -1 - forked process 8608 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
  sh: fork: retry: Resource temporarily unavailable
        0 [main] sh 8328 dofork: child -1 - forked process 11656 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
  sh: fork: retry: Resource temporarily unavailable
  3002441 [main] sh 8314 dofork: child -1 - forked process 4868 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
  sh: fork: retry: Resource temporarily unavailable
  2999999 [main] sh 8315 dofork: child -1 - forked process 11620 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
  sh: fork: retry: Resource temporarily unavailable
   997773 [main] sh 8328 dofork: child -1 - forked process 12264 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
  sh: fork: retry: Resource temporarily unavailable
  7016623 [main] sh 8300 dofork: child -1 - forked process 9176 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
  sh: fork: retry: Resource temporarily unavailable
  7010141 [main] sh 8302 dofork: child -1 - forked process 12304 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
  sh: fork: retry: Resource temporarily unavailable
  2998462 [main] sh 8328 dofork: child -1 - forked process 13308 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
  sh: fork: retry: Resource temporarily unavailable
  7027697 [main] sh 8304 dofork: child -1 - forked process 8272 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
  7022492 [main] sh 8305 dofork: child -1 - forked process 11148 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
  sh: fork: retry: Resource temporarily unavailable
  sh: fork: retry: Resource temporarily unavailable
  7015011 [main] sh 8308 dofork: child -1 - forked process 10992 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
  sh: fork: retry: Resource temporarily unavailable
  7005512 [main] sh 8314 dofork: child -1 - forked process 12556 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
  sh: fork: retry: Resource temporarily unavailable
  7003605 [main] sh 8315 dofork: child -1 - forked process 11268 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
  sh: fork: retry: Resource temporarily unavailable

https://github.com/curl/curl/actions/runs/16971072810/job/48107907170?pr=18290

vszakats added a commit that referenced this pull request 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
Closes #18308
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

1 participant