what happens if you add -Wall (gcc) or whatever for the compiler you use. Do you get any warnings? There can be some nice quirks when things go from 32 bits to 64 bits without warning, as it is easy to use int, where int is not big enough for a pointer in 64 bits, and such... Had a few of those when I first tested on a Cray many years ago.krazyken wrote:Yes, That's what I tried. It builds, but will randomly hang and/or seg fault. If it is something you wish to investigate further, I can get you crash reports and/or ssh access to a Mac.jdart wrote:If you're building a 64-bit target on MacOS, that is not something I have tried.krazyken wrote:It seems I can't get a stable 64-bit build. But 32-bit works on Mac.
--Jon
Arasan 11.3
Moderator: Ras
-
- Posts: 20943
- Joined: Mon Feb 27, 2006 7:30 pm
- Location: Birmingham, AL
Re: Arasan 11.3
-
- Posts: 20943
- Joined: Mon Feb 27, 2006 7:30 pm
- Location: Birmingham, AL
Re: Arasan 11.3
If you want to send me the code (if you have released it) I can compile it on a 64 bit box and send any warnings back to you, or fixes if I have time to make it work...jdart wrote:I'll put it on my list to investigate. I have to borrow my daughter's Mac as I don't have a regular Mac dev machine.
--Jon
Re: Arasan 11.3
using Apple gcc 4.2.1
default compile flags in your Makefile (without the -march):
warnings:
default compile flags in your Makefile (without the -march):
Code: Select all
g++ -O3 -finline-functions -fno-rtti -fno-enforce-eh-specs -Wall -m64 -D_MAC -DSMP
Code: Select all
log.cpp:2: warning: ignoring #pragma optimize
log.cpp: In member function 'void Log::add_move(Board&, const Move&, const char*, const Statistics*, BookInfo*, int)':
log.cpp:176: warning: comparison between 'const enum StateType' and 'enum Log::GameResult'
search.cpp: In member function 'int Search::checkTime(const Board&, int)':
search.cpp:479: warning: comparison between signed and unsigned integer expressions
search.cpp: In member function 'int Search::calcExtensions(const Board&, NodeInfo*, NodeInfo*, CheckStatusType, int, int, const Move&)':
search.cpp:1701: warning: comparison between 'enum PieceType' and 'enum Piece'
search.cpp: In member function 'int Search::search()':
search.cpp:1729: warning: comparison between signed and unsigned integer expressions
legal.h: At global scope:
legal.h:15: warning: 'int legalMove(const Board&, Move)' defined but not used
egtb.cpp: In function 'void* PvMalloc(size_t)':
egtb.cpp:354: warning: format '%d' expects type 'int', but argument 2 has type 'size_t'
egtb.cpp: In function 'void VInitEnumerations()':
egtb.cpp:1290: warning: format '%d' expects type 'int', but argument 3 has type 'ULONG'
egtb.cpp:1294: warning: format '%d' expects type 'int', but argument 3 has type 'ULONG'
egtb.cpp:1301: warning: format '%d' expects type 'int', but argument 4 has type 'ULONG'
egtb.cpp:1308: warning: format '%d' expects type 'int', but argument 4 has type 'ULONG'
egtb.cpp:1318: warning: format '%d' expects type 'int', but argument 5 has type 'ULONG'
egtb.cpp:1327: warning: format '%d' expects type 'int', but argument 5 has type 'ULONG'
egtb.cpp:1330: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int'
egtb.cpp:4503: warning: 'TB_CRC_CHECK' initialized and declared 'extern'
egtb.cpp: In function 'int FCheckExtentExistance(char*, int, color, int)':
egtb.cpp:6323: warning: unused variable 'fWasError'
egtb.cpp:6324: warning: unused variable 'block'
egtb.cpp:6325: warning: unused variable 'rgbBuffer'
tbdecode.h: At global scope:
tbdecode.h:798: warning: 'int comp_tell_blocks(decode_info*)' defined but not used
egtb.cpp:6117: warning: 'int TbtProbeTable(int, color, INDEX)' defined but not used
makebook.cpp: In function 'int main(int, char**)':
makebook.cpp:627: warning: comparison between signed and unsigned integer expressions
-
- Posts: 20943
- Joined: Mon Feb 27, 2006 7:30 pm
- Location: Birmingham, AL
Re: Arasan 11.3
Nothing really stands out at first pass. A few warnings are odd (signed vs unsigned comparisons for example) but nothing noteworthy. However, knowing GCC, that doesn't mean a lot. It is the things it _doesn't_ notice that can be problematic...krazyken wrote:using Apple gcc 4.2.1
default compile flags in your Makefile (without the -march):warnings:Code: Select all
g++ -O3 -finline-functions -fno-rtti -fno-enforce-eh-specs -Wall -m64 -D_MAC -DSMP
Code: Select all
log.cpp:2: warning: ignoring #pragma optimize log.cpp: In member function 'void Log::add_move(Board&, const Move&, const char*, const Statistics*, BookInfo*, int)': log.cpp:176: warning: comparison between 'const enum StateType' and 'enum Log::GameResult' search.cpp: In member function 'int Search::checkTime(const Board&, int)': search.cpp:479: warning: comparison between signed and unsigned integer expressions search.cpp: In member function 'int Search::calcExtensions(const Board&, NodeInfo*, NodeInfo*, CheckStatusType, int, int, const Move&)': search.cpp:1701: warning: comparison between 'enum PieceType' and 'enum Piece' search.cpp: In member function 'int Search::search()': search.cpp:1729: warning: comparison between signed and unsigned integer expressions legal.h: At global scope: legal.h:15: warning: 'int legalMove(const Board&, Move)' defined but not used egtb.cpp: In function 'void* PvMalloc(size_t)': egtb.cpp:354: warning: format '%d' expects type 'int', but argument 2 has type 'size_t' egtb.cpp: In function 'void VInitEnumerations()': egtb.cpp:1290: warning: format '%d' expects type 'int', but argument 3 has type 'ULONG' egtb.cpp:1294: warning: format '%d' expects type 'int', but argument 3 has type 'ULONG' egtb.cpp:1301: warning: format '%d' expects type 'int', but argument 4 has type 'ULONG' egtb.cpp:1308: warning: format '%d' expects type 'int', but argument 4 has type 'ULONG' egtb.cpp:1318: warning: format '%d' expects type 'int', but argument 5 has type 'ULONG' egtb.cpp:1327: warning: format '%d' expects type 'int', but argument 5 has type 'ULONG' egtb.cpp:1330: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int' egtb.cpp:4503: warning: 'TB_CRC_CHECK' initialized and declared 'extern' egtb.cpp: In function 'int FCheckExtentExistance(char*, int, color, int)': egtb.cpp:6323: warning: unused variable 'fWasError' egtb.cpp:6324: warning: unused variable 'block' egtb.cpp:6325: warning: unused variable 'rgbBuffer' tbdecode.h: At global scope: tbdecode.h:798: warning: 'int comp_tell_blocks(decode_info*)' defined but not used egtb.cpp:6117: warning: 'int TbtProbeTable(int, color, INDEX)' defined but not used makebook.cpp: In function 'int main(int, char**)': makebook.cpp:627: warning: comparison between signed and unsigned integer expressions
-
- Posts: 4406
- Joined: Fri Mar 10, 2006 5:23 am
- Location: http://www.arasanchess.org
Re: Arasan 11.3
I have a x64 Linux install with gcc 4 so I've seen most of these before.
It sounds like the issue was, it compiled on MacOS x64 but didn't run. So the compile warnings may not be the issue.
--Jon
It sounds like the issue was, it compiled on MacOS x64 but didn't run. So the compile warnings may not be the issue.
--Jon
-
- Posts: 20943
- Joined: Mon Feb 27, 2006 7:30 pm
- Location: Birmingham, AL
Re: Arasan 11.3
I agree. The problem is usually something the compiler didn't quite grasp as illegal. Hasn't happened recently, but there have been plenty of gcc versions that would simply break crafty and cause it to either produce wrong results, or more commonly, crash.jdart wrote:I have a x64 Linux install with gcc 4 so I've seen most of these before.
It sounds like the issue was, it compiled on MacOS x64 but didn't run. So the compile warnings may not be the issue.
--Jon
Re: Arasan 11.3
got a backtrace if it is of help got this crash from running an epd test. Also I note with the EPD test the times seem to be way off, I tell it to run for 20 secs per position, and it spends about 3 on each one reporting that it had gone 20 secs.
Code: Select all
Process: arasanx [10538]
Path: ./arasanx
Identifier: arasanx
Version: ??? (???)
Code Type: X86-64 (Native)
Parent Process: bash [547]
Date/Time: 2009-03-26 23:54:57.339 -0600
OS Version: Mac OS X 10.5.6 (9G55)
Report Version: 6
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000750
Crashed Thread: 2
Thread 0:
0 libSystem.B.dylib 0x00007fff83c0984d szone_free + 2057
1 arasanx 0x000000010000f64f Board::operator=(Board const&) + 63 (board.cpp:163)
2 arasanx 0x00000001000303ba Search::maybeSplit(Board const&, NodeInfo*, int, int) + 666 (search.cpp:2900)
3 arasanx 0x000000010002ec3a Search::search() + 4458 (search.cpp:2242)
4 arasanx 0x000000010002f899 Search::searchSMP(ThreadInfo*) + 889 (search.h:245)
5 arasanx 0x0000000100030444 Search::maybeSplit(Board const&, NodeInfo*, int, int) + 804 (search.cpp:2987)
6 arasanx 0x000000010002ec3a Search::search() + 4458 (search.cpp:2242)
7 arasanx 0x0000000100030979 RootSearch::ply0_search(RootMoveGenerator&, int, int, int, int, unsigned long long*, int) + 1305 (search.h:245)
8 arasanx 0x0000000100031386 RootSearch::ply0_search(unsigned long long*, int) + 822 (search.cpp:634)
9 arasanx 0x00000001000329b3 SearchController::findBestMove(Board const&, SearchType, int, int, int, int, int, Statistics&, TalkLevel, unsigned long long*, int) + 275 (search.cpp:267)
10 arasanx 0x00000001000066d0 __ZL7do_testSs + 3072
11 arasanx 0x0000000100008bcc __ZL10do_commandPKcR5Board + 1308
12 arasanx 0x000000010000d365 main + 1205 (arasanx.cpp:2752)
13 arasanx 0x0000000100000cf4 start + 52
Thread 1:
0 libSystem.B.dylib 0x00007fff83cae002 semop + 10
1 libSystem.B.dylib 0x00007fff83c30dcb _pthread_start + 316
2 libSystem.B.dylib 0x00007fff83c30c8d thread_start + 13
Thread 2 Crashed:
0 arasanx 0x000000010002f5c3 Search::searchSMP(ThreadInfo*) + 163 (types.h:181)
1 arasanx 0x000000010003bfa8 __ZL10parkingLotPv + 72
2 libSystem.B.dylib 0x00007fff83c30dcb _pthread_start + 316
3 libSystem.B.dylib 0x00007fff83c30c8d thread_start + 13
Thread 3:
0 libSystem.B.dylib 0x00007fff83cae002 semop + 10
1 libSystem.B.dylib 0x00007fff83c30dcb _pthread_start + 316
2 libSystem.B.dylib 0x00007fff83c30c8d thread_start + 13
Thread 4:
0 libSystem.B.dylib 0x00007fff83cae002 semop + 10
1 libSystem.B.dylib 0x00007fff83c30dcb _pthread_start + 316
2 libSystem.B.dylib 0x00007fff83c30c8d thread_start + 13
Thread 5:
0 libSystem.B.dylib 0x00007fff83cae002 semop + 10
1 libSystem.B.dylib 0x00007fff83c30dcb _pthread_start + 316
2 libSystem.B.dylib 0x00007fff83c30c8d thread_start + 13
Thread 6:
0 libSystem.B.dylib 0x00007fff83cae002 semop + 10
1 libSystem.B.dylib 0x00007fff83c30dcb _pthread_start + 316
2 libSystem.B.dylib 0x00007fff83c30c8d thread_start + 13
Thread 7:
0 arasanx 0x000000010002032a Scoring::positionalScore(Board const&, int, int) + 666 (scoring.cpp:1808)
1 arasanx 0x000000010002c759 Search::qsearch_no_check(int, int) + 217 (search.cpp:1236)
2 arasanx 0x000000010002c678 Search::quiesce(int, int) + 344 (search.cpp:1127)
3 arasanx 0x000000010002f4ed Search::search() + 6685 (search.h:254)
4 arasanx 0x000000010002e77c Search::search() + 3244 (search.h:254)
5 arasanx 0x000000010002e77c Search::search() + 3244 (search.h:254)
6 arasanx 0x000000010002e77c Search::search() + 3244 (search.h:254)
7 arasanx 0x000000010002e77c Search::search() + 3244 (search.h:254)
8 arasanx 0x000000010002e77c Search::search() + 3244 (search.h:254)
9 arasanx 0x000000010002e77c Search::search() + 3244 (search.h:254)
10 arasanx 0x000000010002e77c Search::search() + 3244 (search.h:254)
11 arasanx 0x000000010002e77c Search::search() + 3244 (search.h:254)
12 arasanx 0x000000010002e77c Search::search() + 3244 (search.h:254)
13 arasanx 0x000000010002e77c Search::search() + 3244 (search.h:254)
14 arasanx 0x000000010002e77c Search::search() + 3244 (search.h:254)
15 arasanx 0x000000010002e77c Search::search() + 3244 (search.h:254)
16 arasanx 0x000000010002e77c Search::search() + 3244 (search.h:254)
17 arasanx 0x000000010002e77c Search::search() + 3244 (search.h:254)
18 arasanx 0x000000010002fea3 Search::searchSMP(ThreadInfo*) + 2435 (search.h:368)
19 arasanx 0x000000010003bfa8 __ZL10parkingLotPv + 72
20 libSystem.B.dylib 0x00007fff83c30dcb _pthread_start + 316
21 libSystem.B.dylib 0x00007fff83c30c8d thread_start + 13
Thread 2 crashed with X86 Thread State (64-bit):
rax: 0x0000000000000750 rbx: 0x0000000109196000 rcx: 0x00007fff83cae002 rdx: 0x00000001003094c0
rdi: 0x00000001091982a8 rsi: 0x00000001003094c0 rbp: 0x0000000109193ec0 rsp: 0x0000000109193de0
r8: 0x0000000000000008 r9: 0x0000000000000000 r10: 0x00007fff83cae02a r11: 0x0000000000000296
r12: 0x000000010979b568 r13: 0x0000000100309320 r14: 0x0000000100000001 r15: 0x000000010919f568
rip: 0x000000010002f5c3 rfl: 0x0000000000010206 cr2: 0x0000000000000750
-
- Posts: 4675
- Joined: Mon Mar 13, 2006 7:43 pm
Re: Arasan 11.3
1) Missing an signed/unsigned conversion bug once cost me two hours of debugging time, so I always have the compiler check for these.
2) I turn on every possible check (more than just -Wall) that doesn't trigger false warnings from system header files.
3) Instead of -O3, I'd use -O0 when debugging crashes. Also,the g++v4.3 optimizer is busted on Linux, at least with the -O2/-O3 settings.
2) I turn on every possible check (more than just -Wall) that doesn't trigger false warnings from system header files.
3) Instead of -O3, I'd use -O0 when debugging crashes. Also,the g++v4.3 optimizer is busted on Linux, at least with the -O2/-O3 settings.
-
- Posts: 4406
- Joined: Fri Mar 10, 2006 5:23 am
- Location: http://www.arasanchess.org
Re: Arasan 11.3
This is the part of the code that is copying the current board prior to starting a search in another thread. It looks like it is the part that's deleting and then re-allocating the repetition list.
Could be a bug but I've never had trouble with this on other platforms. Note that the array being freed should be null and deleting a null pointer is legal in C++ but the compiler may not know that ..
There is a newer gcc version (4.2) available for MacOS if you want to try that.
--Jon
Could be a bug but I've never had trouble with this on other platforms. Note that the array being freed should be null and deleting a null pointer is legal in C++ but the compiler may not know that ..
There is a newer gcc version (4.2) available for MacOS if you want to try that.
--Jon