gnugo-devel
[Top][All Lists]
Advanced

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

Re: [gnugo-devel] Access violation in 3.3.18 compiled with Visual C


From: Gunnar Farneback
Subject: Re: [gnugo-devel] Access violation in 3.3.18 compiled with Visual C
Date: Sun, 27 Apr 2003 20:23:23 +0200
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)

SP Lee wrote:
> I have compiled GNUGO 3.3.18 using Visual C and played with it and found it 
> often stopped due to "access violation", which is generated in windows 98. 
> In windows XP this becomes "signature error". In the attached example, the 
> GNUGO stopped at MEMCPY.ASM (some instructions further from the label 
> CopyUp) after 16 time calls of do_owl_analyze_semeai. GNUGO plays black in 
> this example.
> 
> I'm not sure if this also happens in unix environment.

I cannot reproduce this on linux.

Teun wrote:
> I can confirm this for the mingw versions. The cygwin version gives
> S7 as move.
> [...]
> #0  0x78001637 in memcpy () from /dev/c/WINDOWS/SYSTEM/MSVCRT.DLL
> #1  0x00469fd8 in do_owl_analyze_semeai (apos=255, bpos=154, owla=0xf0460c, 
> owlb=0xf0d1f4, komaster=0, kom_pos=0, resulta=0xe016f8, resultb=0xe016fc, 
> move=0xe00fe8, pass=0, owl_phase=1) at ../../engine/owl.c:828

This seem to indicate a problem with the "under certain circumstances,
store only the goal array" optimization. Thinking about it the
optimization is probably invalid after the recent revisions, in
particular since we are now calling do_owl_attack() if one of the
dragons is captured. Please test whether the appended patch solves the
problem.

If it's not effective, the main thing to check next is whether
everything is really properly set up before calling do_owl_attack().

/Gunnar

Index: engine/owl.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/owl.c,v
retrieving revision 1.151
diff -u -r1.151 owl.c
--- engine/owl.c        22 Apr 2003 02:48:05 -0000      1.151
+++ engine/owl.c        27 Apr 2003 18:13:49 -0000
@@ -399,7 +399,6 @@
   struct owl_move_data common_liberty;
   struct owl_move_data backfill_outside_liberty;
   struct owl_move_data backfill_common_liberty;
-  char saved_goal[BOARDMAX];
   int safe_outside_liberty_found = 0;
   int safe_common_liberty_found = 0;
   char mw[BOARDMAX];  
@@ -795,10 +794,7 @@
       TRACE("%s, value %d, same_dragon %d\n", moves[k].name, moves[k].value,
            moves[k].same_dragon);
 
-      if (owl_phase && stackp <= SEMEAI_BRANCH_DEPTH + 1)
-       push_owl(&owla, &owlb);
-      else
-       memcpy(saved_goal, owla->goal, sizeof(saved_goal));
+      push_owl(&owla, &owlb);
       
       owl_update_goal(mpos, moves[k].same_dragon, owla, 1);
       owla->lunches_are_current = 0;
@@ -820,12 +816,9 @@
        this_resultb = REVERSE_RESULT(this_resultb);
       }
 
-      if (owl_phase && stackp <= SEMEAI_BRANCH_DEPTH + 1) {
-       pop_owl(&owlb);
-       pop_owl(&owla);
-      }
-      else
-       memcpy(owla->goal, saved_goal, sizeof(saved_goal));
+      pop_owl(&owlb);
+      pop_owl(&owla);
+      
       popgo();
 
       if (ko_move) {





reply via email to

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