bob wrote:Gian-Carlo Pascutto wrote:Chan Rasjid wrote: I could "interrupt" the process through gdb and then restart it with "continue". The process will "continue" a little and it will stop at another point. This "interrupt/continue" could be repeated but the process will hang at another point.
How do you know it continues a little?
It sounds a bit like a logic error that causes the program to get into an infinite loop.
Are you certain you are hanging there? Or are you in a loop that calls the above code over and over so that each time you stop it, you show it to be at a different line in the procedure? Where it is not the procedure that is hung, but whatever is calling the procedure instead...
rasjid@debian:~/cowrie/debug/src$ ./cowrie
Cowrie Chess Version 1.0, 3rd Feb 2010
Auto Play Start
game 1 move e2e3
-+-+- pv +-+-+ 30 -+ pv -+-+ pv -+ pv -+ 30 -+- pv +-+-+-+ 28 -+- pv +- pv + pv -+- pv + 28 - pv +-+-+- pv +- pv + 25 -+-+- pv +-+- pv + pv 24 -+-+- pv +-+ pv -+ pv 21 - pv +-+ pv -+-+-+ pv 15 -+-+ pv -+ pv -+ pv -+ 13 -search_full failed / mate
score -7998
game 2 move e2e4
-+- pv + pv -+-+- pv + pv 29 -+-+-+- pv +-+ 24 - pv + pv -+-+-+-+ pv 23 -+- pv + pv -+-+
It hangs at game 2 as the "+-+_..." stops. I use time control of 60moves per 1min. So I could see the "+-+-..." about every second. When it stops, I could leave the computer alone for say 10 min and it still "hangs" there.
Code: Select all
/* gen Bishop */
for (mask = bits[s][Bishop]; mask; mask &= mask - 1){
assert(allBits & (mask & -mask));
from = firstone(mask); /* from */
// HANGS AT LINE BELOW
capt_mask = (ROT_DIAG7(from) | ROT_DIAG9(from)) & bits[xs][0];
if (!(capt_mask & bits[xs][King]));
else return NULL;
for (; capt_mask; capt_mask &= capt_mask - 1){
to = firstone(capt_mask);
capture = pc_board[to];
order = OrderCapture[Bishop][capture];
if (capture ^ Pawn || !(board[to]->pMap[s] & bits[xs][Pawn]));
else{
order = OrderBadCaptureB;
}
max_qs_capture_pc = max(capture, max_qs_capture_pc);
PACK_MOVE_CAPTURE(m++, from, to, Bishop, capture, order);
assert(board[FROM(* (m-1))]->bb & bits[s][Bishop]);
assert(board[TO(* (m-1))]->bb & bits[xs][capture]);
assert(!(board[TO(* (m-1))]->bb & bits[xs][King]));
}
}
The process hangs in the block above in gen.
The frame stack is as follow:
home/rasjid/cowrie/src/gen.c
home/rasjid/cowrie/src/src.c
home/rasjid/cowrie/src/srcroot.c
home/rasjid/cowrie/src/auto.c
home/rasjid/cowrie/src/main.c
I now have some slight idea about what you mean. It could be an infinite loop within src.c that repeatedly calls a function within gen.c. Indeed I made some significant changes to src.c about partial generation of moves through 6 phases.
I have to check.
Best Regards,
Rasjid.