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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,939bba6defed3e0d X-Google-Attributes: gid103376,public From: Tucker Taft Subject: Re: problem solved, but I don't know why (was: GNAT implementation bug) Date: 2000/04/14 Message-ID: <38F79277.84A3262E@averstar.com>#1/1 X-Deja-AN: 611289003 Content-Transfer-Encoding: 7bit References: <8d7n1a$ee6@journal.concentric.net> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@inmet2.burl.averstar.com X-Trace: inmet2.burl.averstar.com 955748983 5053 141.199.8.164 (14 Apr 2000 21:49:43 GMT) Organization: AverStar (formerly Intermetrics) Burlington, MA USA Mime-Version: 1.0 NNTP-Posting-Date: 14 Apr 2000 21:49:43 GMT Newsgroups: comp.lang.ada Date: 2000-04-14T21:49:43+00:00 List-Id: 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