From: Christoph Bartoschek <bartoschek@gmx.de>
To: gcc-help@gcc.gnu.org
Cc: "James Gregory" <james.jrg@gmail.com>
Subject: Re: Including <iostream> affects whether or not program freezes?
Date: Tue, 05 Aug 2008 06:45:00 -0000 [thread overview]
Message-ID: <200808050845.44715.bartoschek@gmx.de> (raw)
In-Reply-To: <beb51c260807100354n34ab20f8p1214fb31f54b2e97@mail.gmail.com>
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");
>
> <the function continues but though deleting it removes the bug, the
> 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
next prev parent reply other threads:[~2008-08-05 6:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-09 3:26 James Gregory
2008-07-09 12:03 ` Lionel B
2008-07-09 16:49 ` James Gregory
2008-07-09 18:08 ` Burlen Loring
2008-07-09 13:43 ` Andrew Bell
2008-07-09 14:35 ` Andrew Haley
2008-07-09 17:02 ` Chris Jefferson
2008-07-10 10:58 ` James Gregory
2008-08-05 6:45 ` Christoph Bartoschek [this message]
2008-08-05 9:31 ` James Gregory
2008-07-12 21:16 ` James Gregory
2008-07-12 21:05 ` James Gregory
2008-07-12 22:11 ` James Gregory
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200808050845.44715.bartoschek@gmx.de \
--to=bartoschek@gmx.de \
--cc=gcc-help@gcc.gnu.org \
--cc=james.jrg@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).