Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 02 Jun 2002 08:28:16 -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.20020602082816.jhb@FreeBSD.org>
In-Reply-To: <OE50nubN6sBPo5X3a5i0000fbb5@hotmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On 02-Jun-2002 kai ouyang wrote:
> Based on the explain of the thread: struct proc *td_proc; /* Associated process. */ in the struct
> thread.
> and refer to the CCD code.
> I modify this function as following:
> int raidlookup(path, td, vpp)
>  char   *path;
>  struct thread *td;
>  struct vnode **vpp; /* result */
> {
>  struct nameidata nd;
>  struct vnode *vp;
>  struct vattr va;
>  struct proc *p;
>  int     error, flags;
>  /* Sanity check the p_fd fields.  This is really just a hack */
>  p = td->td_proc;

So it dies here?

> Now the system will be crash , when it excutes the "p = td->td_proc".
> the system Information is :
> kernel: type 12 trap, code=0
> Stopped at raidlookup+0x19: movl 0(%eax),%ebx

Hmm, can you get the 'faulting va (virtual address)' error message that it
prints out?

Add a line to the beginning of the function as a sanity check that does:

KASSERT(td != NULL, "thread is null");

and compile your kernel with invariants and see if it panics with
"thread is null".

-- 

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.20020602082816.jhb>