Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Bizar Question for programmers: very strange behaviour of my engine

Author: Paul Clarke

Date: 04:22:16 01/17/06

Go up one level in this thread


On January 16, 2006 at 16:16:13, JW de Kort wrote:

>Hi all,
>
>In my engine i want to use the following line:
>
>    !(bfZwart[kol+1]&bfBoven[rij])
>
>In only a few cases this lines crashes my engine. If i change the +1 to any
>other value there is no problem!
>
>Does anybody know were i have to look for to solve this problem? I do not
>understand how a comparison like the above can cause a program to crash.
>

Usually the only way I could see for this line to crash would be if kol+1 was
beyond the end of the bfZwart array (or similary for rij and bfBoven) and there
was no valid memory at the address that the code tried to read. That doesn't,
however, explain why the problem only occurs with kol+1 - it's unlikely that
kol+1 would access invalid memory but not kol+2. I wonder if there could be an
optimiser bug here? Does the problem occur if you compile with optimisation
switched off?



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.