Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: gbcacm@ccs.neu.edu (Peter Sherwood)
Subject: OSF/1 3.0 virt mem failure in C pgm
Date: 6 Dec 1994 01:40:35 GMT	[thread overview]
Message-ID: <3c0fek$jjs@narnia.ccs.neu.edu> (raw)


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;
}


             reply	other threads:[~1994-12-06  1:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-12-06  1:40 Peter Sherwood [this message]
1994-12-06 13:35 ` OSF/1 3.0 virt mem failure in C pgm Greg Lueck Development Environment
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox