> I am developing a KLD and I am having problems getting a page fault.  I am
> using a set "library" (basically a set of third party object files I build
> and then link in).  This libarary requires its own chunk of memory that it
> manages and needs to be passed a pointer to that memory (and the size) when
> it is initialized.  So during my load phase I malloc the memory (14M), at
> this point I can traverse the memory just fine using a for loop writing and
> reading from it as a test.  However once I pass this memory into the
> "library" to use, I get a page fault error.  Is there something I am missing
> here?  What would be the possible causes of the page fault?

The probable cause is that the library you're building is reaching 
outside the memory that you've allocated it; possibly because it's making 
some other invalid assumptions.  It's hard to be more specific because 
you haven't given a lot of data here. 

I'd start by checking the fault address as reported by the trap message; 
this is the address that the code has tried to access, and it should give 
you some hints about what's going wrong.  eg. if it's 0 or a small value 
you probably have a null pointer dereference, if it's outside the range 
that you've allocated, the library has a fencepost error, etc.

-- 
... every activity meets with opposition, everyone who acts has his
rivals and unfortunately opponents also.  But not because people want
to be opponents, rather because the tasks and relationships force
people to take different points of view.  [Dr. Fritz Todt]
           V I C T O R Y   N O T   V E N G E A N C E



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to