devproc: reset p->pdbg under p->debug qlock in procstopwait()

theres a race where procstopwait() is interrupted by a note,
setting p->pdbg to nil *before* acquiering the lock and
and pexit() and procctl() accessing it assuming it doesnt
change under them while they are holding the lock.
This commit is contained in:
cinap_lenrek 2014-11-07 05:21:42 +01:00
parent 20cc2799af
commit a0e001a234

View file

@ -1258,8 +1258,8 @@ procstopwait(Proc *p, int ctl)
qunlock(&p->debug);
up->psstate = "Stopwait";
if(waserror()) {
p->pdbg = nil;
qlock(&p->debug);
p->pdbg = nil;
nexterror();
}
sleep(&up->sleep, procstopped, p);