Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Oct 1996 10:53:27 +0100 (MET)
From:      Luigi Rizzo <luigi@labinfo.iet.unipi.it>
To:        dg@root.com
Cc:        csubl@csv.warwick.ac.uk, questions@FreeBSD.ORG
Subject:   Re: String space limit?
Message-ID:  <199610280953.KAA01270@labinfo.iet.unipi.it>
In-Reply-To: <199610270648.XAA10943@root.com> from "David Greenman" at Oct 26, 96 11:47:59 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> >I've been adding a lot of stuff to my X start up script, and I've strted
> > getting 'cat: No such process' errors, followed by '/kernel: execve: failed
> > to allocate string space'. The cat: errors are from a shell script called
> > several times at startup and occasionally later. The script seems to work
> > later on - I must be running out of some temporary resource, but my shell
> > limits all seem OK and I've set maxusers 30 (I'm not sure exactly how many
> > processes that is, but I've had over 100.)
> >
> >So what eactly am I running out of, and how can I get rid of the errors?
> 
>    You should always mention which version of FreeBSD the problem pertains
> to. The failure you're seeing is caused by more than 16 processes trying
> to exec simultaneously and running out of a kernel resource because of it.
> This failure case was eliminated in FreeBSD 2.1.5 (by adding code to block
> the process until the resource becomes available), so I would guess that
> you're using FreeBSD 2.1.0 or earlier.


I have to fix this on a system, and cannot upgrade to 2.1.5R.

I have looked at the diffs between 1.21.4.1 (2.1R) and 1.21.4.6 (I
believe it is 2.1.5R). Looks like much of the difference comes from
a renaming of variables; other than that, the code looks simpler.

Since I am not too familiar with kernel functions, would the
following work ?

--- src/sys/kern/kern_exec.c    1995/08/31 10:00:43     1.21.4.1
+++ src/sys/kern/kern_exec.c    1996/06/04 02:11:37     1.21.4.6

        /*
         * Allocate temporary demand zeroed space for argument and
         *      environment strings
         */
-       iparams->stringbase = (char *)vm_map_min(exec_map);
-       error = vm_map_find(exec_map, NULL, 0, (vm_offset_t *)&iparams->stringbase,
-           ARG_MAX, TRUE);
-       if (error) {
-               log(LOG_WARNING, "execve: failed to allocate string space\n");
-               return (error);
-       }
-
+       iparams->stringbase = (char *)kmem_alloc_wait(exec_map, ARG_MAX);
        if (!iparams->stringbase) {
                error = ENOMEM;
                goto exec_fail;
        }

	Thanks
	Luigi
====================================================================
Luigi Rizzo                     Dip. di Ingegneria dell'Informazione
email: luigi@iet.unipi.it       Universita' di Pisa
tel: +39-50-568533              via Diotisalvi 2, 56126 PISA (Italy)
fax: +39-50-568522              http://www.iet.unipi.it/~luigi/
====================================================================



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199610280953.KAA01270>