diff --git a/sys/src/9/port/proc.c b/sys/src/9/port/proc.c index 669c4652f..c101b9988 100644 --- a/sys/src/9/port/proc.c +++ b/sys/src/9/port/proc.c @@ -88,6 +88,9 @@ schedinit(void) /* never returns */ mmurelease(up); unlock(&palloc); + up->mach = nil; + updatecpu(up); + up->qnext = procalloc.free; procalloc.free = up; @@ -411,6 +414,11 @@ ready(Proc *p) Schedq *rq; void (*pt)(Proc*, int, vlong); + if(p->state == Ready){ + print("double ready %s %lud pc %p\n", p->text, p->pid, getcallerpc(&p)); + return; + } + s = splhi(); if(edfready(p)){ splx(s); @@ -601,6 +609,7 @@ newproc(void) p->state = Scheding; p->psstate = "New"; p->mach = 0; + p->eql = 0; p->qnext = 0; p->nchild = 0; p->nwait = 0; diff --git a/sys/src/9/port/qlock.c b/sys/src/9/port/qlock.c index e15569ff5..445161145 100644 --- a/sys/src/9/port/qlock.c +++ b/sys/src/9/port/qlock.c @@ -24,7 +24,8 @@ eqlock(QLock *q) print("eqlock: %#p: ilockdepth %d\n", getcallerpc(&q), m->ilockdepth); if(up != nil && up->nlocks.ref) print("eqlock: %#p: nlocks %lud\n", getcallerpc(&q), up->nlocks.ref); - + if(up != nil && up->eql) + print("eqlock: %#p: eql %p\n", getcallerpc(&q), up->eql); if(q->use.key == 0x55555555) panic("eqlock: q %#p, key 5*\n", q); @@ -58,6 +59,7 @@ eqlock(QLock *q) up->notepending = 0; error(Eintr); } + up->eql = 0; } void @@ -69,7 +71,8 @@ qlock(QLock *q) print("qlock: %#p: ilockdepth %d\n", getcallerpc(&q), m->ilockdepth); if(up != nil && up->nlocks.ref) print("qlock: %#p: nlocks %lud\n", getcallerpc(&q), up->nlocks.ref); - + if(up != nil && up->eql) + print("qlock: %#p: eql %p\n", getcallerpc(&q), up->eql); if(q->use.key == 0x55555555) panic("qlock: q %#p, key 5*\n", q); lock(&q->use);