From owner-freebsd-hackers Wed Jul 11 16:15:22 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mail1.javanet.com (mail1.javanet.com [205.219.162.10]) by hub.freebsd.org (Postfix) with ESMTP id 75EB837B403 for ; Wed, 11 Jul 2001 16:15:19 -0700 (PDT) (envelope-from kaworu@sektor7.ath.cx) Received: from wintermute.sekt7 (209-6-248-16.c3-0.lex-ubr1.sbo-lex.ma.cable.rcn.com [209.6.248.16]) by mail1.javanet.com (8.9.3/8.9.2) with ESMTP id TAA27608 for ; Wed, 11 Jul 2001 19:16:13 -0400 (EDT) Date: Wed, 11 Jul 2001 19:16:11 -0400 (EDT) Message-Id: <200107112316.TAA27608@mail1.javanet.com> From: Evan Sarmiento To: freebsd-hackers@freebsd.org Subject: pfind() question Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hello, I have a small dilema. My module finds a pointer to a specific proc structure by calling pfind(pid). It then makes changes to that process structure and returns 0. However, when I try and use this seemingly simple code, it core dumps. This is the actual panic message: [teqnix](~/work/jailuser/current/src/sys/compile/KAWORU)%gdb -k kernel.debug /home/kaworu/vmcore.0 GNU gdb 4.18 Copyright 1998 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-unknown-freebsd"... SMP 0 cpus IdlePTD 27757 initial pcb at 332d00 panic messages: --- dmesg: kvm_read: invalid address (c032a380) --- cannot read proc pointer at ff800004 And here's my code: int prfw_setflags(p, uap) struct proc *p; struct prfw_setflags_r *uap; { register struct proc *nproc; ... if (uap->id) { if((nproc = pfind(uap->id)) == NULL) return (0); } ... nproc->p_flag |= P_JAILED; } Am I allowed to change information in this proc structure? Thanks a lot, Evan Sarmiento To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message