comp.lang.ada
 help / color / mirror / Atom feed
* bug in gnatgpl 2015?
@ 2015-08-31  7:34 Leo Brewin
  2015-08-31  8:48 ` Simon Wright
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: Leo Brewin @ 2015-08-31  7:34 UTC (permalink / raw)


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;


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: bug in gnatgpl 2015?
  2015-08-31  7:34 bug in gnatgpl 2015? Leo Brewin
@ 2015-08-31  8:48 ` Simon Wright
  2015-08-31  9:19   ` Leo Brewin
  2015-08-31 23:35 ` Leo Brewin
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 17+ messages in thread
From: Simon Wright @ 2015-08-31  8:48 UTC (permalink / raw)


Leo Brewin <leo.brewin@internode.on.net> writes:

> 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).

Yes. Also, the reported point of error in the long report seems to vary
with the optimisation level.

>       head     : myArray1dIntg renames head_ptr.all;

The problem seems to go away if you eliminate this declaration, and use
head_ptr[.all] instead.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: bug in gnatgpl 2015?
  2015-08-31  8:48 ` Simon Wright
@ 2015-08-31  9:19   ` Leo Brewin
  2015-08-31 10:51     ` Peter Chapin
  0 siblings, 1 reply; 17+ messages in thread
From: Leo Brewin @ 2015-08-31  9:19 UTC (permalink / raw)


On Monday, August 31, 2015 at 6:48:16 PM UTC+10, Simon Wright wrote:
> Leo Brewin writes:
> 
> > 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).
> 
> Yes. Also, the reported point of error in the long report seems to vary
> with the optimisation level.
> 
> >       head     : myArray1dIntg renames head_ptr.all;
> 
> The problem seems to go away if you eliminate this declaration, and use
> head_ptr[.all] instead.

Hi Simon,

Thanks for the quick reply. Yes, I can avoid the bug by various changes to that example but those changes don't work well with the much larger code that this example was drawn from. My work around is to use your gcc-5.1.0 (thanks for the putting this together).

I think the code in my example is legal so the compiler shouldn't crash. 

Cheers,
Leo

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: bug in gnatgpl 2015?
  2015-08-31  9:19   ` Leo Brewin
@ 2015-08-31 10:51     ` Peter Chapin
  2015-08-31 15:54       ` Anh Vo
  0 siblings, 1 reply; 17+ messages in thread
From: Peter Chapin @ 2015-08-31 10:51 UTC (permalink / raw)


In article <0e9794c2-8702-42bd-96db-978d87a97bf2@googlegroups.com>, 
leo.brewin@internode.on.net says...

> I think the code in my example is legal so the compiler shouldn't
> crash. 

It doesn't matter if the code is legal or not. The compiler should never 
crash.

Peter


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: bug in gnatgpl 2015?
  2015-08-31 10:51     ` Peter Chapin
@ 2015-08-31 15:54       ` Anh Vo
  2015-08-31 23:33         ` Anh Vo
  0 siblings, 1 reply; 17+ messages in thread
From: Anh Vo @ 2015-08-31 15:54 UTC (permalink / raw)


On Monday, August 31, 2015 at 3:51:20 AM UTC-7, Peter Chapin wrote:
> In article <0e9794c2-8702-42bd-96db-978d87a97bf2@googlegroups.com>, 
> leo.brewin@internode.on.net says...
> 
>> I think the code in my example is legal so the compiler shouldn't
>> crash. 
> 
> It doesn't matter if the code is legal or not. The compiler should never 
> crash.
 
A bug report should be in order.

Anh Vo

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: bug in gnatgpl 2015?
  2015-08-31 15:54       ` Anh Vo
@ 2015-08-31 23:33         ` Anh Vo
  2015-08-31 23:37           ` Leo Brewin
  0 siblings, 1 reply; 17+ messages in thread
From: Anh Vo @ 2015-08-31 23:33 UTC (permalink / raw)


On Monday, August 31, 2015 at 8:55:00 AM UTC-7, Anh Vo wrote:
> On Monday, August 31, 2015 at 3:51:20 AM UTC-7, Peter Chapin wrote:
> > In article <0e9794c2-8702-42bd-96db-978d87a97bf2@googlegroups.com>, 
> > leo.brewin@internode.on.net says...
> > 
> >> I think the code in my example is legal so the compiler shouldn't
> >> crash. 
> > 
> > It doesn't matter if the code is legal or not. The compiler should never 
> > crash.
>  
> A bug report should be in order.

By the way, it compiles fine under GNAT-7.2.1.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: bug in gnatgpl 2015?
  2015-08-31  7:34 bug in gnatgpl 2015? Leo Brewin
  2015-08-31  8:48 ` Simon Wright
@ 2015-08-31 23:35 ` Leo Brewin
  2015-09-01  0:33 ` Leo Brewin
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 17+ messages in thread
From: Leo Brewin @ 2015-08-31 23:35 UTC (permalink / raw)


Thanks for the replies. I'll send a bug report to Adacore.

Cheers,
Leo

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: bug in gnatgpl 2015?
  2015-08-31 23:33         ` Anh Vo
@ 2015-08-31 23:37           ` Leo Brewin
  2015-08-31 23:55             ` Leo Brewin
  0 siblings, 1 reply; 17+ messages in thread
From: Leo Brewin @ 2015-08-31 23:37 UTC (permalink / raw)


On Tuesday, September 1, 2015 at 9:34:00 AM UTC+10, Anh Vo wrote:

> By the way, it compiles fine under GNAT-7.2.1.

GNAT-7.2.1? I don't know of this compiler. Where would I get a copy from?

Cheers,
Leo

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: bug in gnatgpl 2015?
  2015-08-31 23:37           ` Leo Brewin
@ 2015-08-31 23:55             ` Leo Brewin
  0 siblings, 0 replies; 17+ messages in thread
From: Leo Brewin @ 2015-08-31 23:55 UTC (permalink / raw)


On Tuesday, September 1, 2015 at 9:37:44 AM UTC+10, Leo Brewin wrote:
> On Tuesday, September 1, 2015 at 9:34:00 AM UTC+10, Anh Vo wrote:
> 
> > By the way, it compiles fine under GNAT-7.2.1.
> 
> GNAT-7.2.1? I don't know of this compiler. Where would I get a copy from?
> 
> Cheers,
> Leo

I'm a goose, it's the pro version of gnat from Adacore (and I don't have the cash to purchase a copy).

Cheers,
Leo


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: bug in gnatgpl 2015?
  2015-08-31  7:34 bug in gnatgpl 2015? Leo Brewin
  2015-08-31  8:48 ` Simon Wright
  2015-08-31 23:35 ` Leo Brewin
@ 2015-09-01  0:33 ` Leo Brewin
  2015-09-01  1:24   ` Anh Vo
                     ` (2 more replies)
  2015-09-01 13:43 ` ahlan
  2015-09-01 13:45 ` ahlan
  4 siblings, 3 replies; 17+ messages in thread
From: Leo Brewin @ 2015-09-01  0:33 UTC (permalink / raw)


Hi Folks,

I've trawled through the Adacore web site but I can't find a page for submitting bug reports. I'm not a paid-up gnat-poro user so I don''t have access to their customer support.

Does anybody know how I should send the bug-report to Adacore?

I'm not looking for answers or support from Adacore, I just think they might like this report.

But given that the bug does not exist in gnat-pro is there any point in sending in this report?

Cheers,
Leo

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: bug in gnatgpl 2015?
  2015-09-01  0:33 ` Leo Brewin
@ 2015-09-01  1:24   ` Anh Vo
  2015-09-01 12:42     ` Simon Wright
  2015-09-01  7:44   ` Markus Schöpflin
  2015-09-01  9:17   ` G.B.
  2 siblings, 1 reply; 17+ messages in thread
From: Anh Vo @ 2015-09-01  1:24 UTC (permalink / raw)


On Monday, August 31, 2015 at 5:33:47 PM UTC-7, Leo Brewin wrote:
> Hi Folks,
> 
> I've trawled through the Adacore web site but I can't find a page for submitting bug reports. I'm not a paid-up gnat-poro user so I don''t have access to their customer support.
> 
> Does anybody know how I should send the bug-report to Adacore?
> 
The address report@adacore.com should do it.

Anh Vo

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: bug in gnatgpl 2015?
  2015-09-01  0:33 ` Leo Brewin
  2015-09-01  1:24   ` Anh Vo
@ 2015-09-01  7:44   ` Markus Schöpflin
  2015-09-01  9:17   ` G.B.
  2 siblings, 0 replies; 17+ messages in thread
From: Markus Schöpflin @ 2015-09-01  7:44 UTC (permalink / raw)


Am 01.09.2015 um 02:33 schrieb Leo Brewin:

> But given that the bug does not exist in gnat-pro is there any point in sending in this report?

As the bug is already fixed in the latest GnatPRO, there really is no point in 
submitting the report. It will most likely be fixed in the 2016 GPL version.

Markus


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: bug in gnatgpl 2015?
  2015-09-01  0:33 ` Leo Brewin
  2015-09-01  1:24   ` Anh Vo
  2015-09-01  7:44   ` Markus Schöpflin
@ 2015-09-01  9:17   ` G.B.
  2 siblings, 0 replies; 17+ messages in thread
From: G.B. @ 2015-09-01  9:17 UTC (permalink / raw)


On 01.09.15 02:33, Leo Brewin wrote:
> Hi Folks,
>
> I've trawled through the Adacore web site but I can't find a page for submitting bug reports. I'm not a paid-up gnat-poro user so I don''t have access to their customer support.

As Anh Vo said; also, if you have saved a copy of the bug boxes
that were output by GNAT, it should have shown some instructions,
like which files to include in the report.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: bug in gnatgpl 2015?
  2015-09-01  1:24   ` Anh Vo
@ 2015-09-01 12:42     ` Simon Wright
  0 siblings, 0 replies; 17+ messages in thread
From: Simon Wright @ 2015-09-01 12:42 UTC (permalink / raw)


Anh Vo <anhvofrcaus@gmail.com> writes:

> On Monday, August 31, 2015 at 5:33:47 PM UTC-7, Leo Brewin wrote:
>> Hi Folks,
>> 
>> I've trawled through the Adacore web site but I can't find a page
>> for submitting bug reports. I'm not a paid-up gnat-poro user so I
>> don''t have access to their customer support.
>> 
>> Does anybody know how I should send the bug-report to Adacore?
>> 
> The address report@adacore.com should do it.

And the Subject: must include the word GNAT (even if you're submitting a
report about something else, e.g.gprbuild).

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: bug in gnatgpl 2015?
  2015-08-31  7:34 bug in gnatgpl 2015? Leo Brewin
                   ` (2 preceding siblings ...)
  2015-09-01  0:33 ` Leo Brewin
@ 2015-09-01 13:43 ` ahlan
  2015-09-01 13:45 ` ahlan
  4 siblings, 0 replies; 17+ messages in thread
From: ahlan @ 2015-09-01 13:43 UTC (permalink / raw)


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.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: bug in gnatgpl 2015?
  2015-08-31  7:34 bug in gnatgpl 2015? Leo Brewin
                   ` (3 preceding siblings ...)
  2015-09-01 13:43 ` ahlan
@ 2015-09-01 13:45 ` ahlan
  2015-09-10  7:31   ` Jerry van Dijk
  4 siblings, 1 reply; 17+ messages in thread
From: ahlan @ 2015-09-01 13:45 UTC (permalink / raw)


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;

A forgot to qualify by remark: I conducted my tests under Windows not OSX

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: bug in gnatgpl 2015?
  2015-09-01 13:45 ` ahlan
@ 2015-09-10  7:31   ` Jerry van Dijk
  0 siblings, 0 replies; 17+ messages in thread
From: Jerry van Dijk @ 2015-09-10  7:31 UTC (permalink / raw)


> > I'm using MacOSX 10.10.5 with the command line tools from Xcode 6.4.

Using fsf v5.2.0 on windows no bug:

gcc version 5.2.0 (Rev3, Built by MSYS2 project)
[MINGW32 /c/users/jerry/home/work] gnatmake crash
gcc -c crash.adb
gcc -c simplex.adb

-- 
-- Jerry van Dijk
-- Leiden, Holland
--
-- Some say I'm a grumpy 'ol wizzard, but that's not true.
-- I have the heart of a kind and gentle soul... in a jar, on my desk.


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2015-09-10  7:31 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-31  7:34 bug in gnatgpl 2015? Leo Brewin
2015-08-31  8:48 ` Simon Wright
2015-08-31  9:19   ` Leo Brewin
2015-08-31 10:51     ` Peter Chapin
2015-08-31 15:54       ` Anh Vo
2015-08-31 23:33         ` Anh Vo
2015-08-31 23:37           ` Leo Brewin
2015-08-31 23:55             ` Leo Brewin
2015-08-31 23:35 ` Leo Brewin
2015-09-01  0:33 ` Leo Brewin
2015-09-01  1:24   ` Anh Vo
2015-09-01 12:42     ` Simon Wright
2015-09-01  7:44   ` Markus Schöpflin
2015-09-01  9:17   ` G.B.
2015-09-01 13:43 ` ahlan
2015-09-01 13:45 ` ahlan
2015-09-10  7:31   ` Jerry van Dijk

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