From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1583af5ff29435e5 X-Google-Attributes: gid103376,public From: Tucker Taft Subject: Re: Dynamic allocation of tasks Date: 2000/03/28 Message-ID: <38E1292E.EC47B11D@averstar.com>#1/1 X-Deja-AN: 603593377 Content-Transfer-Encoding: 7bit References: <87r9d3gvix.fsf@deneb.cygnus.argh.org> <8basg1$627$1@nnrp1.deja.com> <87ya7aewb8.fsf@deneb.cygnus.argh.org> <874s9yd6s2.fsf@deneb.cygnus.argh.org> <87aejj8rbv.fsf@deneb.cygnus.argh.org> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@inmet2.burl.averstar.com X-Trace: inmet2.burl.averstar.com 954280238 21927 141.199.8.164 (28 Mar 2000 21:50:38 GMT) Organization: AverStar (formerly Intermetrics) Burlington, MA USA Mime-Version: 1.0 NNTP-Posting-Date: 28 Mar 2000 21:50:38 GMT Newsgroups: comp.lang.ada Date: 2000-03-28T21:50:38+00:00 List-Id: 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