Scorpio EGBB Segfault

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

EvgeniyZh
Posts: 43
Joined: Fri Sep 19, 2014 4:54 pm
Location: Israel

Re: Scorpio EGBB Segfault

Post by EvgeniyZh »

fridokar wrote:For "probe_egbb_xmen" treat the kings like the other pieces. Try:

Code: Select all

case WK: ADD_PIECE(WKing); break;
case BK: ADD_PIECE(BKing); break;
oups! sorry for false alert. I just forgot to turn EGBB usage on.
There is no difference between what is done and ADD_PIECE, except that in my code white king is always first and black king is always second.
Daniel Shawul
Posts: 4185
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: Scorpio EGBB Segfault

Post by Daniel Shawul »

EvgeniyZh wrote:
fridokar wrote:For "probe_egbb_xmen" treat the kings like the other pieces. Try:

Code: Select all

case WK: ADD_PIECE(WKing); break;
case BK: ADD_PIECE(BKing); break;
oups! sorry for false alert. I just forgot to turn EGBB usage on.
There is no difference between what is done and ADD_PIECE, except that in my code white king is always first and black king is always second.
Maybe you should first try to probe with a FEN string instead? There is a function for it in egbbdll.
DLLExport int CDECL probe_egbb_fen(char* fen);
EvgeniyZh
Posts: 43
Joined: Fri Sep 19, 2014 4:54 pm
Location: Israel

Re: Scorpio EGBB Segfault

Post by EvgeniyZh »

Daniel Shawul wrote:
EvgeniyZh wrote:
fridokar wrote:For "probe_egbb_xmen" treat the kings like the other pieces. Try:

Code: Select all

case WK: ADD_PIECE(WKing); break;
case BK: ADD_PIECE(BKing); break;
oups! sorry for false alert. I just forgot to turn EGBB usage on.
There is no difference between what is done and ADD_PIECE, except that in my code white king is always first and black king is always second.
Maybe you should first try to probe with a FEN string instead? There is a function for it in egbbdll.
DLLExport int CDECL probe_egbb_fen(char* fen);
Just the same :cry:
Daniel Shawul
Posts: 4185
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: Scorpio EGBB Segfault

Post by Daniel Shawul »

Here is a small test with python. I get a winning result for the position you provided.

Code: Select all

[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin 
Type "help", "copyright", "credits" or "license" for more information. 
>>> from ctypes import * 
>>> egbb = cdll.LoadLibrary("egbbso.so") 
>>> egbb.load_egbb("./") 
EgbbProbe 4.1 by Daniel Shawul 
10 egbbs loaded !      
-1300584139 
>>> egbb.probe_egbb_fen("2R5/8/8/4k3/8/8/6K1/8 w - -") 
5609 
>>> 
Edit:
On a second test I managed to get a segfault.

Code: Select all

>>> from ctypes import *
>>> egbb = cdll.LoadLibrary("egbbso.so")
>>> egbb.load_egbb_xmen("./",1,1)
EgbbProbe 4.1 by Daniel Shawul
10 egbbs loaded !      
28185509
>>> egbb.probe_egbb_fen("2R5/8/8/4k3/8/8/6K1/8 w - -")
Segmentation fault: 11
The cache_size should be in bytes so changing the 1 to 4194304 for a 4MB cache fixes it.

Code: Select all

>>> from ctypes import *
>>> egbb = cdll.LoadLibrary("egbbso.so")
>>> egbb.load_egbb_xmen("./",4194304,1)
EgbbProbe 4.1 by Daniel Shawul
10 egbbs loaded !      
-2050454970
>>> egbb.probe_egbb_fen("2R5/8/8/4k3/8/8/6K1/8 w - -")
5609
>>> egbb.load_egbb_xmen("./",1,1)
EgbbProbe 4.1 by Daniel Shawul
10 egbbs loaded !      
-2050454970
>>> egbb.probe_egbb_fen("2R5/8/8/4k3/8/8/6K1/8 w - -")
5609
Also, reloading with a 1 byte cache does not cause a problem anymore. So make sure you are giving it an appropriately sized cache.
EvgeniyZh
Posts: 43
Joined: Fri Sep 19, 2014 4:54 pm
Location: Israel

Re: Scorpio EGBB Segfault

Post by EvgeniyZh »

Daniel Shawul wrote: Edit:
On a second test I managed to get a segfault.

The cache_size should be in bytes so changing the 1 to 4194304 for a 4MB cache fixes it.
Also, reloading with a 1 byte cache does not cause a problem anymore. So make sure you are giving it an appropriately sized cache.
Gotcha! Cache size was in megabytes. Thank you for your help