bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: I/O permission control in OSKit-Mach


From: Thomas Schwinge
Subject: Re: I/O permission control in OSKit-Mach
Date: Wed, 25 Apr 2007 15:07:34 +0200
User-agent: Mutt/1.5.11

Hello!

On Tue, Apr 24, 2007 at 03:04:26PM +0200, Richard Braun wrote:
> On Tue, Apr 24, 2007 at 02:50:52PM +0200, Thomas Schwinge wrote:
> > Okay, a new zalloc zone would be overkill, but I've implemented a tiny
> > new kernel object, lumped it all together -- and it even works, it seems!
> > 
> > But then noticed that I had forgotten to deallocate the kernel object's
> > `kalloc'ed memory, added such a deallocation as well -- and now get a
> > kernel page fault after having `kfree'ed that memory in a ``no senders''
> > service routine.  If I leave away the `kfree' then everything is fine,
> > save the memory leak, of course.  Hmm.
> > 
> > Is there any Mach savvy person who feels like helping poor tschwinge?
> 
> I can spend some time on this with you :-).

Okay, problem solved.  Richard just told me (thank you!) that I need to
pass the object's size to `kfree' as the second parameter.  Which I
hadn't done.  Which Marcus also hadn't done in his original code...  And
which the compiler didn't even have a chance of catching, because in
`kern/kalloc.h' it was simply declared like ``extern void kfree()''.  I
changed that to ``extern void kfree (vm_offset_t data, vm_size_t size)''
and likewise for the other functions.

#v+
2007-04-25  Thomas Schwinge  <address@hidden>

        * kern/kalloc.h (kalloc, kget, kfree, kalloc_init): List the arguments.
#v-


Now that it finally works, I can now polish and test my patch a bit.  :-)


Regards,
 Thomas

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]