From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15258 invoked by alias); 5 Aug 2008 06:45:47 -0000 Received: (qmail 15249 invoked by uid 22791); 5 Aug 2008 06:45:46 -0000 X-Spam-Check-By: sourceware.org Received: from mail.gmx.net (HELO mail.gmx.net) (213.165.64.20) by sourceware.org (qpsmtpd/0.31) with SMTP; Tue, 05 Aug 2008 06:45:04 +0000 Received: (qmail invoked by alias); 05 Aug 2008 06:45:01 -0000 Received: from p5087DE05.dip.t-dialin.net (EHLO burns.bruehl.pontohonk.de) [80.135.222.5] by mail.gmx.net (mp042) with SMTP; 05 Aug 2008 08:45:01 +0200 X-Authenticated: #1174187 From: Christoph Bartoschek To: gcc-help@gcc.gnu.org Subject: Re: Including affects whether or not program freezes? Date: Tue, 05 Aug 2008 06:45:00 -0000 User-Agent: KMail/1.9.9 Cc: "James Gregory" References: <5cc6b04e0807090949g30d5aacckc170e6068093e5a4@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200808050845.44715.bartoschek@gmx.de> X-Y-GMX-Trusted: 0 X-FuHaFi: 0.64 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-08/txt/msg00042.txt.bz2 Am Donnerstag 10 Juli 2008 schrieb James Gregory: > A minimal version of the function which freezes is something like: > > bool AIInterpreter::is_group_like_this(int n_side, int n_group) { > //it is the second condition (scanned_groups) which triggers this > code branch, but deleting anything at all here removes the bug > if ((!sides[n_side].groups[n_group].get_alive()) > > || !sides[my_side].scanned_groups[n_side][n_group] > || sides[n_side].groups[n_group].get_in_hangar()) { > > while (l_iter != l_end) > ++l_iter; > return false; > } > write_log(L"it never gets this far"); > > fact the above log never gets written means it is probably irrelevant> > } > > So I guess "while (l_iter != l_end)" is becoming an infinite loop, but > if I log the value of &(*l_iter) and &(*l_end) on each loop then a) it > removes the bug and b) there is nothing obviously wrong. Anything else > I can do? Did you find the bug? What was the problem? If you did not find it yet: 1. Check with a debugger that the while loop is indeed an endless loop. 2. You did not show what containers l_iter and l_end come from and what happens with the containers in this function. Christoph