Anyone with a G5 Mac?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Anyone with a G5 Mac?

Post by Tord Romstad »

Could someone please try to run this Glaurung binary on a G5 Mac? There were some endianness problems with previous versions of Glaurung on PowerPC Macs. I hope that these are solved now, but I can't test it here, because I don't have a G5 Mac and Rosetta isn't able to run 64-bit PowerPC programs.

It would also be interesting to see how fast this version is on a G5. On the 32-bit Intel Core Duo, the current Glaurung version does about 500 kN/s from the opening position.

Tord
User avatar
Daniel Mehrmann
Posts: 858
Joined: Wed Mar 08, 2006 9:24 pm
Location: Germany
Full name: Daniel Mehrmann

Re: Anyone with a G5 Mac?

Post by Daniel Mehrmann »

Hi Tord,

a friend of mine has a dual core G5 8-)
I send him a message and i promise he will do the test on the weekend :-P

I'll post the results here. If someone have a local G5 here it would be better of course...

Best,
Daniel
Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: Anyone with a G5 Mac?

Post by Tord Romstad »

Daniel Mehrmann wrote:Hi Tord,

a friend of mine has a dual core G5 8-)
I send him a message and i promise he will do the test on the weekend :-P
Great, thanks! :)

Tord
Guetti

Re: Anyone with a G5 Mac?

Post by Guetti »

I tried to run this version on my G5. Unfortunately the executable segfaults immediately.

Code: Select all

gdb glaurung
GNU gdb 6.3.50-20050815 (Apple version gdb-573) (Fri Oct 20 15:54:33 GMT 2006)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "powerpc-apple-darwin"...Reading symbols for shared libraries .... done

(gdb) run
Starting program: /Users/andreas/tmpdir/glaurung-g5/glaurung 
Reading symbols for shared libraries .+++ done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000f375cc
0x0000000000006bc4 in ?? ()
(gdb) 
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: Anyone with a G5 Mac?

Post by sje »

Typing "bt" into gdb will give a backtrace of the stack; if the executable hasn't been stripped, then the routine names will also appear.
Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: Anyone with a G5 Mac?

Post by Tord Romstad »

Guetti wrote:I tried to run this version on my G5. Unfortunately the executable segfaults immediately.
Sigh.

Yet another problem, then. :(

Thanks for testing, anyway!

Tord
Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: Anyone with a G5 Mac?

Post by Tord Romstad »

sje wrote:Typing "bt" into gdb will give a backtrace of the stack; if the executable hasn't been stripped, then the routine names will also appear.
Yes, but unfortunately the author was stupid and actually did strip the executable. I have now prepared a new binary for download, this time non-stripped. The source code is also available.

Tord
Guetti

Re: Anyone with a G5 Mac?

Post by Guetti »

Code: Select all

(gdb) run
Starting program: /Users/andreas/tmpdir/glaurung-g5/glaurung 
Reading symbols for shared libraries .+++ done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000f375cc
0x0000000000006bc4 in (anonymous namespace)::init_rook_attacks () at bitboard.cpp:204
204     bitboard.cpp: No such file or directory.
        in bitboard.cpp
(gdb) bt
#0  0x0000000000006bc4 in (anonymous namespace)::init_rook_attacks () at bitboard.cpp:204
#1  0x00000000000083ec in init_bitboards () at bitboard.cpp:109
#2  0x000000000000ed74 in main (argc=1, argv=0x7fffefffff388) at main.cpp:55
(gdb) 
Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: Anyone with a G5 Mac?

Post by Tord Romstad »

Thanks!

Now I think I see the problem: The pop_1st_bit() function is probably endianness-sensitive, and the index given to the BitTable[] array gets out of bounds.

I am too tired to try to figure out exactly why this happens and how to solve the problem, but after a few hours of sleep it shouldn't be too hard. :)

Tord
Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: Anyone with a G5 Mac?

Post by Tord Romstad »

Here's a new attempt: http://www.glaurungchess.com/beta/g070504.tar.gz

A new Mac OS X binary and source code is included. This time, I've compiled a universal binary which should (if everything works this time) be able to run on Intel Macs, G4 Macs and G5 Macs. It will run at slightly sub-optimal speed on Intel and G4 Macs, though.

Tord