Announcing Daydreamer 1.0

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

Pablo Vazquez
Posts: 154
Joined: Thu May 31, 2007 9:05 pm
Location: Madrid, Spain

Re: Announcing Daydreamer 1.0

Post by Pablo Vazquez »

Aaron Becker wrote:
Volker Pittlik wrote: I get a segmentation fault here after compiling it without errors.

volker@vpittlik:~/schach/daydreamer/1.0$ gcc --version
gcc (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu4)

volker@vpittlik:~/schach/daydreamer/1.0$ uname -a
Linux vpittlik 2.6.24-24-generic #1 SMP Fri Jul 24 22:15:50 UTC 2009 x86_64 GNU/Linux
vp
Hmm, I'm not sure what the problem might be. I used gcc and Ubuntu for my linux testing as well, although not exactly the same versions. I think I need a little more information to find the problem.

Is this a 64-bit executable? I only tested 32-bit versions so far, so there may be problems lurking in a 64-bit build. Does it segfault as soon as you start it up, or only after it starts to search? Does it print any output at all, other than "segmentation fault"?

You can build a debugging version by running "make debug". Trying that version might shed some light on the problem. Best of all would be to run the debug version inside gdb--then when it crashes it will give a full stack trace, which should be enough to pinpoint the problem.

Sorry for the trouble, and thanks for any help you can give me in tracking the problem down.
I got the same problem using gcc 4.3.2 64-bit under Ubuntu 8.10. It seems that the compiler treats enums as unsigned ints and messes up with the initialization of the attacks tables. Anyway, this is how I solved it:

In position.h replace

Code: Select all

typedef enum {
    A1=0x00, B1=0x01, C1=0x02, D1=0x03, E1=0x04, F1=0x05, G1=0x06, H1=0x07,
    A2=0x10, B2=0x11, C2=0x12, D2=0x13, E2=0x14, F2=0x15, G2=0x16, H2=0x17,
    A3=0x20, B3=0x21, C3=0x22, D3=0x23, E3=0x24, F3=0x25, G3=0x26, H3=0x27,
    A4=0x30, B4=0x31, C4=0x32, D4=0x33, E4=0x34, F4=0x35, G4=0x36, H4=0x37,
    A5=0x40, B5=0x41, C5=0x42, D5=0x43, E5=0x44, F5=0x45, G5=0x46, H5=0x47,
    A6=0x50, B6=0x51, C6=0x52, D6=0x53, E6=0x54, F6=0x55, G6=0x56, H6=0x57,
    A7=0x60, B7=0x61, C7=0x62, D7=0x63, E7=0x64, F7=0x65, G7=0x66, H7=0x67,
    A8=0x70, B8=0x71, C8=0x72, D8=0x73, E8=0x74, F8=0x75, G8=0x76, H8=0x77,
    INVALID_SQUARE=0x4b // just some square from the middle of the invalid part
} square_t;
with

Code: Select all

enum {
    A1=0x00, B1=0x01, C1=0x02, D1=0x03, E1=0x04, F1=0x05, G1=0x06, H1=0x07,
    A2=0x10, B2=0x11, C2=0x12, D2=0x13, E2=0x14, F2=0x15, G2=0x16, H2=0x17,
    A3=0x20, B3=0x21, C3=0x22, D3=0x23, E3=0x24, F3=0x25, G3=0x26, H3=0x27,
    A4=0x30, B4=0x31, C4=0x32, D4=0x33, E4=0x34, F4=0x35, G4=0x36, H4=0x37,
    A5=0x40, B5=0x41, C5=0x42, D5=0x43, E5=0x44, F5=0x45, G5=0x46, H5=0x47,
    A6=0x50, B6=0x51, C6=0x52, D6=0x53, E6=0x54, F6=0x55, G6=0x56, H6=0x57,
    A7=0x60, B7=0x61, C7=0x62, D7=0x63, E7=0x64, F7=0x65, G7=0x66, H7=0x67,
    A8=0x70, B8=0x71, C8=0x72, D8=0x73, E8=0x74, F8=0x75, G8=0x76, H8=0x77,
    INVALID_SQUARE=0x4b // just some square from the middle of the invalid part
};

typedef int square_t;
Volker Pittlik
Posts: 619
Joined: Wed Mar 08, 2006 9:10 pm
Location: Murten / Morat, Switzerland
Full name: Volker Pittlik

Re: Announcing Daydreamer 1.0

Post by Volker Pittlik »

Aaron Becker wrote:...Is this a 64-bit executable?
Yes.
Aaron Becker wrote:...... Does it print any output at all, other than "segmentation fault"?

Not at all.
Aaron Becker wrote:...You can build a debugging version by running "make debug". Trying that version might shed some light on the problem. Best of all would be to run the debug version inside gdb--then when it crashes it will give a full stack trace, which should be enough to pinpoint the problem.

Sorry for the trouble, and thanks for any help you can give me in tracking the problem down.
Here is the output:

Code: Select all

(gdb) file "/home/volker/schach/daydreamer/1.0/daydreamer"
Reading symbols from /home/volker/schach/daydreamer/1.0/daydreamer...done.
(gdb) run
Starting program: /home/volker/schach/daydreamer/1.0/daydreamer :"/home/volker/schach/daydreamer/1.0/daydreamer"

Program received signal SIGSEGV, Segmentation fault.
0x000000000040172e in generate_attack_data () at daydreamer.c:77
77	                    mutable_attack_data[from-to].possible_attackers |=
(gdb) 
hth

Volker
schlucke
Posts: 58
Joined: Thu Apr 09, 2009 1:38 pm

Re: Announcing Daydreamer 1.0

Post by schlucke »

Aaron Becker wrote:I've just released the first version of Daydreamer, the chess engine I've been working on this summer. It started as a side effort in the development of GUI chess application for macs, but it was so interesting ...
Thanks for the engine! And I hope you don't give up on your Chess GUI for MacOS ;) Will that be open source too?

Holger
krazyken

Re: Announcing Daydreamer 1.0

Post by krazyken »

schlucke wrote:
Aaron Becker wrote:I've just released the first version of Daydreamer, the chess engine I've been working on this summer. It started as a side effort in the development of GUI chess application for macs, but it was so interesting ...
Thanks for the engine! And I hope you don't give up on your Chess GUI for MacOS ;) Will that be open source too?

Holger
I must concur, a GUI for Mac OS X would be a great thing to have.
Aaron Becker
Posts: 292
Joined: Tue Jul 07, 2009 4:56 am

Re: Announcing Daydreamer 1.0

Post by Aaron Becker »

Thanks for the fix, Pablo. I've added it to my code and it seems to work perfectly. I split off a release version of Daydreamer so that I can add these bugfixes without making people put up with whatever buggy, untested version I'm currently hacking on. The release version is available at http://github.com/AaronBecker/daydreamer.

My GUI application, called Kingside, is still in a pretty rough beta condition, but it's not too far away from being releasable. If anyone is interested in trying the unfinished beta version, let me know. I'm always looking for testers.
schlucke
Posts: 58
Joined: Thu Apr 09, 2009 1:38 pm

Re: Announcing Daydreamer 1.0

Post by schlucke »

Aaron Becker wrote:My GUI application, called Kingside, is still in a pretty rough beta condition, but it's not too far away from being releasable. If anyone is interested in trying the unfinished beta version, let me know. I'm always looking for testers.
Sure I'm interested! I've sent you my email adress via PM.