Bug 156352 - [kernel] [patch] misleading "maxproc limit exceeded by uid" message
Summary: [kernel] [patch] misleading "maxproc limit exceeded by uid" message
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 8.2-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2011-04-12 14:20 UTC by lampa
Modified: 2022-10-17 12:38 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lampa 2011-04-12 14:20:10 UTC
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.
----

Fix: 

/* 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);--SmZwCCc4Iz80HB9RjZ98hzP3z8maNe5dCMZq2N6EMM21q3Ml
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

--- 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;
Comment 1 Hiren Panchasara freebsd_committer freebsd_triage 2013-05-15 08:41:46 UTC
Responsible Changed
From-To: freebsd-bugs->hiren

Grab.
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:20 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 3 Graham Perrin freebsd_committer freebsd_triage 2022-10-17 12:38:43 UTC
Keyword: 

    patch
or  patch-ready

– in lieu of summary line prefix: 

    [patch]

* bulk change for the keyword
* summary lines may be edited manually (not in bulk). 

Keyword descriptions and search interface: 

    <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>