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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,fb264cdd67c2f20f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news.germany.com!news.tu-darmstadt.de!newsfeed.hanau.net!noris.net!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: A smaller self contained test case. Was: Compiler Bug or what I'm doing wrong? Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <05lkrrojfd.fsf@hod.lan.m-e-leypold.de> Date: Sat, 24 Jun 2006 13:46:42 +0200 Message-ID: <1cfjjgsg6wwv4.44snml2yzt42$.dlg@40tude.net> NNTP-Posting-Date: 24 Jun 2006 13:46:42 MEST NNTP-Posting-Host: 0a00dfd2.newsread2.arcor-online.net X-Trace: DXC=H[gMdm@kY?RghFd\k@b23TQ5U85hF6f;TjW\KbG]kaMX[NGU2GAcMGZI;0c7@T6oeZWRXZ37ga[7ZjTA67ckJ=XUo=j@2FbkeD] X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:4961 Date: 2006-06-24T13:46:42+02:00 List-Id: On 23 Jun 2006 11:55:23 +0200, M E Leypold wrote: > I'm attaching a smaller (and now self contained test case!) for the > SIGSEGV whil reading/writing varaint records which I wrote about > earlier. > > Some data: > > 1. Gnat 3.15p on Debian Sarge. > 2. Running the attached program wil result in a SIGSEGV in a finalizer. > > I'm also attaching a short backtrace. Well, it looks like a bug to me. ARM 13.13.2 (9) reads: "If T is a discriminated type, discriminants are included only if they have defaults." which assumes that if they have, then 'Write/'Read should handle them properly. When the discriminant is set to false before making 'Read, the program works as expected. The problem is essentially: type Foo (C : Boolean := True) is ...; X : Foo (False); ... Foo'Write (S, X); Y : Foo (True); ... Foo'Read (S, Y); -- Boom Any language lawyers, here? -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de