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!feeder.eternal-september.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: I've not seen this error before Date: Wed, 01 Apr 2015 16:58:40 +0300 Organization: Tidorum Ltd Message-ID: References: <0c11feff-2478-4cdc-b9ee-4404f1c35dc1@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net Ol92Vqy9TMxfCTwbSDPyxAOngz4VDvyapF4nCTSUbSWoeqb7yw Cancel-Lock: sha1:IAXS5PJPhflYyHCRkPZ2sDpRfbc= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 In-Reply-To: <0c11feff-2478-4cdc-b9ee-4404f1c35dc1@googlegroups.com> Xref: news.eternal-september.org comp.lang.ada:25361 Date: 2015-04-01T16:58:40+03:00 List-Id: On 15-04-01 16:18 , tonyg wrote: > I don't have any controlled types. I've never worked out how to use > them :) Your Device_Details_Type record has the component Name : SU.Unbounded_String; Assuming "SU" is a renaming for Ada.Strings.Unbounded, then the record has a component of a type that needs finalization, namely Ada.Strings.Unbounded.Unbounded_String, and this type probably involves controlled types. > This all seemed to happen when I started storing records in files.So > I've now got a task which loads the file at the start then looks at a > queue then sticks those changes back in the file. Do you store also the Name component in the file? Directly as type Unbounded_String, or converted to some non-controlled type? An Unbounded_String almost certainly contain an access component to some heap-allocated text buffer. That access value is most likely no longer valid if you write it out from one run of the program and read it back in another run. Even if you read and write in the same run, the access value may have become invalid, because that heap block may have been released in between writing and reading. It may help to change to Bounded_String (the ARM says these "should not" involve implicit pointers and dynamic allocation) but it would be safest to store the Name as a fixed-length String. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .