comp.lang.ada
 help / color / mirror / Atom feed
From: Tucker Taft <stt@averstar.com>
Subject: Re: Dynamic allocation of tasks
Date: 2000/03/28
Date: 2000-03-28T21:50:38+00:00	[thread overview]
Message-ID: <38E1292E.EC47B11D@averstar.com> (raw)
In-Reply-To: 87aejj8rbv.fsf@deneb.cygnus.argh.org

Florian Weimer wrote:
> ...  The following program
> allocates more and more memory:
> 
> procedure Test_Leak is
> 
>    procedure Use_Tasks is
>       task type Some_Task;
>       task body Some_Task is
>       begin
>          null;
>       end;
> 
>       type Task_Array is array (1 .. 1) of Some_Task;
>       TA : Task_Array;
>    begin
>       null;
>    end;
> 
> begin
>    loop
>       Use_Tasks;
>    end loop;
> end;
> 
> Each elaboration of the declaration of TA allocates a few storage
> elements which are never freed.  The problem disappears if the tasks
> is not wrapped within an array (which is probably the reason why no
> one has noticed it before).
> 
> Of course, this behavior is fully conforming with the letters of the
> RM (simply because the RM doesn't talk about storage leaks, except
> that an instance of Ada.Unchecked_Deallocation "should actually
> reclaim storage" ;), but I wonder whether it violates the spirit of
> the RM...

This seems like it is definitely a bug, whether or not it violates the 
spirit of the RM.  Unfortunately, compilers and run-time systems are complex
beasts, and it is impossible to test all combinations of features.
Storage leaks are particularly difficult to test for, since writing
a self-checking test for storage leaks is a pain in the neck.

I heartily suggest you report the bug to the appropriate authorities ;-).

-- 
-Tucker Taft   stt@averstar.com   http://www.averstar.com/~stt/
Technical Director, Distributed IT Solutions  (www.averstar.com/tools)
AverStar (formerly Intermetrics, Inc.)   Burlington, MA  USA




  reply	other threads:[~2000-03-28  0:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-22  0:00 Dynamic allocation of tasks Florian Weimer
2000-03-22  0:00 ` Robert Dewar
2000-03-22  0:00   ` Florian Weimer
2000-03-22  0:00     ` Lutz Donnerhacke
2000-03-22  0:00       ` Florian Weimer
2000-03-27  0:00         ` Robert A Duff
2000-03-28  0:00           ` Florian Weimer
2000-03-28  0:00             ` Tucker Taft [this message]
2000-03-23  0:00     ` Robert Dewar
2000-03-24  0:00       ` Florian Weimer
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox