Date: Sun, 02 Jun 2002 23:49:20 -0400 (EDT) From: John Baldwin <jhb@FreeBSD.org> To: kai ouyang <oykai@msn.com> Cc: current@FreeBSD.org Subject: Re:Help: from proc to thread? Message-ID: <XFMail.20020602234920.jhb@FreeBSD.org> In-Reply-To: <OE73usjzpDr3Di32AvJ00011357@hotmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <jhb@FreeBSD.org> <>< 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20020602234920.jhb>