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.5 required=5.0 tests=BAYES_00,STOX_REPLY_TYPE autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,a575249b5f286bfe X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.205.119.5 with SMTP id fs5mr310566bkc.7.1334345284595; Fri, 13 Apr 2012 12:28:04 -0700 (PDT) Path: h15ni119906bkw.0!nntp.google.com!news2.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!news.musoftware.de!wum.musoftware.de!feeder.erje.net!feed.xsnews.nl!border-1.ams.xsnews.nl!post-feeder-02.xsnews.nl!frontend-F09-09.ams.news.kpn.nl From: "ldries46" Newsgroups: comp.lang.ada References: <4f881910$0$2652$703f8584@news.kpn.nl> <5o86o2smbjpz.17l849bmku28v$.dlg@40tude.net> In-Reply-To: <5o86o2smbjpz.17l849bmku28v$.dlg@40tude.net> Subject: Re: Garbage Collection ??? Date: Fri, 13 Apr 2012 21:27:23 +0200 MIME-Version: 1.0 X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 15.4.3538.513 X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3538.513 Message-ID: <4f888010$0$2641$703f8584@news.kpn.nl> Organization: KPN.com NNTP-Posting-Host: 77.168.179.107 X-Trace: 1334345744 news.kpn.nl 2641 77.168.179.107@kpn/77.168.179.107:50386 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit Date: 2012-04-13T21:27:23+02:00 List-Id: I have been trying to find the place where a faulty pointer could have been introduced and I come to the conclusion that the return of a procedure in the place. I did position some variables (edge_debug1 till edge_debug4) to be filled with the value of the original pointer at various places in and around the procedure Edge_Force and printed them after the breakpoint. The code there is now: while edges /= NULL loop edge_debug3 := edges; Edge_Force(edges); edge_debug4 := edges; edges := edges.next; end loop; where Edge_Force code is: procedure Edge_Force(edge1 : ptr_Edge) is len : float; begin edge_debug1 := edge1; len := Length(edge1.P1.pnt, edge1.P2.pnt) - edge1.l_init; if abs(len / edge1.l_init) < 0.00001 then len := 0.0; end if; edge1.force := edge1.k_s * len; edge_debug2 := edge1; end Edge_Force; (gdb) print stedges $43 = (access general.edge) 0x3e0d568 (gdb) print edges $45 = (access general.edge) 0x0 (gdb) print edge_debug3 $48 = (access general.edge) 0x3db8200 (gdb) print edge_debug1 $51 = (access general.edge) 0x3db8200 (gdb) print edge_debug2 $53 = (access general.edge) 0x3db8200 (gdb) print edge_debug4 $55 = (access general.edge) 0x0 It can be seen that only the end of the procedure Edge_Force is between the creation of edge_debug2 and edge_debug4 The reason that I originally thought about Garbage collection is that I imagined that perhaps use of too much memory could be the reason. Regards, L. Dries "Dmitry A. Kazakov" schreef in bericht news:5o86o2smbjpz.17l849bmku28v$.dlg@40tude.net... On Fri, 13 Apr 2012 14:14:43 +0200, ldries46 wrote: > What also causes the changed value of edges within the loop. Can it be > some > garbage problem. (Fortunately, Ada does not have mandated GC). Most likely you have a dangling pointer somewhere. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de