(Debian bug #329691) In the following program, the environment task deallocates a protected object while a task is busy in it. Per RM 9.4(20), the task should receive a Program_Error. In gnat 3.15p-13, gnat-3.4 3.4.3-13 and gnat-4.0 4.0.1-2, the program teminates immediately but without an exception (no output).
$ gnatmake test_329691 $ ./test_329691 $ (no output, exception message expected) with Ada.Exceptions; with Ada.Text_IO; with Ada.Unchecked_Deallocation; procedure Test_329691 is protected type P is procedure E; end P; protected body P is procedure E is G : Integer; begin for K in 1 .. 10 ** 8 loop G := K - 1 + K * (1 - K); end loop; end E; end P; task type T (Prot : access P); task body T is begin Prot.E; exception when E : others => Ada.Text_IO.Put_Line (Ada.Exceptions.Exception_Information (E)); end T; type Access_T is access T; New_T : Access_T; type Access_P is access P; procedure Free is new Ada.Unchecked_Deallocation (Object => P, Name => Access_P); New_P : Access_P := new P; begin New_T := new T (New_P); Free (New_P); exception when E : others => Ada.Text_IO.Put_Line (Ada.Exceptions.Exception_Information (E)); end Test_329691; -- Summary: Run-time error not detected, deallocating busy protected object, RM 9.4(20) Product: gcc Version: 3.4.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: ada AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: ludovic at ludovic-brenta dot org CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i486-linux-gnu GCC host triplet: i486-linux-gnu GCC target triplet: i486-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24019