From owner-freebsd-current Sun Jun 2 20:49:58 2002 Delivered-To: freebsd-current@freebsd.org Received: from mail.speakeasy.net (mail12.speakeasy.net [216.254.0.212]) by hub.freebsd.org (Postfix) with ESMTP id 5107137B400 for ; Sun, 2 Jun 2002 20:49:49 -0700 (PDT) Received: (qmail 29539 invoked from network); 3 Jun 2002 03:49:45 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail12.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 3 Jun 2002 03:49:45 -0000 Received: from laptop.baldwin.cx (laptop.baldwin.cx [192.168.0.4]) by server.baldwin.cx (8.11.6/8.11.6) with ESMTP id g533ntF47831; Sun, 2 Jun 2002 23:49:55 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: Date: Sun, 02 Jun 2002 23:49:20 -0400 (EDT) From: John Baldwin To: kai ouyang Subject: Re:Help: from proc to thread? Cc: current@FreeBSD.org 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 On 03-Jun-2002 kai ouyang wrote: > Yeah, thread is NULL. > But I view all the callers, I did not find any assignment to td. > I do not know the kernel how assign td to the structure. > The RAIDFrame has the similar function as the vinum. I find this problem > when I config a RAID level volume. > Now, I check the raidctlioctl() function,because the process is here from user space to > kernel space. > Because the raidlookup's td is gotten from raidctlioctl() function. > I add the two line to the latter function. > KASSERT(td != NULL, ("raidctlioctl thread is NULL")); > KASSERT(raidPtr->engine_thread != NULL, ("raidctlioctl engine thread is NULL")); > It debugs in the second line. So, the raidctlioctl funcion has the td, but didn't > transfer the parameter to the raidlookup(). > Hmmmm.... > I take place the two line by the following lines: > KASSERT(td != NULL, ("raidctlioctl thread is NULL")); > raidPtr->engine_thread = td; > KASSERT(raidPtr->engine_thread != NULL, ("raidctlioctl engine thread is NULL")); > now it pass. > I want to know when the kernel assign td to raidctlioctl function? The kernel passes the thread pointer for the current thread down the stack to the ioctl routine. > Now, the RAIDFrame will be crash here: > RF_THREADGROUP_WAIT_START(&raidPtr->engine_tg); > panic: runq_choose: process 218(raid) in state 3 > Debugger("panic") > Stopped at Debugger+0x40: xorl %eax,%eax It looks like you made a thread runnable and then changed it's p_stat to SSLEEP while it was on the run queue. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message