From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,b56a2953f52acc6,start X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-12-05 18:58:19 PST Path: bga.com!news.sprintlink.net!howland.reston.ans.net!europa.eng.gtefsd.com!news.mathworks.com!noc.near.net!chaos.dac.neu.edu!narnia.ccs.neu.edu!gbcacm From: gbcacm@ccs.neu.edu (Peter Sherwood) Newsgroups: comp.unix.osf.osf1 Subject: OSF/1 3.0 virt mem failure in C pgm Date: 6 Dec 1994 01:40:35 GMT Organization: College of Computer Science, Northeastern University. Message-ID: <3c0fek$jjs@narnia.ccs.neu.edu> NNTP-Posting-Host: denali.ccs.neu.edu X-Newsreader: TIN [version 1.2 PL2] The following C program gets a segmentation error. Examination of the machine code reveals that the function r has a loop which appears to be reading one quadword per page of array b, which is allocated on the stack. The Alpha 3000/300LX on which it was run has 32 Mbytes of memory. If b is allocated as a global array, the program doesn't fail. If the size of b is decreased from 2,000,000 to 200,000, the program doesn't fail, although the machine code is the same except for the number of pages read. This looks like an error in the loader or the virtual memory system, failing to handle page faults for memory in the stack area. The program is compiled with cc -O0 -g -c bug08.c cc bug08.o Same results (and machine code) if gcc 2.6.0 is used instead of cc. ----------------------------------------------------------------------------- Peter Sherwood (617) 332-8880 (voice) (617) 332-1675 (fax) gbcacm@ccs.neu.edu ----------------------------------------------------------------------------- void r(unsigned long n); int main(void) { unsigned long n; r(n); return 0; } void r(unsigned long n) { unsigned long b[2000000]; return; }