Re: error message for invalid mapping?

Joshua Haberman <[email protected]>
Newsgroups gmane.comp.micro-kernel.l4.l4ka.general
Message-ID <[email protected]>
On Mon, Sep 11, 2006 at 02:02:03PM +0200, Espen Skoglund wrote:
> [Joshua Haberman]
> > I spent the last several days tracking down a bug in my code.  I was
> > trying to make my pager send a MapItem in response to a page fault,
> > but the mapping would never take effect.  The page fault would keep
> > re-occuring.
> 
> > I finally figured out the problem: I was trying to send an fpage of
> > memory that wasn't mapped in my own address space (I hadn't
> > requested it from sigma0).  I was checking the success code from my
> > MapItem IPC and I had turned on all tracepoints.  Neither indicated
> > what the problem was.  Do you think that this error condition could
> > either:
> 
> > 1. make the IPC fail?
> 
> No.  Trying to map a non-existent page is a legal operation.

If it is a legal operation, then why does it not complete?  But perhaps
you mean that it is legal in the sense that the IPC itself completes
successfully?  If that is the case, I can see the argument for not
making the IPC fail.

> > 2. log a tracepoint message about the failure?
> 
> This would in my opinion just add noise to the kernel debugger/tracing
> facility.

How should a programmer who has made this mistake diagnose the problem?
Currently the only way is to make a lucky guess.  If nothing else, could
you add a note to the reference manual that pages that are not mapped in
the mapper's address space will not be mapped in the mappee's?

I'm just trying to save the next person who encounters this problem the
several days I spent debugging it.  :)

Josh
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.