Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solaris 11 and Sparc crash in Tiger #690

Closed
noloader opened this issue Jul 20, 2018 · 1 comment
Closed

Solaris 11 and Sparc crash in Tiger #690

noloader opened this issue Jul 20, 2018 · 1 comment

Comments

@noloader
Copy link
Collaborator

noloader commented Jul 20, 2018

Compiling with Sun Studio 12.3 is leading to a crash on Solaris 11 on Sparc:

$ CXX=/opt/solarisstudio12.3/bin/CC CXXFLAGS="-DNDEBUG -g -O2" make -j 8
...

$ ./cryptest.exe
...

Tiger validation suite running...

passed   3293ac630c13f0245f92bbb1766e16167a4e58492dde73f3   ""
passed   2aab1484e8c158f2bfb8c5ff41b57a525129131c957b5f93   "abc"
passed   dd00230799f5009fec6debc838bb6a27df2b9d6f110c7937   "Tiger"
passed   f71c8583902afb879edfe610f82c0d4786a3a534504486b5   "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-"
Bus Error (core dumped)

Building everything with -xmemalign-4i and the program is OK. rm tiger.o followed by a tiger.cpp rebuild without the flag is OK. A rm iterhash.o tiger.o followed by a rebuild without the flag is bad.

It seems iterhash.cpp is [incorrectly] handling unaligned data. It is also worth mention Tiger uses word64.

Now, the problem is, gdb does not really work so we have not been able to run it under the debugger and learn something useful. Sigh... I guess we have to try the native dbx debugger next.


And here we have it:

(dbx) run v
...

Tiger validation suite running...

passed   3293ac630c13f0245f92bbb1766e16167a4e58492dde73f3   ""
passed   2aab1484e8c158f2bfb8c5ff41b57a525129131c957b5f93   "abc"
passed   dd00230799f5009fec6debc838bb6a27df2b9d6f110c7937   "Tiger"
passed   f71c8583902afb879edfe610f82c0d4786a3a534504486b5   "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-"
signal BUS (invalid address alignment) in CryptoPP::ByteReverse<unsigned long> at line 2074 in file "misc.h"
 2074                   out[i] = ByteReverse(in[i]);^M
(dbx)
noloader added a commit that referenced this issue Jul 21, 2018
Man, Sparc does not mess around with unaligned buffers. Without -xmemalign=4i the hardware wants 8-byte aligned word64's so it can use the high performance 64-bit move or add.
Since we do not use -xmemalign we get the default behavior of either -xmemalgin=8i or -xmemalgin=8s. It shoul dnot matter to us since we removed unaligned data access at GH #682.
@noloader
Copy link
Collaborator Author

Cleared at Commit 414c5c543860.

noloader referenced this issue Jul 21, 2018
It looks like GetAlignmentOf was returning the "UnsignedMin(4U, sizeof(T))" for SunCC. It was causing SIGBUSes on Sparc when T=word64. OpenCSW provided access to their build farm and we were able to test "__alignof__(T)" back to an early SunCC on Solaris 9.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant