gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] bugs report


From: pcibusgood
Subject: [gnugo-devel] bugs report
Date: Fri, 11 Jul 2003 07:17:04 +0800

bugs report:

version:gnugo 3.3.22
os:windows 2000
compiler:Visual C++ 6.0

English poor, pcibusgood.

1.memory leak report:

1.1 engine\owl.c 5354 line. leak 1,002,848 bytes.
owl_stack = malloc(owl_stack_size * sizeof(*owl_stack));

1.2 engine\cache.c 226 line. leak 3,632,172 bytes.
table->all_results = (Read_result *) malloc(num_results * sizeof(Read_result));

1.3 engine\cache.c 217 line. leak 3,459,216 bytes.
table->all_nodes = (Hashnode *) malloc(num_nodes * sizeof(Hashnode));

1.4 engine\cache.c 210 line. leak 1,297,204 bytes.
table->hashtable = (Hashnode **) malloc(tablesize * sizeof(Hashnode *));

1.2 1.3 1.4 in function
static int hashtable_init(Hashtable *table, int tablesize, int num_nodes, int 
num_results).

1.5 sgf\sgfnode.c 67 line. leak 323 bytes. (run more times)
void *pt = malloc(size);

1.6 sgf\sgfnode.c 81 line. leak 15 bytes.
void *ptnew = realloc(pt, size);

1.7 engine\cache.c 259 line. leak 36 bytes.
table = (Hashtable *) malloc(sizeof(Hashtable));

1.8 engine\dragon.c 746 line. leak 504 bytes. (run more times)
dragon2 = malloc(number_of_dragons * sizeof(*dragon2));
This bug unknown reason, free() can`t free memory.
memory leak increase. 168,504,840 ...
168 = sizeof(*dragon2). 168*3 = 504. 168*5=840.
number_of_dragons = 3 or number_of_dragons = 5.

2.error report:

2.1 Reading overflows memory (sometimes occur)
engine\utils.c 201 line.
pos = va_arg(ap, int);
engine\utils.c 393 line.in function play_attack_defend_n().
zpos = va_arg(ap, int);
engine\utils.c 480 line. in function play_attack_defend2_n().
zpos = va_arg(ap, int);

2.2 Reading uninitialized memory (sometimes occur)
engine\optics.c 1811 line.
int tmp_point = heye[pos].attack_point[r];
engine\optics.c 1820 line.
int tmp_point = heye[pos].defense_point[r];

2.3 Assigning pointer out of range (sometimes occur)
utils\gg_utils.c 379 line
char *end = (char *) base + width * (nel - 1);

2.4 Expression uses unrelated pointers (sometimes occur)
utils\gg_utils.c 384 line
for (a = base, b = a + gap * width; b <= end; a += width, b += width)

Repair 2.4:
The solution for this problem is to avoid using this construct, 
since it is undefined in ANSI C. 
However, this construct is supported on many systems and frequently used. 

BoundsChecker

china.
______________________________________

===================================================================

Attachment: bugs.txt
Description: application/msdownload


reply via email to

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