[comp.unix.xenix] Program too large problem....

robert@psych.psy.uq.oz (Robert Dal Santo) (06/27/88)

ENVIRONMENT:

    Running xenix 2.2.1 on a 6 Mhz AT with 3.2Mb I have encountered a 
    problem in running a program - "too big" (from sh).  Size gives me:

	program:  124937 + 51766 + 17914 = 194617 = 0x2f839

PROBLEM:

    The exec returns with

	errno = 12  (ENOMEM?)

    Intro(2) tells me that this error can be caused by either too many
segments, not enough physical memory, not enough swap space, or by exceeding
a system-defined parameter.  I have 2556 blocks in my swap device, a maximum
user process size of 1917k, and I have used the -NM cc option to limit
the number of segments, so my only option would appear to be increasing 
the latter system-limit.

    I've had a bit of a look around /usr/sys, but I can't find any obvious
parameter which I can increase before re-linking a new kernel.

    I've tried to use "runbig", but whilst this program quite happily
execs normal programs (which can run on their own) it reports that it
"can't find" my errant too-large binary, no matter how I try to invoke it.
Just when I need it most ...

   I've also tried to run "program" with no other processes executing
other than init, swapper(!), getty and sh, to no avail.  Same running
single-user.

    I've also tried calling the "proctl" system call under root to
lock large programs in core (helpful when the swapper can't accomodate a
large program) but still get the same errno=12 on the following exec().
Another pointer that swap space is not the problem?

    Could someone please give me some help on what I can do?  There doesn't
seem to be much documentation on "tuning & relinking the kernel" or have
I (I hope not!) missed reading something?


	Please respond via E-mail as I don't often read this group.

Thanx.


Newsgroups: comp.xenix.unix
Subject: Program too big problem....
Expires: 
References: 
Sender: 
Reply-To: robert@psycho (Robert Dal Santo)
Followup-To: 
Distribution: world
Organization: 
Keywords: 
Summary: program of ~190k won't run on 3Mb system


ENVIRONMENT:

    Running xenix 2.2.1 on a 6 Mhz AT with 3.2Mb I have encountered a 
    problem in running a program - "too big" (from sh).  Size gives me:

	program:  124937 + 51766 + 17914 = 194617 = 0x2f839

PROBLEM:

    The exec returns with

	errno = 12  (ENOMEM?)

    Intro(2) tells me that this error can be caused by either too many
segments, not enough physical memory, not enough swap space, or by exceeding
a system-defined parameter.  I have 2556 blocks in my swap device, a maximum
user process size of 1917k, and I have used the -NM cc option to limit
the number of segments, so my only option would appear to be increasing 
the latter system-limit.

    I've had a bit of a look around /usr/sys, but I can't find any obvious
parameter which I can increase before re-linking a new kernel.

    I've tried to use "runbig", but whilst this program quite happily
execs normal programs (which can run on their own) it reports that it
"can't find" my errant too-large binary, no matter how I try to invoke it.
Just when I need it most ...

   I've also tried to run "program" with no other processes executing
other than init, swapper(!), getty and sh, to no avail.  Same running
single-user.

    I've also tried calling the "proctl" system call under root to
lock large programs in core (helpful when the swapper can't accomodate a
large program) but still get the same errno=12 on the following exec().
Another pointer that swap space is not the problem?

    Could someone please give me some help on what I can do?  There doesn't
seem to be much documentation on "tuning & relinking the kernel" or have
I (I hope not!) missed reading something?


	Please respond via E-mail as I don't often read this group.

Thanx.

rosso@sco.COM (Ross Oliver) (07/02/88)

In article <102@psych.psy.uq.oz> robert@psycho (Robert Dal Santo) writes:
>ENVIRONMENT:
>
>    Running xenix 2.2.1 on a 6 Mhz AT with 3.2Mb I have encountered a 
>    problem in running a program - "too big" (from sh).  Size gives me:
>
>	program:  124937 + 51766 + 17914 = 194617 = 0x2f839
>
>PROBLEM:
>
>    The exec returns with
>
>	errno = 12  (ENOMEM?)

ENOMEM can mean that your first data segment exceeds 64K. For a
middle model program, the DATA and BSS segments (second and third
numbers reported by size(CP)), in addition to your stack and
environment variables, must total 64K or less.  In this case,
the sum is greater than 64K, which is why exec is returning ENOMEM.
In this case, you need to either reduce the amount of data in your
program, or go to large model.  If your program already is large
model, this can still be the problem if you have a large stack, or
a large number of environment variables.  For large model programs,
the easiest way to fix this problem is by using the -Mt flag when
compiling.  Try starting with -Mt1024, and reduce the number until
your program works.

Ross Oliver
SCO Technical Support