Hard stop not working on Windows
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
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.