Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!dciem!nrcaer!cognos!brianc From: brianc@cognos.uucp (Brian Campbell) Newsgroups: comp.unix.xenix Subject: Re: load module errors induced by array sizes in c Message-ID: <1221@cognos.UUCP> Date: Tue, 4-Aug-87 12:23:50 EDT Article-I.D.: cognos.1221 Posted: Tue Aug 4 12:23:50 1987 Date-Received: Sat, 8-Aug-87 07:21:42 EDT References: <995@lll-lcc.aRpA> Reply-To: brianc@cognos.UUCP (Brian Campbell) Distribution: world Organization: Cognos Incorporated, Ottawa, Canada Lines: 21 In article <995@lll-lcc.aRpA> esd!scowles@lll-lcc.UUCP (Sid Cowles) writes: ! i am running sco xenix 2.1.0 on an at-clone. referring to ! the code below, why does gigo1 run without errors and gigo2 ! produces 'Stack overflow ! Segmentation violation -- Core dumped'? ! i used 'cc -o file file.c' where 'file' is gigo1 or gigo2 ! to compile these. ! ! =========================================================== ! gigo1.c: main() { char f[31][127]; printf("hello\n"); } ! gigo2.c: main() { char f[32][128]; printf("hello\n"); } Same problem under 2.1.3. It seems the _stkgro routine can't handle increasing the stack size by more than 4046 characters at once. The gigo2 program expects 4096 characters of stack space. You can make this problem "go away" by specifying a fixed stack size with the -F option of cc. -- Brian Campbell uucp: decvax!utzoo!dciem!nrcaer!cognos!brianc Cognos Incorporated mail: 3755 Riverside Drive, Ottawa, Ontario, K1G 3N3 (613) 738-1440 fido: sysop@163/8