[bitcoin-dev] libconsensus assertion fails if used in multiple threads

Tamas Blummer tamas at bitsofproof.com
Fri Aug 14 16:37:57 UTC 2015


We integrated libconsensus into bits of proof. It works well, in-line for all test cases with our Java engine and is about 50% faster on a single thread.

The performance advantage unfortunatelly reverses if libconsensus is executed on several threads simultaneously as we do with the Java engine, since an error:

	Assertion failed: (pkey != NULL), function CECKey, file ecwrapper.cpp, line 96.

arises under that stress.

I guess that the cause is that thread callbacks as advised for OpenSSL on https://www.openssl.org/docs/crypto/threads.html are not registered.
Registering those however would require access to OpenSSL functions, not exported from the lib.

I’d be thankful for a pointer to a workaround.

Tamas Blummer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 496 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20150814/35f728b8/attachment-0001.sig>


More information about the bitcoin-dev mailing list