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 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!news.ecp.fr!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: Tero Koskinen Newsgroups: comp.lang.ada Subject: Story of one GNAT bug Date: Wed, 25 Mar 2015 22:02:24 +0200 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: NNTP-Posting-Host: 37-136-50-8.rev.dnainternet.fi Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: loke.gir.dk 1427313746 1617 37.136.50.8 (25 Mar 2015 20:02:26 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Wed, 25 Mar 2015 20:02:26 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 Xref: news.eternal-september.org comp.lang.ada:25255 Date: 2015-03-25T22:02:24+02:00 List-Id: 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 > * 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.