From owner-freebsd-current Sun Jun 2 5:28:40 2002 Delivered-To: freebsd-current@freebsd.org Received: from mail.speakeasy.net (mail14.speakeasy.net [216.254.0.214]) by hub.freebsd.org (Postfix) with ESMTP id 6398337B405 for ; Sun, 2 Jun 2002 05:28:31 -0700 (PDT) Received: (qmail 26265 invoked from network); 2 Jun 2002 12:28:30 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail14.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 2 Jun 2002 12:28:30 -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 g52CSoF45801; Sun, 2 Jun 2002 08:28:50 -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 08:28:16 -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 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 <>< 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