[Bug ada/44340] New: gcc (gnat) crash on allocation/initialization

marc dot criley at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon May 31 00:20:00 GMT 2010


GNAT bug box generated:

gcc-4.4 -c -g -gnatq -gnatQ test_tab.adb
+===========================GNAT BUG DETECTED==============================+
| 4.4.3 (i486-pc-linux-gnu) GCC error:                                     |
| in gnat_to_gnu_entity, at ada/gcc-interface/decl.c:348                   |
| Error detected at test_tab.adb:24:21                                     |
| Please submit a bug report; see http://gcc.gnu.org/bugs.html.            |
| Use a subject line meaningful to you and us to track the bug.            |
| Include the entire contents of this bug box in the report.               |
| Include the exact gcc-4.4 or gnatmake command that you entered.          |
| Also include sources listed below in gnatchop format                     |
| (concatenated together with no headers between files).                   |
+==========================================================================+

Please include these source files with error report
Note that list may not be accurate in some cases,
so please double check that the problem can still
be reproduced with the set of files listed.

test_tab.adb
aqmp_4_ada_h.ads

compilation abandoned

Files:
-------------------------------------------------------------
with Interfaces.C.Strings;
with AQMP_4_Ada_H;

procedure Test_Tab is

   use Interfaces;
   use Interfaces.C.Strings;

   use AQMP_4_Ada_H;

   Host : constant Chars_Ptr := New_String("127.0.0.1");
   Port : constant C.Int := 5672;

   Conn : access Connection_4_Ada := new Connection_4_Ada;

   procedure Declare_Queues(Conn : access Connection_4_Ada) is


   begin
      Conn.Open(Host, Port, Null_Ptr, Null_Ptr);
      declare
         Session : access Class_Session_4_Ada.Session_4_Ada;
      begin
         Session := new Class_Session_4_Ada.Session_4_Ada'(NewSession(Conn));
         Conn.Close;
         null;
      end;


   end Declare_Queues;

begin
   Declare_Queues(Conn);
end Test_Tab;

with Interfaces.C; use Interfaces.C;
with Interfaces.C.Strings;
with Interfaces.C.Extensions;
with Interfaces.Cpp;

package AQMP_4_Ada_h is

   subtype Bool is Unsigned_Char;

   package Class_Message_4_Ada is
      type Message_4_Ada is tagged limited record
         routingKey_u : Interfaces.C.Strings.chars_ptr;  -- AQMP_4_Ada.h:10:15
         contentType_u : Interfaces.C.Strings.chars_ptr;  -- AQMP_4_Ada.h:13:15
         contentEncoding_u : Interfaces.C.Strings.chars_ptr;  --
AQMP_4_Ada.h:14:15
         content_u : Interfaces.C.Strings.chars_ptr;  -- AQMP_4_Ada.h:15:15
      end record;
      pragma Import (CPP, Message_4_Ada);

      function New_Message_4_Ada return Message_4_Ada'Class;  --
AQMP_4_Ada.h:20:17
      pragma CPP_Constructor (New_Message_4_Ada, "_ZN13Message_4_AdaC1Ev");

      procedure setMessage
        (this : access Message_4_Ada;
         priority : int;
         routingKey : Interfaces.C.Strings.chars_ptr;
         expirationTime : int;
         deliveryMode : int;
         contentType : Interfaces.C.Strings.chars_ptr;
         contentEncoding : Interfaces.C.Strings.chars_ptr;
         content : Interfaces.C.Strings.chars_ptr);  -- AQMP_4_Ada.h:28:24
      pragma Import (CPP, setMessage,
"_ZN13Message_4_Ada10setMessageEiPKciiS1_S1_S1_");

      procedure setPriority (this : access Message_4_Ada; priority : int);  --
AQMP_4_Ada.h:32:36
      pragma Import (CPP, setPriority, "_ZN13Message_4_Ada11setPriorityEi");

      function getRoutingKey (this : access Message_4_Ada) return
Interfaces.C.Strings.chars_ptr;  -- AQMP_4_Ada.h:34:29
      pragma Import (CPP, getRoutingKey,
"_ZN13Message_4_Ada13getRoutingKeyEv");

      procedure setRoutingKey (this : access Message_4_Ada; routingKey :
Interfaces.C.Strings.chars_ptr);  -- AQMP_4_Ada.h:36:45
      pragma Import (CPP, setRoutingKey,
"_ZN13Message_4_Ada13setRoutingKeyEPKc");

      function getContentType (this : access Message_4_Ada) return
Interfaces.C.Strings.chars_ptr;  -- AQMP_4_Ada.h:42:30
      pragma Import (CPP, getContentType,
"_ZN13Message_4_Ada14getContentTypeEv");

      function getContentEncoding (this : access Message_4_Ada) return
Interfaces.C.Strings.chars_ptr;  -- AQMP_4_Ada.h:44:34
      pragma Import (CPP, getContentEncoding,
"_ZN13Message_4_Ada18getContentEncodingEv");

      function getContent (this : access Message_4_Ada) return
Interfaces.C.Strings.chars_ptr;  -- AQMP_4_Ada.h:46:26
      pragma Import (CPP, getContent, "_ZN13Message_4_Ada10getContentEv");

      procedure setContent (this : access Message_4_Ada; content :
Interfaces.C.Strings.chars_ptr);  -- AQMP_4_Ada.h:48:38
      pragma Import (CPP, setContent, "_ZN13Message_4_Ada10setContentEPKc");
   end;
   use Class_Message_4_Ada;
   --  skipped empty struct Listener_4_Ada

   package Class_Session_4_Ada is
      type Session_4_Ada is tagged limited record
         null;
      end record;
      pragma Import (CPP, Session_4_Ada);

      function New_Session_4_Ada return Session_4_Ada'Class;  --
AQMP_4_Ada.h:59:17
      pragma CPP_Constructor (New_Session_4_Ada, "_ZN13Session_4_AdaC1Ev");

      procedure MessageTransfer
        (this : access Session_4_Ada;
         destination : Interfaces.C.Strings.chars_ptr;
         msg : access Message_4_Ada;
         acceptMode : int;
         acquireMode : int;
         sync : Bool);  -- AQMP_4_Ada.h:65:26
      pragma Import (CPP, MessageTransfer,
"_ZN13Session_4_Ada15MessageTransferEPKcR13Message_4_Adaiib");

      procedure ExchangeBind
        (this : access Session_4_Ada;
         queue : Interfaces.C.Strings.chars_ptr;
         exchange : Interfaces.C.Strings.chars_ptr;
         bindingKey : Interfaces.C.Strings.chars_ptr;
         sync : Bool);  -- AQMP_4_Ada.h:70:23
      pragma Import (CPP, ExchangeBind,
"_ZN13Session_4_Ada12ExchangeBindEPKcS1_S1_b");

      procedure ExchangeDeclare
        (this : access Session_4_Ada;
         exchange : Interfaces.C.Strings.chars_ptr;
         c_type : Interfaces.C.Strings.chars_ptr;
         alternateExchange : Interfaces.C.Strings.chars_ptr;
         passive : Bool;
         durable : Bool;
         autoDelete : Bool;
         sync : Bool);  -- AQMP_4_Ada.h:78:26
      pragma Import (CPP, ExchangeDeclare,
"_ZN13Session_4_Ada15ExchangeDeclareEPKcS1_S1_bbbb");

      procedure ExchangeDelete
        (this : access Session_4_Ada;
         exchange : Interfaces.C.Strings.chars_ptr;
         ifUnused : Bool;
         sync : Bool);  -- AQMP_4_Ada.h:82:25
      pragma Import (CPP, ExchangeDelete,
"_ZN13Session_4_Ada14ExchangeDeleteEPKcbb");

      procedure ExchangeUnbind
        (this : access Session_4_Ada;
         queue : Interfaces.C.Strings.chars_ptr;
         exchange : Interfaces.C.Strings.chars_ptr;
         bindingKey : Interfaces.C.Strings.chars_ptr;
         sync : Bool);  -- AQMP_4_Ada.h:87:25
      pragma Import (CPP, ExchangeUnbind,
"_ZN13Session_4_Ada14ExchangeUnbindEPKcS1_S1_b");

      procedure QueueDeclare
        (this : access Session_4_Ada;
         queue : Interfaces.C.Strings.chars_ptr;
         alternateExchange : Interfaces.C.Strings.chars_ptr;
         passive : Bool;
         durable : Bool;
         exclusive : Bool;
         autoDelete : Bool;
         sync : Bool);  -- AQMP_4_Ada.h:95:23
      pragma Import (CPP, QueueDeclare,
"_ZN13Session_4_Ada12QueueDeclareEPKcS1_bbbbb");

      procedure QueueDelete
        (this : access Session_4_Ada;
         queue : Interfaces.C.Strings.chars_ptr;
         ifUnused : Bool;
         ifEmpty : Bool;
         sync : Bool);  -- AQMP_4_Ada.h:100:22
      pragma Import (CPP, QueueDelete,
"_ZN13Session_4_Ada11QueueDeleteEPKcbbb");

      procedure QueuePurge
        (this : access Session_4_Ada;
         queue : Interfaces.C.Strings.chars_ptr;
         sync : Bool);  -- AQMP_4_Ada.h:103:21
      pragma Import (CPP, QueuePurge, "_ZN13Session_4_Ada10QueuePurgeEPKcb");
   end;
   use Class_Session_4_Ada;
   package Class_LocalQueue_4_Ada is
      type LocalQueue_4_Ada is tagged limited record
         null;
      end record;
      pragma Import (CPP, LocalQueue_4_Ada);

      function New_LocalQueue_4_Ada return LocalQueue_4_Ada'Class;  --
AQMP_4_Ada.h:115:20
      pragma CPP_Constructor (New_LocalQueue_4_Ada,
"_ZN16LocalQueue_4_AdaC1Ev");

      procedure Delete_LocalQueue_4_Ada (this : access LocalQueue_4_Ada);  --
AQMP_4_Ada.h:117:21
      pragma Import (CPP, Delete_LocalQueue_4_Ada,
"_ZN16LocalQueue_4_AdaD1Ev");

      function get (this : access LocalQueue_4_Ada; timeOut : int) return
Message_4_Ada;  -- AQMP_4_Ada.h:119:36
      pragma Import (CPP, get, "_ZN16LocalQueue_4_Ada3getEi");

      procedure GetNoSub
        (this : access LocalQueue_4_Ada;
         arg2 : Interfaces.C.Strings.chars_ptr;
         arg3 : Session_4_Ada;
         arg4 : access Message_4_Ada;
         arg5 : int);  -- AQMP_4_Ada.h:124:6
      pragma Import (CPP, GetNoSub,
"_ZN16LocalQueue_4_Ada8GetNoSubEPc13Session_4_AdaR13Message_4_Adai");

      function Empty (this : access constant LocalQueue_4_Ada) return Bool;  --
AQMP_4_Ada.h:126:16
      pragma Import (CPP, Empty, "_ZNK16LocalQueue_4_Ada5EmptyEv");
   end;
   use Class_LocalQueue_4_Ada;
--   package Class_Connection_4_Ada is
   type Connection_4_Ada is tagged limited record
      null;
   end record;
   pragma Import(CPP, Connection_4_Ada);

   function New_Connection_4_Ada return Connection_4_Ada'Class;  --
AQMP_4_Ada.h:136:22
   pragma CPP_Constructor (New_Connection_4_Ada, "_ZN16Connection_4_AdaC1Ev");

      procedure Delete_Connection_4_Ada (this : access Connection_4_Ada);  --
AQMP_4_Ada.h:138:23
      pragma Import (CPP, Delete_Connection_4_Ada,
"_ZN16Connection_4_AdaD1Ev");

      procedure open
        (this : access Connection_4_Ada;
         host : Interfaces.C.Strings.chars_ptr;
         port : int;
         uid : Interfaces.C.Strings.chars_ptr;
         pwd : Interfaces.C.Strings.chars_ptr);  -- AQMP_4_Ada.h:143:23
      pragma Import (CPP, open, "_ZN16Connection_4_Ada4openEPKciS1_S1_");

      procedure close (this : access Connection_4_Ada);  -- AQMP_4_Ada.h:145:16
      pragma Import (CPP, close, "_ZN16Connection_4_Ada5closeEv");

      function newSession (this : access Connection_4_Ada) return
Session_4_Ada;  -- AQMP_4_Ada.h:147:30
      pragma Import (CPP, newSession, "_ZN16Connection_4_Ada10newSessionEv");
--   end;
--   use Class_Connection_4_Ada;
   package Class_SubscriptionManager_4_Ada is
      type SubscriptionManager_4_Ada is tagged limited record
         null;
      end record;
      pragma Import (CPP, SubscriptionManager_4_Ada);

      function New_SubscriptionManager_4_Ada return
SubscriptionManager_4_Ada'Class;  -- AQMP_4_Ada.h:156:29
      pragma CPP_Constructor (New_SubscriptionManager_4_Ada,
"_ZN25SubscriptionManager_4_AdaC1Ev");

      procedure AllocateSubscriptionManager (this : access
SubscriptionManager_4_Ada; session : Session_4_Ada);  -- AQMP_4_Ada.h:158:57
      pragma Import (CPP, AllocateSubscriptionManager,
"_ZN25SubscriptionManager_4_Ada27AllocateSubscriptionManagerE13Session_4_Ada");

      procedure Delete_SubscriptionManager_4_Ada (this : access
SubscriptionManager_4_Ada);  -- AQMP_4_Ada.h:160:30
      pragma Import (CPP, Delete_SubscriptionManager_4_Ada,
"_ZN25SubscriptionManager_4_AdaD1Ev");


   end;
   use Class_SubscriptionManager_4_Ada;
end AQMP_4_Ada_h;


-- 
           Summary: gcc (gnat) crash on allocation/initialization
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: marc dot criley at gmail dot com
 GCC build triplet: i686-pc-linux-gn
  GCC host triplet: i686-pc-linux-gn
GCC target triplet: i686-pc-linux-gn


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44340



More information about the Gcc-bugs mailing list