Date: Mon, 8 Aug 2005 22:30:38 +0200 (CEST) From: Antoine Pelisse <apelisse@gmail.com> To: FreeBSD-gnats-submit@FreeBSD.org Subject: kern/84684: [PATCH] Kernel panic in kern_proc.c Message-ID: <200508082030.j78KUcbR006263@hellmuth.xloling.org> Resent-Message-ID: <200508082040.j78KeENf082892@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 84684 >Category: kern >Synopsis: [PATCH] Kernel panic in kern_proc.c >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Aug 08 20:40:13 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Antoine Pelisse >Release: FreeBSD 7.0-CURRENT i386 >Organization: Xloling >Environment: System: FreeBSD hellmuth.xloling.org 7.0-CURRENT FreeBSD 7.0-CURRENT #21: Mon Aug 8 15:06:49 CEST 2005 i386 >Description: Fix for kernel panics: http://people.freebsd.org/~pho/stress/log/cons149.html http://people.freebsd.org/~pho/stress/log/cons130.html >How-To-Repeat: >Fix: --- sys/kern/kern_proc.c.orig Mon Apr 18 04:10:36 2005 +++ sys/kern/kern_proc.c Mon Aug 8 22:00:27 2005 @@ -868,7 +868,7 @@ { struct thread *td; struct kinfo_proc kinfo_proc; - int error = 0; + int error, buffersize = 0; struct proc *np; pid_t pid = p->p_pid; @@ -883,11 +883,23 @@ } else { _PHOLD(p); FOREACH_THREAD_IN_PROC(p, td) { + buffersize += sizeof(struct kinfo_proc); + } + PROC_UNLOCK(p); + + buffersize += 5 * sizeof(struct kinfo_proc); + error = sysctl_wire_old_buffer(req, buffersize); + if (error) { + _PRELE(p); + return error; + } + + PROC_LOCK(p); + FOREACH_THREAD_IN_PROC(p, td) { fill_kinfo_thread(td, &kinfo_proc); - PROC_UNLOCK(p); error = SYSCTL_OUT(req, (caddr_t)&kinfo_proc, sizeof(kinfo_proc)); - PROC_LOCK(p); + if (error) break; } >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200508082030.j78KUcbR006263>