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 X-Received: by 10.140.144.17 with SMTP id 17mr31641934qhq.6.1441115031532; Tue, 01 Sep 2015 06:43:51 -0700 (PDT) X-Received: by 10.182.49.225 with SMTP id x1mr433044obn.16.1441115031488; Tue, 01 Sep 2015 06:43:51 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!b6no549909qge.0!news-out.google.com!nt1ni21244igb.0!nntp.google.com!kq10no24862igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 1 Sep 2015 06:43:51 -0700 (PDT) In-Reply-To: <32c623ac-817e-46fc-bb13-c77b47a506a7@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=178.193.240.199; posting-account=DQbqYQoAAACn8hHn2LmG2aF7Mhbxl_Lf NNTP-Posting-Host: 178.193.240.199 References: <32c623ac-817e-46fc-bb13-c77b47a506a7@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <0ffbc81c-04be-4aeb-99a4-2df1360397ad@googlegroups.com> Subject: Re: bug in gnatgpl 2015? From: ahlan@marriott.org Injection-Date: Tue, 01 Sep 2015 13:43:51 +0000 Content-Type: text/plain; charset=ISO-8859-1 X-Received-Bytes: 3452 X-Received-Body-CRC: 3556718318 Xref: news.eternal-september.org comp.lang.ada:27672 Date: 2015-09-01T06:43:51-07:00 List-Id: On Monday, August 31, 2015 at 9:34:43 AM UTC+2, Leo Brewin wrote: > Greetings, > > I've run into what I think is a bug in gnatgpl 2015. > I wonder if others could confirm the bug? > > I've tried to make the code as short as possible while still > capturing the alleged bug. > > Using gnatgpl 2015 from Adacore, I get > > gnatmake crash.adb > > gcc -c crash.adb > > raised CONSTRAINT_ERROR : erroneous memory access > gnatmake: "crash.adb" compilation error > > and on occassions a detailed report (too long to include here but will > be sent to Adacore if need be). > > I get no problems when using Simon's gcc-5.1.0 compiler. > > I'm using MacOSX 10.10.5 with the command line tools from Xcode 6.4. > > Cheers, > Leo > > Here are the two packages, > crash.adb/crash.ads > simplex.adb/simplex.ads > > -- crash.ads -------------------------- > package crash is > procedure foo; > end crash; > > -- crash.adb -------------------------- > with simplex; > > package body crash is > > package std_lattice is new Simplex (n_head_max => 50); > > use std_lattice; > > procedure foo is > begin > null; > end foo; > > end crash; > > -- simplex.ads ------------------------ > generic > > n_head_max : Integer := 5; > > package Simplex is > > procedure deallocate; > type myArray1dIntg is array (Integer range <>) of Integer; > type myArray1dIntg_ptr is access myArray1dIntg; > > private > > head_ptr : myArray1dIntg_ptr := new myArray1dIntg (0 .. 1); > > head : myArray1dIntg renames head_ptr.all; > > end Simplex; > > -- simplex.adb ------------------------ > package body Simplex is > > procedure deallocate is > begin > null; > end deallocate; > > procedure clear is > begin > head (1) := 1; > end clear; > > procedure add is > begin > head (1) := 1; > end add; > > end Simplex; I don't know about Gnat Pro 7.2.1 but I can confirm that Gnat Pro 7.3.1 doesn't crash with the example - but GPL-2015 does. Perhaps Anh Vo meant 7.3.1 and merely mistyped. 7.3.1 was the latest Pro version we obtained before our support ended.