Hint: Valgrind bound checker
Posted: 10 Oct 2005, 13:37
Hello,
i had the problem that my engine has a lot of bound problems and my memory management leak at some points. During the last days i used the boundchecker "Valgrind", http://www.valgrind.org , and could fix a lot of errors This program is really nice and shows you your errors and is _very_ easy to use )
No much changes in my Makefile:
Output looks like:
i had the problem that my engine has a lot of bound problems and my memory management leak at some points. During the last days i used the boundchecker "Valgrind", http://www.valgrind.org , and could fix a lot of errors This program is really nice and shows you your errors and is _very_ easy to use )
No much changes in my Makefile:
- Code: Select all
#
# Makefile for Homer
# written by Daniel Mehrmann
#
# Compiler
CC = gcc
# Compilerflags
# -mcpu is removed since gcc 3.4
#
# valgrind debug
CFLAGS = -O0 -g -fomit-frame-pointer -pipe
#CFLAGS = -O3 -march=i686 -fomit-frame-pointer -pipe
Output looks like:
- Code: Select all
daniel@fis615:~/current> valgrind --leak-check=yes ./homer
==24321== Memcheck, a.k.a. Valgrind, a memory error detector for x86-linux.
==24321== Copyright (C) 2002-2003, and GNU GPL'd, by Julian Seward.
==24321== Using valgrind-2.0.0, a program supervision framework for x86-linux.
==24321== Copyright (C) 2000-2003, and GNU GPL'd, by Julian Seward.
==24321== Estimated CPU clock rate is 1541 MHz
==24321== For more details, rerun with: -v
==24321==
Chessprogram Homer
Copyright Daniel Mehrmann 2003-2005
http://www.homer-chess.com, info@homer-chess.de
Version: 1.02
Build: 18
This program is free for personal use
compiled Oct 10 2005 14:20:53
Reading homer.ini
Hashtable = 8 MB
Pawn value = 100 points
Knight value = 420 points
Bishop value = 420 points
Rook value = 620 points
Queen value = 1240 points
Max QS depth = 12 ply
Ponder = off
Logging = off (homer.log)
Init hash memory. This may take a moment...
info Allocate main hashtable memory, rc = 4125
info Allocate depth hashtable memory, rc = 2062
info Allocate eval hashtable memory, rc = 328
info Allocate pawn hashtable memory, rc = 234
info Allocate memory for hashtables, rc = 7686
Homer is ready for playing
uci
id name Homer 1.02
id author Daniel Mehrmann
option name Ponder type check default false
option name HistoryPruning type check default true
option name MultiCutPruning type check default true
option name NoiseReduction type check default true
option name HumanPlayStyle type check default false
option name NullMove type combo default secure var secure var strong var low var agressive
option name Hash type spin min 8 max 512 default 8
option name Pawn type spin default 100 min 50 max 150
option name Knight type spin default 420 min 370 max 470
option name Bishop type spin default 420 min 370 max 470
option name Rook type spin default 620 min 570 max 620
option name Queen type spin default 1240 min 1190 max 1290
option name Max_QS_Depth type spin default 12 min 0 max 16
option name Clear_Hash type button
option name MultiPV type spin min 1 max 6 default 1
option name UCI_EngineAbout type string default Homer 1.02 by Daniel Mehrmann, http://www.homer-chess.com, info@homer-chess.de
option name UCI_AnalyseMode type check default false
option name UCI_ShowCurrLine type check default false
option name UCI_Chess960 type check default false
uciok
go infinite
info depth 1 seldepth 1
info score cp 0 depth 1 seldepth 4 nodes 895 nps 3162 time 284 pv b1c3 b8c6
info depth 2 seldepth 2
info score cp 0 depth 2 seldepth 2 nodes 915 nps 3060 time 299 pv b1c3 b8c6
info depth 3 seldepth 3
info score cp 49 depth 3 seldepth 5 nodes 1211 nps 3317 time 365 pv b1c3 b8c6 g1f3
info depth 4 seldepth 4
info score cp 0 depth 4 seldepth 8 nodes 2803 nps 4062 time 690 pv b1c3 b8c6 g1f3 g8f6
info depth 5 seldepth 5
info score cp 31 depth 5 seldepth 12 nodes 19400 nps 6148 time 3155 pv g1f3 e7e6 b1c3 f8c5
info depth 6 seldepth 6
info score cp 14 depth 6 seldepth 12 nodes 34519 nps 6482 time 5325 pv g1f3 g8f6 b1a3 b8c6 a3c4
info depth 7 seldepth 7
info score cp 25 depth 7 seldepth 13 nodes 66782 nps 6756 time 9884 pv b1c3 g8f6 d2d4 b7b6 g1f3 d7d5
info depth 8 seldepth 8
info score cp 9 depth 8 seldepth 14 nodes 88191 nps 6745 time 13074 pv b1c3 g8f6 d2d4 d7d5 d1d3 b8c6 c1f4
info score cp 9 depth 8 seldepth 18 nodes 189522 nps 6497 time 29168 pv b1c3 g8f6 d2d4 d7d5 d1d3 b8c6 c1f4
info depth 9 seldepth 9
info score cp 16 depth 9 seldepth 18 nodes 236457 nps 6523 time 36245 pv b1c3 g8f6 d2d4 d7d5 g1f3 c8g4 c1f4 b8c6
info score cp 16 depth 9 seldepth 18 nodes 277341 nps 6381 time 43462 pv b1c3 g8f6 d2d4 d7d5 g1f3 c8g4 c1f4 b8c6
info depth 10 seldepth 10
info score cp 15 depth 10 seldepth 20 nodes 377338 nps 6408 time 58884 pv b1c3 g8f6 d2d4 d7d5 g1f3 b8c6 c1f4 f6h5 d1c1 c8f5
stop
bestmove b1c3
quit
info string Homer: Hope see you soon again :)
==24321==
==24321== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 1 from 1)
==24321== malloc/free: in use at exit: 0 bytes in 0 blocks.
==24321== malloc/free: 5 allocs, 5 frees, 7872364 bytes allocated.
==24321== For counts of detected errors, rerun with: -v
==24321== No malloc'd blocks -- no leaks are possible.
daniel@fis615:~/current>