On Sat, Feb 08, 2003 at 04:12:26PM +0100, Thomas Moestl wrote:

> addr2line will usually point to the first line of a statement if it
> spans multiple lines; in this case, the full guard is:
> 
>                       while (p2->p_pid == trypid ||
>                           p2->p_pgrp->pg_id == trypid ||
>                           p2->p_session->s_sid == trypid) {

OK, I suspected that.

tjr was looking into this last night and proposed the following patch:

http://people.freebsd.org/~tjr/kf.diff

Kris

Index: kern_fork.c
===================================================================
RCS file: /x/freebsd/src/sys/kern/kern_fork.c,v
retrieving revision 1.181
diff -u -r1.181 kern_fork.c
--- kern_fork.c 1 Feb 2003 12:17:07 -0000       1.181
+++ kern_fork.c 8 Feb 2003 11:32:18 -0000
@@ -318,6 +318,7 @@
         * exceed the limit. The variable nprocs is the current number of
         * processes, maxproc is the limit.
         */
+       sx_slock(&proctree_lock);
        sx_xlock(&allproc_lock);
        uid = td->td_ucred->cr_ruid;
        if ((nprocs >= maxproc - 10 && uid != 0) || nprocs >= maxproc) {
@@ -425,6 +426,7 @@
        LIST_INSERT_HEAD(&allproc, p2, p_list);
        LIST_INSERT_HEAD(PIDHASH(p2->p_pid), p2, p_hash);
        sx_xunlock(&allproc_lock);
+       sx_sunlock(&proctree_lock);
 
        /*
         * Malloc things while we don't hold any locks.
@@ -759,6 +761,7 @@
        return (0);
 fail:
        sx_xunlock(&allproc_lock);
+       sx_sunlock(&proctree_lock);
        uma_zfree(proc_zone, newproc);
        if (p1->p_flag & P_KSES) {
                PROC_LOCK(p1);

Attachment: msg52016/pgp00000.pgp
Description: PGP signature

Reply via email to