comp.lang.ada
 help / color / mirror / Atom feed
From: Preben Randhol <randhol+valid_for_reply_from_news@pvv.org>
Subject: Re: A bug in Gnat, or in my code?
Date: Thu, 11 Mar 2004 17:14:03 +0000 (UTC)
Date: 2004-03-11T17:14:03+00:00	[thread overview]
Message-ID: <slrnc517ir.dap.randhol+valid_for_reply_from_news@k-083152.nt.ntnu.no> (raw)
In-Reply-To: m214c.85788$dP1.242655@newsc.telia.net

On 2004-03-11, Bj�rn Persson <spam-away@nowhere.nil> 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/



  reply	other threads:[~2004-03-11 17:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-11  3:18 A bug in Gnat, or in my code? Björn Persson
2004-03-11  7:47 ` Preben Randhol
2004-03-11 12:48   ` Georg Bauhaus
2004-03-11 13:59     ` Björn Persson
2004-03-12 16:21       ` Florian Villoing
2004-03-12 23:01         ` Björn Persson
2004-03-11 14:29   ` Björn Persson
2004-03-11 14:59     ` Preben Randhol
2004-03-11 17:08       ` Björn Persson
2004-03-11 17:14         ` Preben Randhol [this message]
2004-03-11 18:15           ` Björn Persson
2004-03-11 15:08     ` Preben Randhol
2004-03-12  2:59 ` Björn Persson
2004-03-12  5:25   ` Per Sandberg
2004-03-12 23:01     ` Björn Persson
2004-03-12 11:11   ` Manuel Collado
2004-03-12 23:01     ` Björn Persson
replies disabled

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