Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows-kill.exe occasionally fails for Windows after May 2020 Update #9

Open
SigmundVik opened this issue Jul 27, 2020 · 2 comments
Open

Comments

@SigmundVik
Copy link

After updating Windows to version 10.0.19041.388 (May 2020 Update), then windows-kill.exe started to occasionally fail like this:

[BOOTCAMP] [sigmund-MAC2-dev] 00:25 0.634 155649M d:\dev>base-00\exe\windows-kill.exe -SIGINT 496
Windows Kill 1.1.4 | Windows Kill Library 3.1.3
RuntimeError: windows-kill-library: ctrl-routine:findAddress:checkAddressIsNotNull

^C

This is for the pre-built windows-kill.exe for 1.1.4.

@SigmundVik
Copy link
Author

SigmundVik commented Jul 27, 2020

It seems to work again if I change the CtrlRoutine::findAddressByStackBackTrace() function to this:

	void CtrlRoutine::findAddressByStackBackTrace() {
		HMODULE hModule = GetModuleHandleA("kernel32.dll");
		if (hModule != NULL) {
			this->address = (LPTHREAD_START_ROUTINE)GetProcAddress(hModule, "CtrlRoutine");
		}
	}

Edit: This has been tested and works on both Windows 7 and 10.

@LiamKarlMitchell
Copy link

LiamKarlMitchell commented Nov 7, 2020

Also getting this when running 32bit to try to kill 64bit process.
SystemError system:5: remote-process:startRemoteThread:CreateRemoteThread: Access is denied.

When using correct exe release however, I am still seeing checkAddressIsnotNull occassionaly.
On top of that when running from a bat file it shows "Terminate batch job (y/n)"

In my use-case Bat files call bat files which start bat files and keep process restarting if it closes unexpectedly.
I want a clean shutdown with SIGINT which will also close the bat files that keep restarting the process so this works somewhat.

Got around this with the following

REM ===
REM sub runme (A work around to not get "Terminate batch job (Y/N)" when running windows-kill)
REM ===
:runme
%*
goto :EOF


call :runme start /w "Child Process" %comspec% /c "windows-kill -SIGINT %PID% & exit 12345" <NUL >NUL 2>NUL

Also I think that the exit codes returned from int main should be 0 for success something else for errors?

Good also if windows-kill can have a -w wait for clean close option.

Domain added a commit to Domain/windows-kill that referenced this issue Apr 28, 2022
jmalopoy added a commit to jmalopoy/windows-kill that referenced this issue Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants