Release 0.9.3 + 0.9.3~ Gitian build on Win 8.1 x64 fails scriptnum_tests #5456

issue dexX7 opened this issue on December 10, 2014
  1. dexX7 commented at 12:47 PM on December 10, 2014: contributor

    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:

    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.

  2. laanwj added the label Bug on Dec 11, 2014
  3. laanwj added the label Tests on Dec 11, 2014
  4. laanwj commented at 2:48 PM on December 11, 2014: member

    Yes, this is a bug in the bignum tests that has been solved in master.

  5. dexX7 commented at 2:55 PM on December 11, 2014: contributor
  6. sipa commented at 2:57 PM on December 11, 2014: member

    Indeed, that's the commit that fixed it.

  7. dexX7 closed this on Dec 11, 2014

  8. MarcoFalke locked this on Sep 8, 2021
Contributors
Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-02 03:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me