comp.lang.ada
 help / color / mirror / Atom feed
From: Tero Koskinen <tero.koskinen@iki.fi>
Subject: Story of one GNAT bug
Date: Wed, 25 Mar 2015 22:02:24 +0200
Date: 2015-03-25T22:02:24+02:00	[thread overview]
Message-ID: <mev48i$1ih$1@loke.gir.dk> (raw)

Hi,

In the past Adacore has not been that active fixing
GNAT bugs so that they are fixed in FSF GCC also. But
recently I had totally opposite experience, so I wanted
to share the story of my bug.

January 15, 2015, I noticed that ICCAda was rejecting
YAMI4-GPL-1.10.0 code with following error:
"yami-parameters.ads", line 808: Error: Private extension has LIMITED 
keyword,
            but full type does not. [RM 7.3(10.1)]


After little discussion with Irvine/ICCAda support, I ended
up making following test case:
-- my_limited.ads
package My_Limited is
     type My_Limited_Type is tagged limited private;
private
     type My_Limited_Type is tagged limited record
        X : Integer;
     end record;
end My_limited;

-- my_limited_2.ads
with My_Limited;

package My_Limited_2 is
     type My_Limited_Type_2 is limited new My_Limited.My_Limited_Type 
with private;
private
     type My_Limited_Type_2 is new My_Limited.My_Limited_Type with 
record -- this line should have error
        Y : Integer;
     end record;
end My_Limited_2;
-- END of testcase

All tested GNAT versions, including GNAT GPL 2014 accepted
the code, so clearly GNAT did not have check for RM 7.3(10.1).

A GNAT Pro owner from #Ada IRC channel confirmed that the bug
was present also in GNAT Pro.

Next day (Jan 16), I reported the bug to Adacore via
http://libre.adacore.com/contact/ and it got ID "O116-026 public".

On Feb 5, the fix was pushed to GCC repositories with following
changelog entry:
 > 2015-02-05 Ed Schonberg <schonberg@adacore.com>
 > * sem_ch3.adb (Process_Full_View): Verify that the full view
 >   of a type extension must carry an explicit limited keyword if
 >   the partial view does (RM 7.3 (10.1)).

The commit itself is visible at:
https://github.com/gcc-mirror/gcc/commit/31831d39bf4840761c92c9fad5abf29b4feb7b50

So, it took about 3 weeks from the report to have the fix
in FSF GCC also.

A week later (Feb 12), I talked to ACAA technical agent
about the bug and possibility to add B test for the bug to
ACATS. Irvine support people were kept in the loop and they
found out some extra time to do the actual test and send
it to the technical agent.

The test was accepted and is visible at
http://www.ada-auth.org/cgi-bin/cvsweb.cgi/acats/new/b730010.a?rev=1.1

On March 19, the ACAA technical agent announced ACATS
modification list 4.0E and one of the modifications was:
 > New test B730010 checks that 7.3(10.1/3) is enforced.

As a result, from now on this bug should be impossible
to happen in any Ada compiler.

One should also note how important it is to have multiple
Ada compiler implementations (and to have possibility to
use multiple of them for the same source code). Without
ICCAda checking this, the bug could have been hiding in
GNAT for a long time.


TL;DR GNAT didn't check RM7.3(10). Reported bug to Adacore
and talked to ACAA technical agent about missing ACATS test.
Three weeks later, the fix was in FSF GCC repositories and
the test in ACATS.

Yours,
  Tero

PS. I didn't report this to YAMI4 author. The source
code had also some other issues and I ran out of free
time for a proper bug report.


             reply	other threads:[~2015-03-25 20:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-25 20:02 Tero Koskinen [this message]
2015-03-25 21:07 ` Story of one GNAT bug Randy Brukardt
replies disabled

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