[gclist] Windows 98 Question

Fred Smith fms@CS.Cornell.EDU
Thu, 27 Apr 2000 16:15:02 -0400


Hi,

In trying to get the Boehm-Demers-Weiser collector running on Window 98
we have run into the following unexpected behavior.  Perhaps you can
help us solve this conundrum.

Before each collection, the collector must ascertain where the static
data segments are.  To do this it uses the VirtualQuery function which
returns the status of a particular memory range.  Extracting inessential
details the code is basically

VirtualQuery(p,&buf,sizeof(buf)); // What is the status of memory at
address p
if(buf.Protect == PAGE_READWRITE) { // p ok. Treat it as a root.
    int b = *p; // OK - read p okay.

    fprintf(fptr,"w"); // If you substitute "" for "w" no crash below.

    b = *p; // CRASH !!! Access Violation  Memory is NOACCESS (if you
ask VirtualQuery)
}

We suspect that this might have something to do with memory-mapped files
or something like that but don't have a good model for what is going on.

Any insight or experience would be greatly appreciated.

Please mail replies directly either to me (fms@cs.cornell.edu) or to
Hans Boehm (hans_boehm@hp.com).  I will post a summary of the replies to
the list.

Many thanks,

Fred