comp.lang.ada
 help / color / mirror / Atom feed
From: tonyg <tonythegair@gmail.com>
Subject: I've not seen this error before
Date: Wed, 1 Apr 2015 01:42:21 -0700 (PDT)
Date: 2015-04-01T01:42:21-07:00	[thread overview]
Message-ID: <cc93eff7-3f97-49f9-a117-0908223e3a79@googlegroups.com> (raw)


2015-04-01 09:19:32.10 : Exception name: PROGRAM_ERROR
Message: adjust/finalize raised PROGRAM_ERROR: device_type_pkg.ads:115 finalize/adjust raised exception

the code is an ada specification

 type Device_Details_Type is record
      Device_Id : Device_Index_Type;
      The_Device : Device_Class_Type;
      Room_Id : Room_Id_Type;
      The_Id : Domoticz_ID_Type;
      Battery_Level : Battery_Level_Type;
      Signal_Level : Signal_Level_Type;
      Name : SU.Unbounded_String;
      Last_Update : AC.Time;
      Used : boolean ;
      Successful_Initialisation : boolean := false;
      Temperature : Temp_Xten_Type;
      Protected_Device : boolean; 
   end record;

The stack trace passed through addr2line (etc) is different

/home/tony/Dropbox/source/common/schedules_rooms_devices_indexes_pkg.adb:694 (discriminator 3)
/home/tony/Dropbox/source/common/schedules_rooms_devices_indexes_pkg.adb:689
/home/tony/Dropbox/source/common/schedules_rooms_devices_indexes_pkg.adb:342
/home/tony/Dropbox/source/common/schedules_rooms_devices_indexes_pkg.adb:356 (discriminator 2)
/home/tony/Dropbox/source/common/data_feed_update_pkg.adb:73 (discriminator 2)
/home/tony/Dropbox/source/common/data_feed_update_pkg.adb:48
/home/tony/Dropbox/source/common/data_feed_update_pkg.adb:41
/home/tony/Dropbox/source/common/decision_maker_pkg.adb:29 (discriminator 2)
s-tassta.adb:?

which is this and is a procedural call inside a protected object

   procedure Set_Device (Device : in Device_Details_Type) is
        
      begin
         if Initialised then
            gnoga.log("Device id " & Device.Device_Id'img);
            Device_Array(Device.Device_Id) :=Device;   -- LINE 694 where the error is reported
            if Device.Device_Id > 0 then
               Device_File_Storage.Save_Record (File_Item => Device,
                                               To => Device.Device_Id);
            else
               Gnoga.log ("Zero Device Id Device Record  NOT SAVED TO DISK");
            end if;

         else
            Gnoga.Log("Devices not loaded from disk");
         end if;

        
      exception
         when E : others => Gnoga.log (Ada.Exceptions.Exception_Information (E));

      end Set_Device;


The array that is being written to is a fixed array. There is a value of Ada.Calendar.Time in the record but I cannot see why this would cause the problem

             reply	other threads:[~2015-04-01  8:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-01  8:42 tonyg [this message]
2015-04-01 13:08 ` I've not seen this error before Simon Wright
2015-04-01 13:18   ` tonyg
2015-04-01 13:58     ` Niklas Holsti
2015-04-01 14:32       ` tonyg
2015-04-02  5:33   ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox