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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,23d2475711dc99b8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-03-11 09:14:03 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!feed.news.tiscali.de!uio.no!ntnu.no!not-for-mail From: Preben Randhol Newsgroups: comp.lang.ada Subject: Re: A bug in Gnat, or in my code? Date: Thu, 11 Mar 2004 17:14:03 +0000 (UTC) Organization: PVV Message-ID: References: NNTP-Posting-Host: k-083152.nt.ntnu.no Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: tyfon.itea.ntnu.no 1079025243 16246 129.241.83.152 (11 Mar 2004 17:14:03 GMT) X-Complaints-To: usenet@itea.ntnu.no NNTP-Posting-Date: Thu, 11 Mar 2004 17:14:03 +0000 (UTC) User-Agent: slrn/0.9.8.0 (Linux) Xref: archiver1.google.com comp.lang.ada:6246 Date: 2004-03-11T17:14:03+00:00 List-Id: On 2004-03-11, Bj�rn Persson wrote: > Preben Randhol wrote: > >> I see. I think you have a bug in that you forgot to trim the text. > > No, that's intentional. There might be cases where the value must be > used as it is, with possible spaces. In fact, I just removed the Trim on > the name. I improved another part of the program and then the trimming > became unnecessary. > >> Anyhow I made a test of your program and ran it on gnat 3.3.3 from >> Debian and it works there. No crash. So maybe it is only the packaging >> of RedHat? A program shouldn't segmentation fault and this is typically >> an indication of a packaging/installation error. > > The Trim you inserted hides the bug, because Trim returns a more > conventional null string that doesn't cause problems in > To_Unbounded_String. After I removed it, your program crashes for me. > > Did you try my test program on that version of Gnat? > % apt-get install gnat-3.3 (I just love the package system in Debian. One command and it is installed :-) ) Now to the case. I removed both trims and now I get: % gnatmake -gnatv -f klyv_test gcc-3.3 -c -gnatv klyv_test.adb GNAT 3.3.3 (Debian) Copyright 1992-2002 Free Software Foundation, Inc. Compiling: klyv_test.adb (source file time stamp: 2004-03-11 17:12:00) 45 lines: No errors gnatbind -x klyv_test.ali gnatlink klyv_test.ali k-083152(randhol:~)% ./klyv_test Ada 95 = morsomt => Ada 95 & morsomt raised STORAGE_ERROR : stack overflow (or erroneous memory access) Do you get a STORAGE_ERROR or do you get a segmentation fault? -- Rox-Filer; *the* file manager => http://rox.sf.net/