Computer Chess Club Archives


Search

Terms

Messages

Subject: need an advice how to detect a bug

Author: Uri Blass

Date: 07:38:20 11/03/02


I found that there is a bug in the latest version of movei and it seems based on
page 130 of the book "the practice of programming" that it is a memory
allocation error.

I see different behaviour in debug configuration and in release configuration.
I also saw different behaviour when I only added one printf.

My question is what is the fastest way to detect the bug.

I have a lot of arrays and adding a code to check if I wrote outside the
allocated memory in every place is a lot of work.

I think that it may be better if the compiler can do it for me(or maybe the
compiler can do it and I do not know how it can do it).

Is there a reason that prevent the compiler to check only in debug mode that
what I put in the arrays make sense before putting the information in the
arrays?

Note that I save previous versions of movei and I may try to compare number of
nodes in debug mode and release mode to try to find the latest version that has
the bug but the problem is that I cannot know that I have not the bug from
identical output and I can only know that I have a bug when the output is not
identical.

Uri



This page took 0.03 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.