bug-hurd
[Top][All Lists]
Advanced

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

Bug#102437: dealloc missing on out parameters (was: Re: Bug#102437: proc


From: Marcus Brinkmann
Subject: Bug#102437: dealloc missing on out parameters (was: Re: Bug#102437: proc leaks memory with the bootstrap filesystem entry
Date: Wed, 27 Jun 2001 12:35:25 +0200
User-agent: Mutt/1.3.18i

On Wed, Jun 27, 2001 at 03:59:03AM +0200, Marcus Brinkmann wrote:
> this is really a nice obscure bug.

Oh man.  This is a prime example for what you can read out of data if you
want to.

The real cause of the bug is the allocation of *piarray, which only happens
if the number of threads in the task exceed a certain amount (about 30?). 
So, this will happen with all tasks that have many threads, and the root
filesystem starts out with 41 threads on my system.

A quick look at the mig server routines reveals the bug:

  routine proc_getprocinfo (
          process: process_t;
          which: pid_t;
          inout flags: int;
-         out procinfo: procinfo_t;
+         out procinfo: procinfo_t, dealloc;
          out threadwaits: data_t, dealloc);

There are other arrays which are used as out parameter but not have dealloc
specified.  Is any of these appropriate?  We should really clean this up, as
all of these can potentially leak memory if I am not mistaken.

  routine file_get_storage_info (
          file: file_t;
          RPT
-         out ports: portarray_t;
-         out ints: intarray_t;          
-         out offsets: off_array_t;
-         out data: data_t);
+         out ports: portarray_t, dealloc;
+         out ints: intarray_t, dealloc;
+         out offsets: off_array_t, dealloc;
+         out data: data_t, dealloc);

  routine file_get_fs_options (
          file: file_t;
          RPT
-         out options: data_t);
+         out options: data_t, dealloc);

  routine fsys_get_options (
          server: fsys_t;
          RPT
-         out options: data_t);
+         out options: data_t, dealloc);

  routine auth_getids (
          handle: auth_t;
-         out euids: idarray_t;
-         out auids: idarray_t;
-         out egids: idarray_t;
-         out agids: idarray_t);
+         out euids: idarray_t, dealloc;
+         out auids: idarray_t, dealloc;
+         out egids: idarray_t, dealloc;
+         out agids: idarray_t, dealloc);

  routine auth_server_authenticate (
          handle: auth_t;
          sreplyport reply: mach_port_poly_t;
          rendezvous: mach_port_send_t;
          newport: mach_port_poly_t;
-         out euids: idarray_t;
-         out auids: idarray_t;
-         out egids: idarray_t;
-         out agids: idarray_t);
+         out euids: idarray_t, dealloc;
+         out auids: idarray_t, dealloc;
+         out egids: idarray_t, dealloc;
+         out agids: idarray_t, dealloc);

Marcus

-- 
`Rhubarb is no Egyptian god.' Debian http://www.debian.org brinkmd@debian.org
Marcus Brinkmann              GNU    http://www.gnu.org    marcus@gnu.org
Marcus.Brinkmann@ruhr-uni-bochum.de
http://www.marcus-brinkmann.de




reply via email to

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