Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Story of one GNAT bug

121 views
Skip to first unread message

Tero Koskinen

unread,
Mar 25, 2015, 4:02:27 PM3/25/15
to
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 <scho...@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.

Randy Brukardt

unread,
Mar 25, 2015, 5:07:13 PM3/25/15
to
"Tero Koskinen" <tero.k...@iki.fi> wrote in message
news:mev48i$1ih$1...@loke.gir.dk...
...
> 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 week later (Feb 12), I talked to ACAA technical agent
> about the bug and possibility to add B test for the bug to
> ACATS.

You left out one step here. It turns that not only did GNAT not check the
rule in question, but also that there was an ACATS test which expected it to
be legal. (That probably happened in part because the test was checking a
different rule in 7.3, and using GNAT to check whether it was correct did
not turn up the violation of 7.3(10.1/3).)

It's also strange that there wasn't a test for that rule; I thought I had
checked all of the new (since Ada 95) rules in 7.3 and that obviously wasn't
true. But now it is. :-)

Randy Brukardt, ACAA Technical
Agent




0 new messages