gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] Crasch in combinations.c


From: Gunnar Farneback
Subject: [gnugo-devel] Crasch in combinations.c
Date: Fri, 09 Nov 2001 18:08:09 +0100
User-agent: EMH/1.14.1 SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.3 Emacs/20.7 (sparc-sun-solaris2.7) (with unibyte mode)

Appended is a game record and a patch. Generating a move at the end of
the game record crashes GNU Go 3.1.13 in the function
find_double_threats(). Applying the patch solves the problem. The
patch has been added to CVS.

/Gunnar

(;GM[1]FF[4]
SZ[19]HA[0]KM[0.5]
PW[GnuGo (GNU Go 3.1.13)]WR[14k*]
PB[pooo]BR[9k*]
PC[NNGS]DT[2001-11-08]AP[gnugoclient:2.0]
;B[pp];W[cd];B[ed];W[hd];B[df];W[qd];B[od];W[ld];B[qc];W[rc];B[pc]
;W[dp];B[cc];W[bc];B[dc];W[bf];B[bb];W[nq];B[lq];W[qq];B[qp];W[pq]
;B[op];W[nr];B[np];W[ne]C[L:5];B[qe];W[pe]C[L:3];B[pd];W[qf];B[rd]
;W[oe]C[L:4];B[be];W[dj]C[L:5];B[fq];W[hq];B[gp];W[cn]C[L:3];B[rf]
;W[qg]C[L:4];B[qj];W[er]C[L:5];B[fr];W[eq]C[L:4];B[ep];W[dq]C[L:3]
;B[bg];W[dh]C[L:4];B[bk];W[eg];B[dl];W[nc]C[L:5];B[nd];W[pi];B[pj]
;W[ni];B[lc];W[kc]C[L:4];B[mc];W[fc]C[L:3];B[kd];W[le]C[L:2];B[jc]
;W[kb]C[L:1];B[jd];W[mb]C[L:0];B[md];W[hb];B[jb];W[lb];B[me];W[mf]
C[L:1];B[lf];W[ke];B[je];W[kf];B[jf];W[lg]C[L:2];B[kg];W[lf]C[L:3]
;B[gf];W[kh]C[L:2];B[gj];W[bj]C[L:0];B[ck];W[ek];B[cj];W[fl]C[L:1]
;B[dn];W[eb]C[L:0];B[db];W[hf]C[L:1];B[he];W[ic]C[L:0];B[gd];W[hl]
;B[jg];W[gc];B[ib];W[co]C[L:1];B[gm];W[gl];B[el];W[hi];B[fj];W[fm]
;B[ej];W[eo]C[L:0];B[hp];W[fp];B[iq];W[fk];B[di];W[dk];B[ei];W[ji]
;B[hg];W[cm]C[L:1];B[cl];W[hj];B[lh];W[li];B[nf];W[mh];B[pf];W[pg]
C[L:2];B[og];W[ml]C[L:3];B[om];W[ol]C[L:4];B[pl];W[kl]C[L:5];B[nl]
;W[ok];B[oj];W[nk];B[oh]C[Program crashed.
game adjourned])

Index: engine/combination.c
===================================================================
RCS file: /cvsroot/gnugo//gnugo/engine/combination.c,v
retrieving revision 1.2
diff -u -r1.2 combination.c
--- engine/combination.c        2001/10/28 15:35:07     1.2
+++ engine/combination.c        2001/11/09 17:06:28
@@ -107,8 +107,18 @@
               *       that we already know of a common threat point for
               *       the two strings.
               * Besides, attack_either is currently (3.1.11) not very good.
+              *
+              * The call to attack() is intended to detect the case
+              * where the move at ii is a snapback capture.
               */
-             if (!defend_both(a_threatened_groups[k], a_threatened_groups[l]))
+             if (board[a_threatened_groups[k]] == EMPTY
+                 || board[a_threatened_groups[l]] == EMPTY) {
+               if (!attack(ii, NULL))
+                 add_attack_either_move(ii, a_threatened_groups[k], 
+                                        a_threatened_groups[l]);
+             }
+             else if (!defend_both(a_threatened_groups[k],
+                                   a_threatened_groups[l]))
                add_attack_either_move(ii, a_threatened_groups[k], 
                                       a_threatened_groups[l]);
            }



reply via email to

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