CompileDaemon icon indicating copy to clipboard operation
CompileDaemon copied to clipboard

Hard stop not working on Windows

Open ghost opened this issue 8 years ago • 1 comments

Hi,

while using CompileDaemon on Windows 10 Pro I encountered a strange problem. When I run it as follows

CompileDaemon.exe -command="hello.exe"

I get the following output

2017/07/21 06:24:36 Running build command!
2017/07/21 06:24:37 Build ok.
2017/07/21 06:24:37 Restarting the given command.
2017/07/21 06:24:37 stdout: RUNNING6
2017/07/21 06:24:44 Running build command!
2017/07/21 06:24:45 Build ok.
2017/07/21 06:24:45 Hard stopping the current process..
2017/07/21 06:24:45 Could not kill child process. Aborting due to danger of infinite forks.

For debugging purposes I compiled CompileDaemon myself and added a print statement under the kill statement of the process. There I get the following error message :

TerminateProcess: Access denied

Obviously it isn't possible to kill a process on Windows which was created by exec.Command. Do you have an idea what can be done to fix this problem?

Thanks, Thomas

ghost avatar Jul 21 '17 04:07 ghost

I have found the error myself. I read from stdin in the child program which blocked CompileDaemon from killing the process. After removing the reading from stdin it works as expected.

ghost avatar Jul 21 '17 08:07 ghost