← Commit list

2701ac6a4d

Viktor Szakats
Viktor Szakats
2025-11-10
SUCCESS Duration: 145s

Subject

processhelp.pm: log taskkill pid info, add debug envs, enable in CI

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

.github/scripts/typos.toml+1 -1
@@ -4,7 +4,7 @@
[default]
extend-ignore-identifiers-re = [
- "^(ba|pn|PN|UE)$",
+ "^(ba|fo|pn|PN|UE)$",
"^(CNA|ser)$",
"^(ECT0|ECT1|HELO|htpt|PASE)$",
"^[A-Za-z0-9_-]*(EDE|GOST)[A-Z0-9_-]*$", # ciphers
.github/workflows/windows.yml+1 -0
@@ -37,6 +37,7 @@ permissions: {}
env:
CURL_CI: github
+ CURL_TEST_NO_TASKKILL: '1'
jobs:
cygwin:
tests/processhelp.pm+46 -8
@@ -169,10 +169,29 @@ sub pidterm {
if($has_win32_process) {
Win32::Process::KillProcess($pid, 0);
} else {
- # https://ss64.com/nt/taskkill.html
- my $cmd = "taskkill -f -t -pid $pid >$dev_null 2>&1";
- print "Executing: '$cmd'\n";
- system($cmd);
+ # https://ss64.com/nt/tasklist.html
+ my $result = `tasklist -v -fo list -fi "PID eq $pid" 2>&1`;
+ $result =~ s/\r//g;
+ $result =~ s/\n/ | /g;
+ print "Task info for $pid before taskkill: '$result'\n";
+
+ $result = `powershell -Command "Get-CimInstance -ClassName Win32_Process -Filter 'ParentProcessId=$pid' | Select ProcessId,ParentProcessId,Name,CommandLine"`;
+ $result =~ s/\r//g;
+ print "Task child processes for $pid before taskkill:\n";
+ print "$result\n";
+
+ if(!$ENV{'CURL_TEST_NO_TASKKILL'}) {
+ # https://ss64.com/nt/taskkill.html
+ my $cmd;
+ if($ENV{'CURL_TEST_NO_TASKKILL_TREE'}) {
+ $cmd = "taskkill -f -pid $pid >$dev_null 2>&1";
+ }
+ else {
+ $cmd = "taskkill -f -t -pid $pid >$dev_null 2>&1";
+ }
+ print "Executing: '$cmd'\n";
+ system($cmd);
+ }
}
return;
}
@@ -198,10 +217,29 @@ sub pidkill {
if($has_win32_process) {
Win32::Process::KillProcess($pid, 0);
} else {
- # https://ss64.com/nt/taskkill.html
- my $cmd = "taskkill -f -t -pid $pid >$dev_null 2>&1";
- print "Executing: '$cmd'\n";
- system($cmd);
+ # https://ss64.com/nt/tasklist.html
+ my $result = `tasklist -v -fo list -fi "PID eq $pid" 2>&1`;
+ $result =~ s/\r//g;
+ $result =~ s/\n/ | /g;
+ print "Task info for $pid before taskkill: '$result'\n";
+
+ $result = `powershell -Command "Get-CimInstance -ClassName Win32_Process -Filter 'ParentProcessId=$pid' | Select ProcessId,ParentProcessId,Name,CommandLine"`;
+ $result =~ s/\r//g;
+ print "Task child processes for $pid before taskkill:\n";
+ print "$result\n";
+
+ if(!$ENV{'CURL_TEST_NO_TASKKILL'}) {
+ # https://ss64.com/nt/taskkill.html
+ my $cmd;
+ if($ENV{'CURL_TEST_NO_TASKKILL_TREE'}) {
+ $cmd = "taskkill -f -pid $pid >$dev_null 2>&1";
+ }
+ else {
+ $cmd = "taskkill -f -t -pid $pid >$dev_null 2>&1";
+ }
+ print "Executing: '$cmd'\n";
+ system($cmd);
+ }
}
return;
}