bitcoin: 32-bit test failure: test/crypto_tests.cpp(561): error: in "crypto_tests/sha256d64": check memcmp(out1, out2, 32 * i) == 0 has failed

A test in the bitcoin test suite is failing for me while running the sha256d64 test cases in crypto_tests.cpp, but only on 32-bit distro. It passes on 64-bit.

I expected the test suite to pass.

The test suite log is:

$ cat test/crypto_tests.cpp.log
Running 11 test cases...
Entering test module "Bitcoin Test Suite"
test/crypto_tests.cpp(23): Entering test suite "crypto_tests"
test/crypto_tests.cpp(217): Entering test case "ripemd160_testvectors"
test/crypto_tests.cpp(217): Leaving test case "ripemd160_testvectors"; testing time: 343157us
test/crypto_tests.cpp(233): Entering test case "sha1_testvectors"
test/crypto_tests.cpp(233): Leaving test case "sha1_testvectors"; testing time: 200719us
test/crypto_tests.cpp(249): Entering test case "sha256_testvectors"
test/crypto_tests.cpp(249): Leaving test case "sha256_testvectors"; testing time: 518373us
test/crypto_tests.cpp(271): Entering test case "sha512_testvectors"
test/crypto_tests.cpp(271): Leaving test case "sha512_testvectors"; testing time: 1071278us
test/crypto_tests.cpp(308): Entering test case "hmac_sha256_testvectors"
test/crypto_tests.cpp(308): Leaving test case "hmac_sha256_testvectors"; testing time: 10312us
test/crypto_tests.cpp(361): Entering test case "hmac_sha512_testvectors"
test/crypto_tests.cpp(361): Leaving test case "hmac_sha512_testvectors"; testing time: 22518us
test/crypto_tests.cpp(429): Entering test case "aes_testvectors"
test/crypto_tests.cpp(429): Leaving test case "aes_testvectors"; testing time: 3358us
test/crypto_tests.cpp(445): Entering test case "aes_cbc_testvectors"
test/crypto_tests.cpp(445): Leaving test case "aes_cbc_testvectors"; testing time: 4206us
test/crypto_tests.cpp(497): Entering test case "chacha20_testvector"
test/crypto_tests.cpp(497): Leaving test case "chacha20_testvector"; testing time: 3051us
test/crypto_tests.cpp(527): Entering test case "countbits_tests"
test/crypto_tests.cpp(527): Leaving test case "countbits_tests"; testing time: 63452us
test/crypto_tests.cpp(549): Entering test case "sha256d64"
test/crypto_tests.cpp(561): error: in "crypto_tests/sha256d64": check memcmp(out1, out2, 32 * i) == 0 has failed
test/crypto_tests.cpp(561): error: in "crypto_tests/sha256d64": check memcmp(out1, out2, 32 * i) == 0 has failed
test/crypto_tests.cpp(561): error: in "crypto_tests/sha256d64": check memcmp(out1, out2, 32 * i) == 0 has failed
test/crypto_tests.cpp(561): error: in "crypto_tests/sha256d64": check memcmp(out1, out2, 32 * i) == 0 has failed
test/crypto_tests.cpp(561): error: in "crypto_tests/sha256d64": check memcmp(out1, out2, 32 * i) == 0 has failed
test/crypto_tests.cpp(561): error: in "crypto_tests/sha256d64": check memcmp(out1, out2, 32 * i) == 0 has failed
test/crypto_tests.cpp(561): error: in "crypto_tests/sha256d64": check memcmp(out1, out2, 32 * i) == 0 has failed
test/crypto_tests.cpp(561): error: in "crypto_tests/sha256d64": check memcmp(out1, out2, 32 * i) == 0 has failed
test/crypto_tests.cpp(561): error: in "crypto_tests/sha256d64": check memcmp(out1, out2, 32 * i) == 0 has failed
test/crypto_tests.cpp(561): error: in "crypto_tests/sha256d64": check memcmp(out1, out2, 32 * i) == 0 has failed
test/crypto_tests.cpp(561): error: in "crypto_tests/sha256d64": check memcmp(out1, out2, 32 * i) == 0 has failed
test/crypto_tests.cpp(561): error: in "crypto_tests/sha256d64": check memcmp(out1, out2, 32 * i) == 0 has failed
test/crypto_tests.cpp(561): error: in "crypto_tests/sha256d64": check memcmp(out1, out2, 32 * i) == 0 has failed
test/crypto_tests.cpp(561): error: in "crypto_tests/sha256d64": check memcmp(out1, out2, 32 * i) == 0 has failed
test/crypto_tests.cpp(561): error: in "crypto_tests/sha256d64": check memcmp(out1, out2, 32 * i) == 0 has failed
test/crypto_tests.cpp(561): error: in "crypto_tests/sha256d64": check memcmp(out1, out2, 32 * i) == 0 has failed
test/crypto_tests.cpp(561): error: in "crypto_tests/sha256d64": check memcmp(out1, out2, 32 * i) == 0 has failed
test/crypto_tests.cpp(561): error: in "crypto_tests/sha256d64": check memcmp(out1, out2, 32 * i) == 0 has failed
test/crypto_tests.cpp(561): error: in "crypto_tests/sha256d64": check memcmp(out1, out2, 32 * i) == 0 has failed
test/crypto_tests.cpp(561): error: in "crypto_tests/sha256d64": check memcmp(out1, out2, 32 * i) == 0 has failed
test/crypto_tests.cpp(561): error: in "crypto_tests/sha256d64": check memcmp(out1, out2, 32 * i) == 0 has failed
test/crypto_tests.cpp(561): error: in "crypto_tests/sha256d64": check memcmp(out1, out2, 32 * i) == 0 has failed
test/crypto_tests.cpp(561): error: in "crypto_tests/sha256d64": check memcmp(out1, out2, 32 * i) == 0 has failed
test/crypto_tests.cpp(561): error: in "crypto_tests/sha256d64": check memcmp(out1, out2, 32 * i) == 0 has failed
test/crypto_tests.cpp(561): error: in "crypto_tests/sha256d64": check memcmp(out1, out2, 32 * i) == 0 has failed
test/crypto_tests.cpp(561): error: in "crypto_tests/sha256d64": check memcmp(out1, out2, 32 * i) == 0 has failed
test/crypto_tests.cpp(561): error: in "crypto_tests/sha256d64": check memcmp(out1, out2, 32 * i) == 0 has failed
test/crypto_tests.cpp(561): error: in "crypto_tests/sha256d64": check memcmp(out1, out2, 32 * i) == 0 has failed
test/crypto_tests.cpp(561): error: in "crypto_tests/sha256d64": check memcmp(out1, out2, 32 * i) == 0 has failed
test/crypto_tests.cpp(561): error: in "crypto_tests/sha256d64": check memcmp(out1, out2, 32 * i) == 0 has failed
test/crypto_tests.cpp(561): error: in "crypto_tests/sha256d64": check memcmp(out1, out2, 32 * i) == 0 has failed
test/crypto_tests.cpp(561): error: in "crypto_tests/sha256d64": check memcmp(out1, out2, 32 * i) == 0 has failed
test/crypto_tests.cpp(549): Leaving test case "sha256d64"; testing time: 5115us
test/crypto_tests.cpp(23): Leaving test suite "crypto_tests"; testing time: 2246048us
Leaving test module "Bitcoin Test Suite"; testing time: 2246167us

*** 32 failures are detected in the test module "Bitcoin Test Suite"

This is occurring on Fedora 29 i686 while building bitcoin. The builder has 4GB RAM. This environment includes boost 1.66.0 and openssl 1.1.1. The test passes while building bitcoin on Fedora 29 x86_64 on the same machine. The test also passed on Fedora 28 i686, which has boost 1.66.0 and openssl 1.1.0i.

This is bitcoin 0.17.0 obtained from thhe github release tagged v0.17.0.

I glanced at the test but I didn’t see anything obvious that might cause it to fail on a 32-bit system. I would appreciate a hint as to where to look next.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 24 (22 by maintainers)

Commits related to this issue

Most upvoted comments

I believe this is a GCC bug, filed as https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90348

So I guess it has nothing to do with openssl

I am seeing this running the gitian build (which is built with depends) on ubuntu_xenial_armhf … 😩

As a workaround you could build from our ./depends (which comes with an older openssl)