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

Add self-tests at startup #4081

Closed
laanwj opened this issue Apr 22, 2014 · 3 comments
Closed

Add self-tests at startup #4081

laanwj opened this issue Apr 22, 2014 · 3 comments

Comments

@laanwj
Copy link
Member

laanwj commented Apr 22, 2014

The idea would be to test basic sanity of the execution environment and dependencies. for example:

  • check std::list and the functions overridden in the compatibility wrappers for older glibc/glibc++
  • test basic secp256k operations
  • test hash functions

This idea was brought up by @sipa in issue #4042. The tests should run very quickly (<0.1 second).

@laanwj laanwj added the Tests label May 6, 2014
apoelstra added a commit to apoelstra/bitcoin that referenced this issue Jun 3, 2014
Previously if bitcoind is linked with an OpenSSL which is compiled
without EC support, this is seen as an assertion failure "pKey !=
NULL" at key.cpp:134, which occurs after several seconds. It is an
esoteric piece of knowledge to interpret this as "oops, I linked
with the wrong OpenSSL", and because of the delay it may not even
be noticed.

The new output is

: OpenSSL appears to lack support for elliptic curve cryptography. For
more information, visit
https://en.bitcoin.it/wiki/OpenSSL_and_EC_Libraries
: Initialization sanity check failed. Bitcoin Core is shutting down.

which occurs immediately after attempted startup.

This also blocks in an InitSanityCheck() function which currently only
checks for EC support but should eventually do more. See bitcoin#4081.
laanwj pushed a commit that referenced this issue Aug 18, 2014
Previously if bitcoind is linked with an OpenSSL which is compiled
without EC support, this is seen as an assertion failure "pKey !=
NULL" at key.cpp:134, which occurs after several seconds. It is an
esoteric piece of knowledge to interpret this as "oops, I linked
with the wrong OpenSSL", and because of the delay it may not even
be noticed.

The new output is

: OpenSSL appears to lack support for elliptic curve cryptography. For
more information, visit
https://en.bitcoin.it/wiki/OpenSSL_and_EC_Libraries
: Initialization sanity check failed. Bitcoin Core is shutting down.

which occurs immediately after attempted startup.

This also blocks in an InitSanityCheck() function which currently only
checks for EC support but should eventually do more. See #4081.

Rebased-From: 4a09e1d
MathyV pushed a commit to reddcoin-project/reddcoin-3.10 that referenced this issue Nov 3, 2014
Previously if bitcoind is linked with an OpenSSL which is compiled
without EC support, this is seen as an assertion failure "pKey !=
NULL" at key.cpp:134, which occurs after several seconds. It is an
esoteric piece of knowledge to interpret this as "oops, I linked
with the wrong OpenSSL", and because of the delay it may not even
be noticed.

The new output is

: OpenSSL appears to lack support for elliptic curve cryptography. For
more information, visit
https://en.bitcoin.it/wiki/OpenSSL_and_EC_Libraries
: Initialization sanity check failed. Bitcoin Core is shutting down.

which occurs immediately after attempted startup.

This also blocks in an InitSanityCheck() function which currently only
checks for EC support but should eventually do more. See bitcoin#4081.
@laanwj
Copy link
Member Author

laanwj commented Feb 9, 2016

Implemented by #4339

@laanwj laanwj closed this as completed Feb 9, 2016
@dcousens
Copy link
Contributor

dcousens commented Feb 9, 2016

@laanwj what about libsecp256k and the hash functions?

@laanwj
Copy link
Member Author

laanwj commented Feb 10, 2016

Sure, you could do that...
(but the prime motivation here was to do this because these operations were performed by external libraries - now that secp256k1 is internal, and the hash functions are also performed by our own code, I'm not sure what kind of errors it is supposed to catch)

@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants