I noticed the release 0.9.3 as well as Gitian builds, build with a Debian 7.6.0 VM via the "old" route, appear to have some issues with OpenSSL, CBigNum or CScriptNum in combination with Win x64.
To be more specific: On Windows 8.1 x64 there are 798 scriptnum_tests failures when using the 64 bit build of the official release 0.9.3 and 0 failures when using the 32 bit build release:
Then I used a v0.9.3~ non release as basis, added some code for debug output, and build on a Debian 7.6.0 VM via Gitian, following a similar route as outlined in the doc/release-process.md file, creating the following results:
- http://bitwatch.co/uploads/win64_scriptnum_verbose_64.log (Gitian via Debian VM)
- http://bitwatch.co/uploads/win64_scriptnum_verbose_32.log (Gitian via Debian VM)
- http://bitwatch.co/uploads/ubuntu1404_scriptnum_verbose_64.log (Ubuntuu 14.04 x64)
The last log was not part of a Gitian build.
Client information:
Release 0.9.3, 32 bit:
v0.9.3.0-g40d2041-beta, OpenSSL 1.0.1i 6 Aug 2014, build: Mon, 22 Sep 2014 16:42:15 +0200
Release 0.9.3, 64 bit:
v0.9.3.0-g40d2041-beta, OpenSSL 1.0.1i 6 Aug 2014, build: Mon, 22 Sep 2014 16:42:15 +0200
Gitian/Debian verbose build, 32 bit:
v0.9.3.0-ge449166-beta, OpenSSL 1.0.1i 6 Aug 2014, build: 9 Dec 2014 23:10:05 -0500
Gitian/Debian verbose build, 64 bit:
v0.9.3.0-ge449166-beta, OpenSSL 1.0.1i 6 Aug 2014, build: 9 Dec 2014 23:10:05 -0500
Ubuntu 14.04 build:
v0.9.3.0-5719766-dirty-beta, OpenSSL 1.0.1f 6 Jan 2014, build: 2014-12-10 10:58:05 +0100
A few samples to compare, whereby all failures are related to 64 bit builds, run on Win 8.1 x64:
bignum.ToHex(): 100000078
bignum.ToString(): 4294967416
bignum.getulong(): 4294967416
bignum.getuint(): 120
bignum.getint(): 2147483647 <<
scriptnum.getint(): 2147483647 <<
bignum.getvch(): 7800000001 << vch.size(): 5
scriptnum.getvch(): 7800000001 << vch.size(): 5
bignum.ToHex(): 100000078
bignum.ToString(): 4294967416
bignum.getulong(): 120
bignum.getuint(): 120
bignum.getint(): 120 <<
scriptnum.getint(): 2147483647 <<
bignum.getvch(): 7800000001 << vch.size(): 5
scriptnum.getvch(): 7800000001 << vch.size(): 5
scriptnum_tests.cpp(54): error in "creation": check verify(bignum, scriptnum) failed
bignum.ToHex(): 7fffffff
bignum.ToString(): 2147483647
bignum.getulong(): 2147483647
bignum.getuint(): 2147483647
bignum.getint(): 2147483647 <<
scriptnum.getint(): 2147483647 <<
bignum.getvch(): ffffff7f << vch.size(): 4
scriptnum.getvch(): ffffff7f << vch.size(): 4
bignum.ToHex(): 78
bignum.ToString(): 120
bignum.getulong(): 120
bignum.getuint(): 120
bignum.getint(): 120 <<
scriptnum.getint(): 2147483647 <<
bignum.getvch(): ffffff7f << vch.size(): 4
scriptnum.getvch(): ffffff7f << vch.size(): 4
scriptnum_tests.cpp(55): error in "creation": check verify(bignum.getint(), ...
bignum.ToHex(): 7fffffff
bignum.ToString(): 2147483647
bignum.getulong(): 2147483647
bignum.getuint(): 2147483647
bignum.getint(): 2147483647 <<
scriptnum.getint(): 2147483647 <<
bignum.getvch(): ffffff7f << vch.size(): 4
scriptnum.getvch(): ffffff7f << vch.size(): 4
bignum.ToHex(): 7fffffff
bignum.ToString(): 2147483647
bignum.getulong(): 2147483647
bignum.getuint(): 2147483647
bignum.getint(): 2147483647 <<
scriptnum.getint(): 120 <<
bignum.getvch(): 78 << vch.size(): 1
scriptnum.getvch(): 78 << vch.size(): 1
scriptnum_tests.cpp(56): error in "creation": check verify(scriptnum.getint(), ...
The arrows << mark values that are used in the verification function (scriptnum_tests.cpp#L18). Furthermore I prefixed all lines related to failures in verbose_64.log with ##.
bignum.getvch() and scriptnum.getvch() were embedded in HexStr() and the output was printed with printf and %s, %lu, %u and %d format specifiers.
It's not clear to me, if the results can be compared line by line, because they seem to differ in length sometimes, even without failure, but a look at master/crypto/bn/bn.h already hints why this might be.
My very best and unsophisticated guess: OpenSSL and LLP64 are not the best friends.