bug-gnubg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnubg] Crash during play


From: Joern Thyssen
Subject: Re: [Bug-gnubg] Crash during play
Date: Fri, 29 Nov 2002 14:43:10 +0000
User-agent: Mutt/1.4i

On Fri, Nov 29, 2002 at 02:02:19PM +0100, Jim Segrave wrote
> On Fri 29 Nov 2002 (12:21 +0100), Nardy Pillards wrote:
> 
> I've got a bad feeling about this:
> I assume, again, I haven't looked deeply into the code, that gnubg
> either doesn't use the first 40 entries of the database, which appear
> to be filled with an ID string. But...
> 
> Under Unix we have:
> 
> static unsigned char acBearoff1[] = { 
>    0x67, 0x6E, 0x75, 0x62, 0x67, 0x2D, 0x4F, 0x53, 
>    0x2D, 0x30, 0x36, 0x2D, 0x31, 0x35, 0x2D, 0x31, 
>    0x2D, 0x31, 0x2D, 0x30, 0x78, 0x78, 0x78, 0x78, 
>    0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 
>    0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x0A, 
>    0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 
> 
> Which is 'GNUBG-OS-06-15-1-1-0xxxxxxxxxxxxxxxxxxx\n'
> 
> And the Windows version has:
> static unsigned char acBearoff1[] = { 
>    0x67, 0x6E, 0x75, 0x62, 0x67, 0x2D, 0x4F, 0x53, 
>    0x2D, 0x30, 0x36, 0x2D, 0x31, 0x35, 0x2D, 0x31, 
>    0x2D, 0x31, 0x2D, 0x30, 0x78, 0x78, 0x78, 0x78, 
>    0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 
>    0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x0D, 
>    0x0A, ...
> 
> Note the extra \r in this output, which will move the whole database
> off by one byte. This will also kill every other occurence of 0x0a
> everywhere in the database (15432 times). I suspect this is not
> desireable behaviour. 

wow! Excellent work! I'll bet 5 DKR that this is the problem! The first
40 bytes is the header: gnubg reads this line to find out what kind of
database it is. The newline was added so one could easily check the
header with "head -1 xx.bd". 

The next 100k bytes is offsets and sizes. 

With the unix version:

To find the bearoff data for position 0 the address is
0x00 0x00 0x00 0x00    -> 0x00000000

There are 0x01 probability entries with offset 0x00 into the array, and
0x01 gammon probabilities with offset 0x00.

However, with the windows version :

position offset: 0x0A00000000
bearoff dist: 0x00 with offset 0x01
gammon dist: 0x00 with offset 0x01

which is basically rubbish.

It's easy to imagine that one of the position offsets points outside the
memory for the application: seg fault!


Does anyone know of other operating systems beside win that uses 0x0D
0x0A for newlines?

Jørn

-- 
Joern Thyssen, PhD
Vendsysselgade 3, 3., DK-9000 Aalborg, Denmark
+45 9813 2791 (private) / +45 2818 0183 (mobile) / +45 9633 7036 (work)
Note: new mobile number!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]