basil00 / Gull

Gull chess (Linux/Mac port)
Other
29 stars 15 forks source link

Gull (Linux) occasionally crashes (sig 11) #2

Closed basil00 closed 8 years ago

basil00 commented 8 years ago

Gull (Linux) occasionally crashes, line 3033 Gull.cpp

Next->pst += Pst(IRook(me),rnew) - Pst(IRook(me),rold);

The problem is that do_move is called with a bogus move=0x7FFF value for whatever reason. This triggers the IsCastling conditional with to = from = 63. This results in rold being uninitialized, causing Gull to crash. The crash occurs in code that is not Linux specific.

basil00 commented 8 years ago

Test position that exhibits the crash: r7/2pnk3/4bp2/pN2p2P/P7/8/2K3P1/5R1R b - - 0 1

basil00 commented 8 years ago

This appears to be a copy-and-paste bug in gen_captures (s/PushE/PushW). This bug also affects the Windows version of Gull 3, although does not seem to cause it to crash. Fixed in be0a079.

Test position analysis after fix:

23  -0.67   1556.8M 0:00.00 Nc5 h6 Bb3+ Kc3 c6 Nc7 Rd8 Ra1 Bf7 h7 Rh8 Rh6 Kf8 Rh4 Kg7 Rg4+ Kf8 Rh1 f5 Rgh4 Kg7 R1h3 Ne4+ Kb2 Rb8+ Kc2 Kh8 Rf3 f4 Na6 Rb7 Rh6 Bd5 Rd3 Rxh7 Rxh7+ Kxh7