[comp.unix.aux] Shared Memory and Memory Faults

dcr0@harvey.gte.com (David Robbins) (04/10/91)

I am running some programs that make heavy use of shared memory.  At times,
one or the other of the programs dies with a "Memory Fault".  Using sdb, I
can see that the memory fault occurs on the first access to a page of shared
memory.  The address is, however, a valid address in the shared memory region,
and indeed sdb can happily read and write the address.  Furthermore, if I
continue the program's execution, it will go on as if nothing bad had
happened (until the next time it hits one of these memory faults).  This seems
to happen randomly, because most of the time when the program visits a page of
shared memory for the first time, nothing goes wrong at all.

So, I am rather mystified -- if no problem occurs most of the time, and if sdb
and subsequent execution of the program can read and write the page at the
address where the memory fault occurred, what exactly is going on here?  Have
any of you A/UX gurus out there seen anything like this?  Is there a situation
in A/UX where a page fault is somehow not caught?  Is there something I should
be doing in my program to make sure that the page is handled properly?  Any
suggestions, thoughts, advice, flames, or what have you would be appreciated.
-- 
Dave Robbins                    GTE Laboratories Incorporated
drobbins@bunny.gte.com          40 Sylvan Rd.
...!harvard!bunny!drobbins      Waltham, MA 02254
CYA:  I speak only for myself; GTE may disagree with what I say.