Package: gnat
Version: 3.15p-13
Severity: normal
Tags: upstream

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 and gnat-4.0 4.0.1-2, the
program teminates immediately but without an exception (no output).

with Ada.Exceptions;
with Ada.Text_IO;
with Ada.Unchecked_Deallocation;
procedure Raise_Program_Error 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;
      exception
         when E : others =>
            Ada.Text_IO.Put_Line (Ada.Exceptions.Exception_Information (E));
      end E;
   end P;

   task type T (Prot : access P);

   task body T is
   begin
      Prot.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 Raise_Program_Error;


-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (600, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.4.27-2-686
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)

Versions of packages gnat depends on:
ii  binutils                      2.16.1-2   The GNU assembler, linker and bina
ii  libc6                         2.3.5-6    GNU C Library: Shared libraries an
ii  libc6-dev                     2.3.5-6    GNU C Library: Development Librari
ii  libgnat-3.15p-1               3.15p-13   The GNU Ada 95 compiler runtime li

Versions of packages gnat recommends:
ii  ada-reference-manual       20021112web-3 The standard describing the Ada 95
ii  gnat-gps                   2.1.0-5       The GNAT Programming System - adva

-- no debconf information



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to