On Mon, May 07, 2001 at 06:33:52PM -0700, Thomas Bushnell, BSG wrote:
> Marcus Brinkmann <[EMAIL PROTECTED]> writes:
>
> > Now, we actually leak all these urefs (for example, when calling
> > gettimeofday). Even for a process calling mach_host_self() 1000 times a
> > second it would take 50 days to overflow. For purity, should we deallocate
> > the port? Overflow is set to TRUE in this code path, so it might
> > be okay to just not bother anyway (ignoring that we might not want to bother
> > because it is extremely unlikely to ever overflow)? Am I just paranoid?
> > There are only a dozen places or so where we call mach_host_self, so it
> > wouldn't be too hard to fix if that's the right thing to do.
>
> What kind of "overflow" are you worried about?
Overflowing the ip_srights reference count in the port structure.
(see ipc_right_copyout() in mach:/ipc/ipc_right.c:
if (urefs+1 == MACH_PORT_UREFS_MAX) {
if (overflow) {
/* leave urefs pegged to maximum */
port->ip_srights--;
ip_release(port);
ip_unlock(port);
return KERN_SUCCESS;
}
ip_unlock(port);
return KERN_UREFS_OVERFLOW;
}
For the code path I followed, overflow is TRUE. Is there something we
should know about this overflow feature?
Note that I am not worried that this actually happens with mach_host_self()
in current applications. This can be said about most potential failures.
Thanks,
Marcus
--
`Rhubarb is no Egyptian god.' Debian http://www.debian.org [EMAIL PROTECTED]
Marcus Brinkmann GNU http://www.gnu.org [EMAIL PROTECTED]
[EMAIL PROTECTED]
http://www.marcus-brinkmann.de
_______________________________________________
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd