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:
parent
20cc2799af
commit
a0e001a234
1 changed files with 1 additions and 1 deletions
|
@ -1258,8 +1258,8 @@ procstopwait(Proc *p, int ctl)
|
||||||
qunlock(&p->debug);
|
qunlock(&p->debug);
|
||||||
up->psstate = "Stopwait";
|
up->psstate = "Stopwait";
|
||||||
if(waserror()) {
|
if(waserror()) {
|
||||||
p->pdbg = nil;
|
|
||||||
qlock(&p->debug);
|
qlock(&p->debug);
|
||||||
|
p->pdbg = nil;
|
||||||
nexterror();
|
nexterror();
|
||||||
}
|
}
|
||||||
sleep(&up->sleep, procstopped, p);
|
sleep(&up->sleep, procstopped, p);
|
||||||
|
|
Loading…
Reference in a new issue