From owner-freebsd-bugs@FreeBSD.ORG Tue Apr 6 14:50:05 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D73D1065675 for ; Tue, 6 Apr 2010 14:50:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 09EE78FC23 for ; Tue, 6 Apr 2010 14:50:05 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o36Eo4t3011959 for ; Tue, 6 Apr 2010 14:50:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o36Eo4IM011958; Tue, 6 Apr 2010 14:50:04 GMT (envelope-from gnats) Resent-Date: Tue, 6 Apr 2010 14:50:04 GMT Resent-Message-Id: <201004061450.o36Eo4IM011958@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "David E. Cross" Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0980E1065672 for ; Tue, 6 Apr 2010 14:47:27 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id EBE8E8FC26 for ; Tue, 6 Apr 2010 14:47:26 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o36ElQ3B030695 for ; Tue, 6 Apr 2010 14:47:26 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o36ElQSG030692; Tue, 6 Apr 2010 14:47:26 GMT (envelope-from nobody) Message-Id: <201004061447.o36ElQSG030692@www.freebsd.org> Date: Tue, 6 Apr 2010 14:47:26 GMT From: "David E. Cross" To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/145434: Kernel messages about processes don't include Jail Identifier X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Apr 2010 14:50:05 -0000 >Number: 145434 >Category: kern >Synopsis: Kernel messages about processes don't include Jail Identifier >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Apr 06 14:50:04 UTC 2010 >Closed-Date: >Last-Modified: >Originator: David E. Cross >Release: 8.0-RELEASE-amd64 >Organization: Humor Rainbow Inc. >Environment: FreeBSD foo.bar.baz 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #0: Mon Apr 5 14:42:00 EDT 2010 root@foo.bar.baz:/usr/obj/usr/src/sys/GENERIC amd64 >Description: Processes which exit abnormally display a kernel message to this effect that includes some basic information about the process. Its PID, its UID, its name. On a machine with a lot of jails, this information can be essentially useless. Consider a webhost with 50 jails serving PHP via fastcgi and one is crashing, its near impossible to track it down with just the information as currently provided. >How-To-Repeat: Try to trace down a coredump on a machine with lots of jails >Fix: Apply the included patch. Patch attached with submission follows: --- sys/kern/kern_sig.c.orig 2009-10-24 21:10:29.000000000 -0400 +++ sys/kern/kern_sig.c 2010-04-06 10:44:42.000000000 -0400 @@ -57,6 +57,8 @@ #include #include #include +#include +#include #include #include #include @@ -2733,8 +2735,9 @@ sig |= WCOREFLAG; if (kern_logsigexit) log(LOG_INFO, - "pid %d (%s), uid %d: exited on signal %d%s\n", + "pid %d (%s), jid %d, uid %d: exited on signal %d%s\n", p->p_pid, p->p_comm, + (td->td_ucred && td->td_ucred->cr_prison) ? td->td_ucred->cr_prison->pr_id : 0, td->td_ucred ? td->td_ucred->cr_uid : -1, sig &~ WCOREFLAG, sig & WCOREFLAG ? " (core dumped)" : ""); >Release-Note: >Audit-Trail: >Unformatted: