From owner-freebsd-current Wed May 22 15:26: 9 2002 Delivered-To: freebsd-current@freebsd.org Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by hub.freebsd.org (Postfix) with ESMTP id 059D537B40F for ; Wed, 22 May 2002 15:26:04 -0700 (PDT) Received: by flood.ping.uio.no (Postfix, from userid 2602) id 765D75307; Thu, 23 May 2002 00:26:01 +0200 (CEST) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: Miguel Mendez Cc: Kris Kennaway , current@FreeBSD.ORG Subject: Re: Problems with DP1 References: <20020521153334.A28241@energyhq.homeip.net> <20020521152746.A32988@xor.obsecurity.org> <20020522142103.A35455@energyhq.homeip.net> From: Dag-Erling Smorgrav Date: 23 May 2002 00:26:00 +0200 In-Reply-To: <20020522142103.A35455@energyhq.homeip.net> Message-ID: Lines: 51 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Miguel Mendez writes: > I've attached both a backtrace and my dmesg. Is any extra info needed? RTFAQ. > #10 0xc01d5899 in panic (fmt=0xc02fed34 "setrunnable(2)") > at ../../../kern/kern_shutdown.c:647 > #11 0xc01dbde2 in setrunnable (td=0xd21952a0) at ../../../kern/kern_synch.c:800 > #12 0xc01d8547 in psignal (p=0xd21951a0, sig=23) at ../../../kern/kern_sig.c:1517 Looks like a race: when psignal() was called, the process was stopped or sleeping, but by the time setrunnable() was called, it was running. Something is touching p_stat without acquiring sched_lock (psignal() acquires it before examining p_stat, and holds it until it returns; setrunnable() also acquires it - recusrively since psignal() already holds it) Somebody[tm] should take a close look at p_stat, where it's modified and how it's protected, specifically: des@des ~% current -nw p_stat | grep 'p_stat =[^=]' sys/alpha/linux/linux_machdep.c: 183: p2->p_stat = SRUN; sys/i386/linux/linux_machdep.c: 364: p2->p_stat = SRUN; sys/kern/init_main.c: 329: p->p_stat = SRUN; sys/kern/init_main.c: 665: initproc->p_stat = SRUN; sys/kern/kern_condvar.c: 118: td->td_proc->p_stat = SSLEEP; sys/kern/kern_condvar.c: 152: td->td_proc->p_stat = SRUN; sys/kern/kern_condvar.c: 491: td->td_proc->p_stat = SRUN; sys/kern/kern_fork.c: 414: p2->p_stat = SIDL; /* protect against others */ sys/kern/kern_fork.c: 701: p2->p_stat = SRUN; sys/kern/kern_idle.c: 63: p->p_stat = SRUN; sys/kern/kern_intr.c: 204: p->p_stat = SWAIT; sys/kern/kern_intr.c: 233: p->p_stat = SRUN; /* XXXKSE */ sys/kern/kern_intr.c: 392: p->p_stat = SRUN; sys/kern/kern_intr.c: 552: p->p_stat = SWAIT; /* we're idle */ sys/kern/kern_kthread.c: 112: p2->p_stat = SRUN; sys/kern/kern_mutex.c: 588: td->td_proc->p_stat = SMTX; sys/kern/kern_mutex.c: 725: td1->td_proc->p_stat = SRUN; sys/kern/kern_synch.c: 495: td->td_proc->p_stat = SSLEEP; sys/kern/kern_synch.c: 629: td->td_proc->p_stat = SRUN; sys/kern/kern_synch.c: 674: td->td_proc->p_stat = SRUN; sys/kern/kern_synch.c: 812: td->td_proc->p_stat = SRUN; sys/kern/kern_sig.c: 1441: p->p_stat = SSLEEP; sys/kern/kern_sig.c: 1709: p->p_stat = SSTOP; sys/kern/kern_exit.c: 436: p->p_stat = SZOMB; One of these is touching p_stat without holding sched_lock. DES -- Dag-Erling Smorgrav - des@ofug.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message