Hello "Developers of Gmake"

My name is Anuj. I work as a software developer at Mathworks.

While working on project involving killing 'gmake' process on Windows, we 
encountered an issue that we would like to bring to your attention.

Our aim is to kill the gmake process along with its sub gmakes (child 
processes) on windows and clean up properly (which involves unlinking object 
files).

For this we created a script which would send a 'CTRL + C' event to the main 
gmake process using win32::API of Perl. When we monitor the progress, the main 
gmake and child gmakes are killed properly. We see that the correct signal is 
being propagated to the gmake process. However, the cleanup is not happening as 
expected. When it tries to unlink all these "obj" files, it gives a Permission 
denied error.

To understand more about it we read the source code. We found that while 
handling 'CTRL + C' signal gmake suspends its main thread. While the main 
thread is suspended, it tries to kill the child processes and clean up the 
files. While the files (mainly obj files) are being cleaned up (unlinked) we 
get the Permission denied issue as the file seems to have a lock on it. We 
suspect that this lock is detected by the filer that the file is still in use 
by the compiler which is the main thread. Hence, it gives a Permission Denied 
error. As the file is on the network filer this issue is much more prominent. 
However, when these files are created on the local drive these issues are much 
less visible (Not completely gone but less).

Please let us know if our understanding is correct and also if you are familiar 
with this issue.

Thanks
Anuj Shroff

_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to