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,FREEMAIL_FROM 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.szaf.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: hreba Newsgroups: comp.lang.ada Subject: Re: storage error: stack overflow Date: Fri, 14 Aug 2015 10:20:57 -0300 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net be+x7Qg6gxsNVQvActiQkwWKEHyayv3JZ3qbFQ9wsGKYSUrArA Cancel-Lock: sha1:dCdy91McdZhD5kMJyYYxuoL52hA= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 In-Reply-To: Xref: news.eternal-september.org comp.lang.ada:27448 Date: 2015-08-14T10:20:57-03:00 List-Id: On 08/13/2015 04:19 AM, Simon Wright wrote: > hreba writes: > >> ==4823== Invalid read of size 4 >> ==4823== at 0x66FF1A0: ada__strings__unbounded__reference (in >> /usr/lib/x86_64-linux-gnu/libgnat-4.6.so.1) >> ==4823== by 0x6703851: ada__strings__unbounded___assign__2 (in >> /usr/lib/x86_64-linux-gnu/libgnat-4.6.so.1) > > There's no Assign in the code of Ada.Strings.Unbounded, so I expect it's > a subprogram generated by the compiler to manage assignment. > > It could be from the finalize of the 'dest' object prior to assignment, > but I think it's from the adjust after the bitwise copy of the 'source' > object; Adjust does contain a call to Reference. > > Given that, is it possible that something has corrupted the 'source' > object? (at least 'source.name') > The statement dest.name := source.name; is the first line in the body of the subprogram procedure Deep_Copy_Base (source: Surface; dest: in out Surface'Class); Setting a breakpoint at this subprogram, "p source" gets me $1 = (name => (prev => 0x0, next => 0x0, reference => 0x0), dist => 0.0, zabs => 1500.0, zmin => 0.0, zmax => 0.0, ap => 0x722a90) and on the other Linux machine, without the error, I get $1 = (name => (prev => 0x0, next => 0x0, reference => 0xf22b98, last => 0), dist => 0.0, zabs => 1500.0, zmin => 0.0, zmax => 0.0, ap => 0x8126b80) The value of source.name comes from a call of 'To_Unbounded_String("")'. The null reference is strange. I made a simple test program with 2 variables a, b of type 'Unbounded_String' and an assignment and it worked. After assigning the empty string to a its value is $1 = (prev => 0x0, next => 0x0, reference => 0x7ffff7dca6a0)) I reinstalled GNAT, GPS and GtkAda from the Ubuntu repository and nothing changed. I'll continue my investigation when I have more time. -- Frank Hrebabetzky +55 / 48 / 3235 1106 Florianopolis, Brazil