Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 alpha 4/15/85; site enea.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!mcvax!enea!peno From: peno@enea.UUCP (Pekka Nousiainen) Newsgroups: net.lang.c,net.unix Subject: Re: max size of automatic arrays? Message-ID: <1123@enea.UUCP> Date: Tue, 10-Dec-85 04:10:29 EST Article-I.D.: enea.1123 Posted: Tue Dec 10 04:10:29 1985 Date-Received: Fri, 13-Dec-85 08:47:24 EST References: <627@ttrdc.UUCP> <1126@lll-crg.ARpA> Reply-To: peno@enea.UUCP (Pekka Nousiainen) Organization: Enea Data, Sweden Lines: 18 Xref: watmath net.lang.c:7388 net.unix:6612 >>main() >>{ >> double humongous[200000]; >> >>memory fault -- core dumped >data is on the stack. When the stack is expanded slowly, ie through routine >calls with small amounts of auto data memory faults occur. The kernel notices >that the fault is close to current stack limit and expands the stack figuring On Genix (tm?) and probably other systems too, the kernel checks if the instruction causing the fault is ENTER (enter a function). If it is, any memory reference is allowed. The core dump is caused by a software or a physical limit, sort of like using malloc(200000) and not checking the return value. But in this example no check is possible (except SIGSEGV). -- ...!mcvax!enea!peno.