comp.lang.ada
 help / color / mirror / Atom feed
From: Tucker Taft <stt@averstar.com>
Subject: Re: problem solved, but I don't know why (was: GNAT implementation bug)
Date: 2000/04/14
Date: 2000-04-14T21:49:43+00:00	[thread overview]
Message-ID: <38F79277.84A3262E@averstar.com> (raw)
In-Reply-To: 8d7n1a$ee6@journal.concentric.net

Steve Arnold wrote:
> 
> It looks like I solved the problem, but I still have no idea why there was a
> problem in the first place (being a newbie, it seems like it *should've*
> worked).
> 
> When I replaced the following (in Remove):
> 
>        if List.Count = 1 then
>           Clear(List) ;
>        elsif List.Cursor = List.Head then...
> 
> with the actual code from Clear:
> 
>        if List.Count = 1 then
>           List := (Count => 0, Traversing => False, others => null) ;
>        elsif List.Cursor = List.Head then...
> 
> it started working correctly.  But I still have at least two questions (on
> this particular issue, anyway ;)
> 
> 1) Why did this code behave differently when running under Linux than when
> running under windoze?  (obvious answer: windoze is brain-dead)

It could be a bug in the gcc back end for Linux, or it
could be a problem with a small default stack size.

> 
> 2) Why did my trivial change fix it?

You "hand-inlined" one function, which conceivably might lessen
the stack requirements.  Or it is a codegenerator bug, and you
made a small change which happened to eliminate the combination
of constructs which hit the latent bug.

> 
> In other parts of these packages, I call functions/procedures that were
> defined in the same package, and it always worked...

It sounds like a bug in the run-time system, the code generator,
or a too-small default stack size.  I wouldn't try to figure
out what *you* did wrong.  It is probably someone else's fault.

> ... Just what is going on here?  When is it safe to do
> this (if ever) and when is it not safe?

You seem to have been unlucky enough to bump into a compiler or run-time
bug.

-- 
-Tucker Taft   stt@averstar.com   http://www.averstar.com/~stt/
Technical Director, Distributed IT Solutions  (www.averstar.com/tools)
AverStar (formerly Intermetrics, Inc.)   Burlington, MA  USA




  parent reply	other threads:[~2000-04-14  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-04-14  0:00 problem solved, but I don't know why (was: GNAT implementation bug) Steve Arnold
2000-04-14  0:00 ` problem solved (and now I know why) Stephen Arnold
2000-04-15  0:00   ` Florian Weimer
2000-04-14  0:00 ` Tucker Taft [this message]
2000-04-15  0:00   ` problem solved, but I don't know why (was: GNAT implementation bug) Robert Dewar
replies disabled

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