Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 367429

Summary: Stopping a parallel build (make -j) hangs infinitely
Product: [Tools] CDT Reporter: Raphael Zulliger <zulliger>
Component: cdt-build-managedAssignee: Project Inbox <cdt-build-managed-inbox>
Status: NEW --- QA Contact: Jonah Graham <jonah>
Severity: normal    
Priority: P3 CC: cdtdoug
Version: 8.1.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Fix (or workaround) none

Description Raphael Zulliger CLA 2011-12-22 10:41:53 EST
Build Identifier: I20110613-1736

I'm using a self-compiled make.exe (32bit using mingw compiler). When I configure CDT to run only 'make' (without -j option), then I can successfully stop the build (by pressing the red square button in the progress view).

But: If I configuration CDT to use e.g. 'make -j16', stopping the build will fail as soon as make really started compilation (means: during the time when make just figures out whether there's work to be done, stopping still works. But once make started multiple gcc-compilation instances, stopping doesn't work anymore).

The situation can be fixed by manually killing make.exe (e.g. by using the task manager).

Not sure whether it matters, but I'm running Windows 7, 64Bit - while using 32Bit version of Eclipse.

Reproducible: Always

Steps to Reproduce:
1. Use mingw make.exe (32bit)
2. Start compilation (managed build of C/C++ app) by passing a -jx option to make
3. Wait until make started gcc proccesses
4. Press the stop button
5. Stopping takes forever...
6. ... unless you manually kill the make.exe process
Comment 1 Raphael Zulliger CLA 2011-12-22 11:06:14 EST
Created attachment 208740 [details]
Fix (or workaround)

I found a solution or at least a workaround for this issue (I'm not sure what it actually is, as I didn't really understood the problem. Maybe someone out there does have some more knowledge about this topic): 

Fortunately, I remembered some investigations I've done in the past related to starter.exe: https://bugs.eclipse.org/bugs/show_bug.cgi?id=333578. I applied the proposed 'improvement' of that bug report and tried to reproduce the mentioned issue again. => The issue has gone. Stopping a build process perfectly works again.

As mentioned already, I'm not 100% sure whether this is really "the fix". But I could imagine that it is because of the following reasons:
 - the job handling used by starter.exe seems to be broken on Windows 7 64Bit (see 333578)
 - the patch 'fixes' (or at least 'changes') the job handling on it
 - according to my understanding, job handling is an important part of starter.exe when it comes to killing its child processes

It'd be nice if someone could take time to look at the patch and probably apply it to main CDT. Before doing that, someone should probably test the patch by building a 64bit binary of starter.exe.