From owner-freebsd-bugs@FreeBSD.ORG Tue Apr 12 13:20:10 2011 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 C0F7C1065676 for ; Tue, 12 Apr 2011 13:20:10 +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 839EC8FC1B for ; Tue, 12 Apr 2011 13:20:10 +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 p3CDKA4u097378 for ; Tue, 12 Apr 2011 13:20:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p3CDKAhS097377; Tue, 12 Apr 2011 13:20:10 GMT (envelope-from gnats) Resent-Date: Tue, 12 Apr 2011 13:20:10 GMT Resent-Message-Id: <201104121320.p3CDKAhS097377@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, Petr Lampa Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84AFF1065678 for ; Tue, 12 Apr 2011 13:11:02 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 591B68FC14 for ; Tue, 12 Apr 2011 13:11:02 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p3CDB1R1049804 for ; Tue, 12 Apr 2011 13:11:01 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p3CDB1qG049803; Tue, 12 Apr 2011 13:11:01 GMT (envelope-from nobody) Message-Id: <201104121311.p3CDB1qG049803@red.freebsd.org> Date: Tue, 12 Apr 2011 13:11:01 GMT From: Petr Lampa To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/156352: misleading "maxproc limit exceeded by uid" message 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, 12 Apr 2011 13:20:10 -0000 >Number: 156352 >Category: kern >Synopsis: misleading "maxproc limit exceeded by uid" message >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Apr 12 13:20:10 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Petr Lampa >Release: 8.2-STABLE >Organization: BUT FIT >Environment: FreeBSD xxxx 8.2-STABLE FreeBSD 8.2-STABLE #35: Fri Feb 25 22:05:28 CET 2011 >Description: The message maxproc limit exceeded by uid xxxx, please see tuning(7) and login.conf(5) can be misleading when user hits his process limit. In this case notice about maxproc and tuning is pointless, the message shoud be rather: user xxxx process limit exceeded, see ulimit -u and login.conf Short history. Rev 1.171 (2002) changed handling of user proclimit to "goto fail" - the same as for maxproc case. Rev 1.203 (2003) added the message with this comment: ---- Add a ratelimited message of the form "maxproc limit exceeded by uid %i, please see tuning(7) and login.conf(5)." Which will be triggered whenever a user hits his/her maxproc limit or the systemwide maxproc limit is reached. ---- >How-To-Repeat: >Fix: --- kern_fork.c.old 2011-04-12 15:04:57.000000000 +0200 +++ kern_fork.c 2011-04-12 15:08:48.000000000 +0200 @@ -216,6 +216,7 @@ struct vmspace *vm2; vm_ooffset_t mem_charged; int error; + const char *msg; /* Can't copy and clear. */ if ((flags & (RFFDG|RFCFDG)) == (RFFDG|RFCFDG)) @@ -339,6 +340,7 @@ sx_xlock(&allproc_lock); if ((nprocs >= maxproc - 10 && priv_check_cred(td->td_ucred, PRIV_MAXPROC, 0) != 0) || nprocs >= maxproc) { + msg = "maxproc limit exceeded by uid %i, please see tuning(7) and login.conf(5).\n"; error = EAGAIN; goto fail; } @@ -359,6 +361,7 @@ PROC_UNLOCK(p1); } if (!ok) { + msg = "user %i process limit exceeded, please see ulimit -u and login.conf(5).\n"; error = EAGAIN; goto fail; } @@ -803,8 +806,7 @@ fail: sx_sunlock(&proctree_lock); if (ppsratecheck(&lastfail, &curfail, 1)) - printf("maxproc limit exceeded by uid %i, please see tuning(7) and login.conf(5).\n", - td->td_ucred->cr_ruid); + printf(msg, td->td_ucred->cr_ruid); sx_xunlock(&allproc_lock); #ifdef MAC mac_proc_destroy(newproc); >Release-Note: >Audit-Trail: >Unformatted: