From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: I've not seen this error before Date: Wed, 01 Apr 2015 14:08:33 +0100 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="e362043f1eec5b72fb571caf32708303"; logging-data="12388"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/uNPvcSlDKX3aAaxyI9fmrX7njed6u4qU=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (darwin) Cancel-Lock: sha1:Aw0w7FEvd7wgBiRDKnYcUNMVCHo= sha1:CEOhUxVpClvLJ4jVUDDJXgkAzSo= Xref: news.eternal-september.org comp.lang.ada:25358 Date: 2015-04-01T14:08:33+01:00 List-Id: tonyg writes: > 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; > procedure Set_Device (Device : in Device_Details_Type) is > > begin > Device_Array(Device.Device_Id) :=Device; -- LINE 694 where the error is reported > 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 To get that exception you're going to have a controlled type somewhere, very likely one of yours, and very likely to be found at device_type_pkg.ads:115 (I'm guessing, some ancestor in the Device_Class_Type tree? do you have some reason for naming this type instead of just using Device'Class or (ugh) Device_Type'Class?). At line 694 you are overwriting whatever was at Device_Array(Device.Device_Id); full explanation of what this involves starting at ARM 7.6(17). Any unhandled exception raised in Initialize (?), Adjust (?) or Finalize is going to be converted to PE. See ARM 7.6.1(14) ff. You could always use the debugger and break on exceptions (e.g "catch exception program_error").