Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Hash Collision

Author: Matt Taylor

Date: 02:53:42 12/08/02

Go up one level in this thread


On December 07, 2002 at 19:24:52, Uri Blass wrote:

>On December 07, 2002 at 18:30:23, Bruce Moreland wrote:
>
>>On December 07, 2002 at 06:55:39, David Rasmussen wrote:
>>
>>>In my incremental move generator, I first check if there is a hash move, and if
>>>there is, then I check it for pseudo-legality. If it's not pseudo-legal, I
>>>conclude that there is a hash collision. The position that this move was stored
>>>from cannot be the same as the current, and still they have the same hash
>>>signature. In my program when this happens, I exit. I do this because this
>>>basically never happens. Until now. It was playing a game on ICC, and it
>>>suddenly exited. I could see from the log that this is what happened. So I was
>>>wondering: How often does this kind of collision happen for your engines?
>>>I think Bob Hyatt has mentioned that this happens in 1 of 100 games. It doesn't
>>>for me.
>>
>>It's no better to exit than to crash.  You are no less dead if you shoot
>>yourself before the impact.
>
>It is still better to exit(of course it is not the best choice).
>
>If I understood correctly a program that crash does something that the
>programmer did not plan and it may do some demage to the computer by deleting
>imprtant information(I do not know what can happen if you try to read from
>memory that does not exist).
>
>I guess that the probability for a demage is almost 0 because I had a lot of
>crashes during the developement of movei with no demage that I know but I
>believe that a demage can happen.
>
>Uri

You're right -- the probability of losing data from a crash is nearly 0.

Usually crashes don't do any damage unless coerced into doing so. A read/write
from/to an invalid address generates an exception at the hardware level. The
operating system then (usually) gives the program a chance to handle it. In some
cases, the program can regain control. In others, the default behavior is to
terminate before anything bad happens. You lose whatever data was in the program
at the time, but you don't lose anything more.

The only time when you lose more is when someone coerces the program to
read/write pseudo-valid memory. (That is, you read/write memory which you have
access to but shouldn't be messing with -- like writing out of bounds to an
array may modify other variables but not crash immediately.) Such exploits are
hard to find and even more difficult to control. Coincidentally, they are also
the ones that get fixed the quickest.

-Matt



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.