Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bug#593426: zsh: Status of background jobs not updated



On Thu, 19 Aug 2010 21:22:51 -0700
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Aug 18,  9:09pm, Peter Stephenson wrote:
> }
> } +	    } else if (sig == SIGCONT) {
> } +		Job jn;
> } +		Process pn;
> } +		if (findproc(pid, &jn, &pn, 0)) {
> } +		    if (WIFSTOPPED(pn->status))
> } +			pn->status = SP_RUNNING;
> } +		}
> } +	    }
> 
> Hmm, are we really guaranteed that the job has started running again
> just because we killed it with SIGCONT?  E.g., if the reason it was
> stopped is because it got a TTIN or TTOU, is there a possible race
> here because it's just going to immediately stop again?

Well, signals are queued at this point, so if there's another stop signal
it should be handled after marking the process as continued.

But it would still be better to check the status by waiting at appropriate
points, which needs the fix to take care of the case that the child has
actually exited I mentioned before, which needs a lot of care as it's
dealing with some basic and race-prone stuff.

-- 
Peter Stephenson <pws@xxxxxxx>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom



Messages sorted by: Reverse Date, Date, Thread, Author