Bug 29623 - Assert_Failure sinfo.adb:649 in task allocator
Summary: Assert_Failure sinfo.adb:649 in task allocator
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 4.1.1
: P3 normal
Target Milestone: 4.3.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-27 20:48 UTC by Ludovic Brenta
Modified: 2007-11-05 15:26 UTC (History)
2 users (show)

See Also:
Host: i486-linux-gnu
Target: i486-linux-gnu
Build: i486-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2006-10-29 21:03:29


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ludovic Brenta 2006-10-27 20:48:52 UTC
(Forwarding Debian bug #395406):

Subject: gnat-4.1: Assert_Failure sinfo.adb:649
Package: gnat-4.1
Version: 4.1.1-16
Severity: normal

*** Please type your report below this line ***

Trying to compile an Ada program, I have this bug with gnatmake :
****************************************
$ gnatmake -gnat05 rv.adb
gcc-4.1 -c -gnat05 rv.adb
+===========================GNAT BUG DETECTED==============================+
| 4.1.2 20061007 (prerelease) (Debian 4.1.1-16) (i486-pc-linux-gnu)        |
| Assert_Failure sinfo.adb:649                                             |
| Error detected at rv.adb:83:26                                           |

My source code : rv.adb
****************************************
with text_io;
use  text_io;

procedure rv is

    p     : constant integer := 6; -- nombre de tâches "processus" 
    nb_rv : constant integer := 2; -- nombre de rendez-vous successifs
    subtype indice_processus is integer range 1..p;
    type    etat_processus is (run, wait);

    ---------------- variables partagées ------------------ à compléter -------------
    etat : array(indice_processus) of etat_processus := (others => run);

    -------------------------
    ----- Tache serveur -----
    -------------------------

    task serveur is
        entry rendez_vous;
        entry photo;
    end serveur ;

    task body serveur is
    begin
        loop
            select
                accept rendez_vous;
            or
                accept photo do
                    for i in etat'Range loop
                        if etat(i) = run then
                            put("|   ");
                        else
                            put("+   ");
                        end if;
                    end loop;
                    put(Natural'Image(rendez_vous'Count));
                    new_line(1);
                end photo;
            end select;
        end loop;
    end serveur ;

    ---------------------------
    ----- Tache processus -----
    ---------------------------

    task type processus (numero : indice_processus);
    task body processus is
    begin
        serveur.rendez_vous;
    end processus;

    -----------------------
    ----- Tache trace -----
    -----------------------

    task trace;
    task body trace is
    begin
        serveur.photo;
    end trace ;

begin
    ------------------------------------------ affiche en-tête de la trace -----------
    new_line(1);
    put_line(integer'image(p)&" processus se donnent "&integer'image(nb_rv)&" rendez-vous" );
    new_line(1);
    put_line("Les processus s'executent : | , ou attendent : +") ;
    new_line(1);
    -- le header
    --put(" ");
    for i in 1..p loop
        put("p" & integer'image(i)(2..3) & "   ");
    end loop ;
    put("rendez_vous'count");
    new_line(1) ;
    -- les processus
    declare 
        taches : array(1..p) of access processus;
    begin
        for i in indice_processus loop
            taches(i) := new processus(i); -- line 83
        end loop;
    end;
end rv;

****************************************

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

Versions of packages gnat-4.1 depends on:
ii  gcc-4.1                      4.1.1-13    The GNU C compiler
ii  gnat-4.1-base                4.1.1-16    The GNU Compiler Collection (gnat 
ii  libc6                        2.3.6.ds1-4 GNU C Library: Shared libraries
ii  libc6-dev                    2.3.6.ds1-4 GNU C Library: Development Librari
ii  libgcc1                      1:4.1.1-13  GCC support library
ii  libgnat-4.1                  4.1.1-16    Runtime library for GNU Ada applic
ii  libgnatprj4.1                4.1.1-16    GNU Ada Project Manager
ii  libgnatvsn4.1                4.1.1-16    GNU Ada compiler version library

gnat-4.1 recommends no packages.

(sinfo.adb is not patched in Debian).
Comment 1 Andrew Pinski 2006-10-29 21:03:29 UTC
Confirmed, reduced testcase:procedure rv is
    task serveur is
        entry rendez_vous;
        entry photo;
    end serveur ;
    task body serveur is
    begin
       accept photo do
	  null;
       end photo;
    end serveur ;
    task type processus (numero : integer);
    task body processus is
    begin
        serveur.rendez_vous;
    end processus;
begin
    declare 
        taches : access processus;
    begin
            taches := new processus(0);
    end;
end rv;
Comment 2 Arnaud Charlet 2007-05-02 14:02:39 UTC
Works fine on trunk.