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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a02:3b19:: with SMTP id c25mr1193620jaa.0.1551505841379; Fri, 01 Mar 2019 21:50:41 -0800 (PST) X-Received: by 2002:aca:355:: with SMTP id 82mr5881331oid.30.1551505841205; Fri, 01 Mar 2019 21:50:41 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!goblin1!goblin.stu.neva.ru!y42no168900ita.0!news-out.google.com!v188ni345itb.0!nntp.google.com!y42no168895ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 1 Mar 2019 21:50:40 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=24.6.20.197; posting-account=Qh2kiQoAAADpCLlhT_KTYoGO8dU3n4I6 NNTP-Posting-Host: 24.6.20.197 References: <2c369d78-70ea-4593-af3d-e014b0c1fc00@googlegroups.com> <4081906e-91de-43fa-a816-067f707c6d7d@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <161c749f-b9db-465f-8ffe-7900d3a4bff5@googlegroups.com> Subject: Re: Gnat Problem - Freezing too soon From: Anh Vo Injection-Date: Sat, 02 Mar 2019 05:50:41 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:55763 Date: 2019-03-01T21:50:40-08:00 List-Id: On Friday, March 1, 2019 at 7:56:40 PM UTC-8, russ lyttle wrote: > On 3/1/19 8:08 PM, Anh Vo wrote: > > On Friday, March 1, 2019 at 1:50:12 PM UTC-8, russ lyttle wrote: > >> On 3/1/19 11:54 AM, Anh Vo wrote: > >>> On Friday, March 1, 2019 at 6:21:26 AM UTC-8, russ lyttle wrote: > >>>> On 2/28/19 7:49 PM, Anh Vo wrote: > >>>>> On Thursday, February 28, 2019 at 2:11:11 PM UTC-8, russ lyttle wrote: > >>>>>> On 2/28/19 4:22 PM, Simon Wright wrote: > >>>>>>> russ lyttle writes: > >>>>>>> > >>>>>>>> Example from the bookAnalysable Real-Time Systems : > >>>>>>>> > >>>>> --------- > >>>>>> > >>>>>> Would I be submitting a bug report against an already patched version of > >>>>>> gnat? > >>>>> > >>>>> Again, please post sporadics.ads in its entirety. So, we can duplicate your finding or not. > >>>>> > >>>>> > >>>> Thanks for responding. We found it definitely a bug in gnat and are > >>>> submitting a bug report. > >>> > >>> It is fine to send in a report if you are confident that it is a bug in latest GNAT. Otherwise, we would like to see the content of sporadics.ads. So, we can either confirm or not your finding. > >>> > >>> > >> Here they are. These are from Analysable Real-Time Systems Progrmmed in > >> Ada, Chap.20, Pg. 472-473. Line 29 gives different error from line 44. > >> > >> Full code for sporadics.ads: > >> > >> with System; use System; > >> with Ada.Real_Time; use Ada.Real_Time; > >> package Sporadics is > >> > >> type Sporadic_Invoke_Interface is Synchronized Interface; > >> procedure Start (S: in out Sporadic_Invoke_Interface) > >> is abstract; > >> type Any_Sporadic_Invoke_Interface is access all > >> Sporadic_Invoke_Interface'Class; > >> > >> type Sporadic_Thread_Interface is Synchronized Interface; > >> procedure Wait_Start (S: in out Sporadic_Thread_Interface) > >> is abstract; > >> type Any_Sporadic_Thread_Interface is access all > >> Sporadic_Thread_Interface'Class; > >> > >> type Sporadic_State is abstract tagged > >> record > >> Pri : Priority; > >> Ceiling_Priority : Priority; > >> MIT_In_Mili : Time_Span; > >> end record; > >> procedure Initialize_Code (S: in out Sporadic_State) > >> is abstract; > >> procedure Sporadic_Code (S: in out Sporadic_State) > >> is abstract; > >> type Any_Sporadic_State is access all Sporadic_State'Class; > >> > >> protected type Sporadic_Agent (S: Any_Sporadic_State) > >> --with Priority => S.Ceiling_Prioriy > >> is > >> new Sporadic_Invoke_Interface and > >> Sporadic_Thread_Interface > >> with > >> -- for the Start operation > >> overriding procedure Start; > >> overriding entry Wait_Start; > >> private > >> Start_Open : Boolean := False; > >> end Sporadic_Agent; > >> > >> task type Sporadic (S : Any_Sporadic_State; > >> A : Any_Sporadic_Thread_Interface) > >> with Priority => S.pri > >> is > >> > >> end Sporadic; > >> end Sporadics; > >> ----------------------------------------------------------------------- > >> Full code for sporadics.adb: > >> package body Sporadics is > >> protected body Sporadic_Agent is > >> procedure Start is > >> begin > >> Start_Open := False; > >> end Start; > >> > >> entry Wait_Start > >> when Start_Open is > >> begin > >> Start_Open := False; > >> end Wait_Start; > >> end Sporadic_Agent; > >> > >> task body Sporadic is > >> begin > >> S.Initialize_Code; > >> loop > >> A.Wait_Start; > >> S.Sporadic_Code; > >> end loop; > >> end Sporadic; > >> end Sporadics; > > > > This problem also occurred with GNAT Community 2018 on Windows. > > > > While waiting for fixes in GNAT Community 2019, the work around is changing the definition of type Any_Sporadic_State as shown below. > > > > type Any_Sporadic_State is not null access all Sporadic_State'Class; > > > Well, that worked. I may even come to understand why. Is this gnat only? It is standard Ada. It means that the access variable must be not null.