Sunsetter (crazyhouse engine) issue with ponder on, linux

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
mohzus
Posts: 106
Joined: Tue Sep 24, 2013 2:54 am

Sunsetter (crazyhouse engine) issue with ponder on, linux

Post by mohzus »

Hi everyone,
When I compile sunsetter engine under linux (ubuntu 12.04, gcc 4.8.1), it creates an executable that works well at first glance. However around in 1 game out of 3 the program "freezes" as if it entered an infinite loop, usually when it finds a forced checkmate but not always.
After talking with a programmer (who by the way modified the program as to use 64 bits instead of 32), he told me that my problem has to do with ponder on. So I set it off and now it works just fine.
But I would like to know why is the program crashing for my machine and not others. Does it crash also in your case? Has the program a bug somewhere? Is there a way I can fix this problem without setting ponder off?

Here's a link to the only source code of sunsetter that actually does compile under linux without problem on "modern" computers: https://github.com/arbolis/sunsetter7f64bits.
I'd appreciate any feedback if the program crashes for you too, etc.
flok

Re: Sunsetter (crazyhouse engine) issue with ponder on, linu

Post by flok »

While compiling I see lots of warnings, you may consider fixing those.
E.g.:

Code: Select all

board.h: In member function ‘move boardStruct::rawAlgebraicMoveToDBMove(const char*)’:
board.h:150:60: warning: ‘m.move::data’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   __forceinline void makeBad&#40;)            &#123; data |= 1 << 23; &#125;;
                                                            ^
notation.cpp&#58;194&#58;9&#58; note&#58; ‘m.move&#58;&#58;data’ was declared here
    move m;
Also "cppcheck" gives warnings like:

Code: Select all

&#91;bitboard.cpp&#58;391&#93;&#58; &#40;error&#41; Buffer is accessed out of bounds&#58; BitInBB
valgrind (valgrind --time-stamp=yes --show-reachable=yes --leak-check=full --read-var-info=yes --track-origins=yes --malloc-fill=93 --free-fill=b9 --error-limit=no ./sunsetter) complains about memory leaks when terminating.

I could not get it to do any moves. I entered xboard / new / e2e4 but for every move I entered (also tried e2-e4, e4, Pe4, E2-E4, E2E4, E4) it says "Illegal move".
User avatar
hgm
Posts: 27790
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Sunsetter (crazyhouse engine) issue with ponder on, linu

Post by hgm »

Perhaps it only plays crazyhouse, and requires you to first enter "variant crazyhouse" after "new" before it wants to play, refusing anything attempt to play in variant normal.
flok

Re: Sunsetter (crazyhouse engine) issue with ponder on, linu

Post by flok »

hgm wrote:Perhaps it only plays crazyhouse, and requires you to first enter "variant crazyhouse" after "new" before it wants to play, refusing anything attempt to play in variant normal.
Ah yes that's the one.
flok

Re: Sunsetter (crazyhouse engine) issue with ponder on, linu

Post by flok »

Also, valgrind gives me tons of these:

Code: Select all

==00&#58;00&#58;31&#58;58.450 30499== Conditional jump or move depends on uninitialised value&#40;s&#41;
==00&#58;00&#58;31&#58;58.450 30499==    at 0x4143AE&#58; boardStruct&#58;&#58;orderCaptures&#40;move*) &#40;order_moves.cpp&#58;216&#41;
==00&#58;00&#58;31&#58;58.450 30499==    by 0x40AC49&#58; boardStruct&#58;&#58;moves&#40;move*) &#40;moves.cpp&#58;37&#41;
==00&#58;00&#58;31&#58;58.450 30499==    by 0x413BF1&#58; boardStruct&#58;&#58;algebraicMoveToDBMove&#40;char const*) &#40;notation.cpp&#58;297&#41;
==00&#58;00&#58;31&#58;58.450 30499==    by 0x412265&#58; checkInput&#40;) &#40;interface.cpp&#58;978&#41;
==00&#58;00&#58;31&#58;58.450 30499==    by 0x4013DE&#58; main &#40;bughouse.cpp&#58;302&#41;
==00&#58;00&#58;31&#58;58.450 30499==  Uninitialised value was created by a stack allocation
==00&#58;00&#58;31&#58;58.450 30499==    at 0x40AC38&#58; boardStruct&#58;&#58;moves&#40;move*) &#40;moves.cpp&#58;36&#41;
User avatar
mohzus
Posts: 106
Joined: Tue Sep 24, 2013 2:54 am

Re: Sunsetter (crazyhouse engine) issue with ponder on, linu

Post by mohzus »

Thanks guys. About the warnings, I don't know how to fix them (I don't even know programming). The programmer who inserted the 64 bits support told me that they aren't worrisome. He tested the program that he compiled himself with gcc on FICS with me and it didn't crash after like 50 games; while his executable on my machine would crash. He was using a core i5 or something like that, my cpu is a core 2 duo E6300. Even closing xboard would not stop sunsetter to run, I had to kill the process.
About running sunsetter from the commandline, here's a way to do it:

Code: Select all

./sunsetter xboard
new <enter> 
post <enter> 
reset <enter> 
e2e4 <enter>
Here's a game that didn't finish due to the bug:
1.e4 &#9816;f6 2.e5 &#9816;c6 3.exf6 exf6 4.&#9816;@d5 &#9817;@e6 5.&#9816;e3 d5 6.d4 &#9815;b4+ 7.c3 &#9815;d6 8.&#9815;b5 &#9815;d7 9.&#9816;h3 a6 10.&#9815;d3 &#9813;e7 11.&#9816;d2 &#9814;d8 12.&#9814;b1 &#9816;a7 13.&#9813;g4 O-O 14.&#9813;h4 f5 15.&#9813;xe7 &#9815;xe7 16.&#9813;@h5 f6 17.&#9816;f4 &#9815;d6 18.&#9816;xe6 &#9815;xe6 19.&#9815;xf5 &#9815;xf5 20.&#9813;xf5 &#9815;@g6 21.&#9813;xd5+ &#9815;f7 22.&#9813;e4 &#9816;@g5 23.&#9813;xb7 &#9816;b5 24.&#9813;xa6 &#9816;xd4 25.cxd4 &#9815;f4 26.&#9816;@e7+ &#9812;h8 27.&#9817;@h6 &#9815;xe3 28.hxg7+ &#9812;xg7 29.&#9817;@h6+ &#9812;xh6 30.&#9813;xf6+ &#9816;@g6, sunsetter was white and was about to checkmate black.