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

Bug 330282

Summary: AIX spawner should kill all child processes
Product: [Tools] CDT Reporter: Chris Recoskie <recoskie>
Component: cdt-coreAssignee: Chris Recoskie <recoskie>
Status: RESOLVED FIXED QA Contact: Doug Schaefer <cdtdoug>
Severity: major    
Priority: P3 CC: cdt-core-inbox, vivkong
Version: 7.0.1   
Target Milestone: 7.0.2   
Hardware: Other   
OS: AIX Motif   
Whiteboard:
Attachments:
Description Flags
patch recoskie: iplog-

Description Chris Recoskie CLA 2010-11-15 15:08:32 EST
From my email to cdt-dev...

> I have noticed a problem on AIX, in that the Spawner does not seem to kill
> all child processes of the launched process when you call destroy() on them,
> which in turn does a raise() with an appropriate signal. It's a real problem
> because if you do a recursive make, not all of the children will be properly
> killed if you cancel the build.
>
> I dug a bit further and the Linux spawner doesn't have this problem because
> when it tries to send a signal to kill the process in raise(), it first
> tries to use the killpg() system call to send the signal to the entire
> process group rooted at the PID that was spawned. Then if that fails, it
> uses kill() on the process itself.
>
> I.e., it does:
>
> case 9: /* KILL */
> status = killpg(pid, SIGKILL);
> if(status == -1) {
> status = kill(pid, SIGKILL);
> }
> break;
>
> The AIX spawner doesn't use killpg(). It does this:
>
> case 9: /* KILL */
> status = kill(pid, SIGKILL);
> break;
>
> However, the killpg() system call seems available on all the AIX versions
> I've checked (I've checked AIX 5.3 and up so far... 5.3 is the oldest we are
> supporting ourselves with our tools at IBM). Right now I'm inclined to
> modify the AIX spawner so that its behaviour matches that of the Linux
> spawner.
Comment 1 Chris Recoskie CLA 2010-11-17 11:07:36 EST
Created attachment 183309 [details]
patch

Patch attached.

While I was at it, I rebuilt the libraries using XLC v8, so they are likely better optimized now.  CVS won't do patches for binaries, so they contents of those aren't included in the patch.
Comment 3 Chris Recoskie CLA 2010-11-17 11:26:34 EST
Fixed on cdt_7_0 and HEAD.