Path: utzoo!attcan!uunet!sco!rosso From: rosso@sco.COM (Ross Oliver) Newsgroups: comp.unix.xenix Subject: Re: Program too large problem.... Summary: Segments strike again! Keywords: errno=12, runbig Message-ID: <702@nod2sco> Date: 2 Jul 88 07:11:57 GMT References: <102@psych.psy.uq.oz> Organization: SCO Technical Support Lines: 29 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