Getting error when building with fsanitizer=memory
mxaddict opened this issue · comments
test/blsct/arith/g1point_tests.cpp(72): Entering test case "test_g1point_point_mul"
==65820==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x31b5bd9 in int mcl::bint::cmpN<unsigned long>(unsigned long const*, unsigned long const*, unsigned long) /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/include/mcl/bint.hpp:326:9
#1 0x31b5bd9 in mcl::VintT<mcl::vint::FixedBuffer>::ucompare(mcl::vint::FixedBuffer const&, unsigned long, mcl::vint::FixedBuffer const&, unsigned long) /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/include/mcl/vint.hpp:132:24
#2 0x31b5bd9 in mcl::VintT<mcl::vint::FixedBuffer>::compare(mcl::VintT<mcl::vint::FixedBuffer> const&, mcl::VintT<mcl::vint::FixedBuffer> const&) /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/include/mcl/vint.hpp:606:12
#3 0x31b5bd9 in mcl::operator==(mcl::VintT<mcl::vint::FixedBuffer> const&, mcl::VintT<mcl::vint::FixedBuffer> const&) /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/include/mcl/vint.hpp:1262:66
#4 0x31b5bd9 in mcl::operator!=(mcl::VintT<mcl::vint::FixedBuffer> const&, mcl::VintT<mcl::vint::FixedBuffer> const&) /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/include/mcl/vint.hpp:1263:67
#5 0x31b5bd9 in mcl::SquareRoot::setIfPrecomputed(mcl::VintT<mcl::vint::FixedBuffer> const&) /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/include/mcl/gmp_util.hpp:741:20
#6 0x3199456 in mcl::SquareRoot::set(bool*, mcl::VintT<mcl::vint::FixedBuffer> const&, bool) /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/include/mcl/gmp_util.hpp:785:30
#7 0x316fb22 in mcl::fp::Op::init(mcl::VintT<mcl::vint::FixedBuffer> const&, unsigned long, int, mcl::fp::Mode, unsigned long) /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/src/fp.cpp:547:6
#8 0x307ffa4 in mcl::FpT<mcl::bn::local::FrTag, 256ul>::init(bool*, int, mcl::VintT<mcl::vint::FixedBuffer> const&, mcl::fp::Mode) /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/include/mcl/fp.hpp:160:13
#9 0x30ab3cb in mcl::FpT<mcl::bn::local::FrTag, 256ul>::init(bool*, mcl::VintT<mcl::vint::FixedBuffer> const&, mcl::fp::Mode) /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/include/mcl/fp.hpp:206:3
#10 0x30ab3cb in mcl::bn::local::Param::init(bool*, mcl::CurveParam const&, mcl::fp::Mode) /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/include/mcl/bn.hpp:872:3
#11 0x3045005 in mcl::bn::BN::init(bool*, mcl::CurveParam const&, mcl::fp::Mode) /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/include/mcl/bn.hpp:2164:20
#12 0x3045005 in mcl::bn::initPairing(bool*, mcl::CurveParam const&, mcl::fp::Mode) /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/include/mcl/bn.hpp:2193:2
#13 0x3045005 in blsInit /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/src/bls_c_impl.hpp:98:2
#14 0x195fc13 in MclInitializer::Init() src/blsct/arith/mcl_initializer.cpp:13:9
#15 0x1981f58 in MclTestingSetup::MclTestingSetup() src/test/util/setup_common.cpp:451:5
#16 0xa668c8 in g1point_tests::test_g1point_point_mul::test_g1point_point_mul() src/test/blsct/arith/g1point_tests.cpp:72:1
#17 0xa51498 in g1point_tests::test_g1point_point_mul_invoker() src/test/blsct/arith/g1point_tests.cpp:72:1
#18 0x848e03 in boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/function/function_template.hpp:117:11
#19 0x6314b5 in boost::function0<void>::operator()() const /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/function/function_template.hpp:763:14
#20 0x720a07 in boost::detail::forward::operator()() /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1388:32
#21 0x720506 in boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/function/function_template.hpp:137:18
#22 0x71627d in boost::function0<int>::operator()() const /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/function/function_template.hpp:763:14
#23 0x5d9f73 in int boost::detail::do_invoke<boost::shared_ptr<boost::detail::translator_holder_base>, boost::function<int ()> >(boost::shared_ptr<boost::detail::translator_holder_base> const&, boost::function<int ()> const&) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:301:30
#24 0x5618fa in boost::execution_monitor::catch_signals(boost::function<int ()> const&) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:903:16
#25 0x561c76 in boost::execution_monitor::execute(boost::function<int ()> const&) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1301:16
#26 0x557a18 in boost::execution_monitor::vexecute(boost::function<void ()> const&) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1397:5
#27 0x55c4a3 in boost::unit_test::unit_test_monitor_t::execute_and_translate(boost::function<void ()> const&, unsigned long) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/unit_test_monitor.ipp:49:9
#28 0x5d6518 in boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/framework.ipp:815:44
#29 0x5d4bf5 in boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/framework.ipp:784:58
#30 0x5d4bf5 in boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/framework.ipp:784:58
#31 0x55aa87 in boost::unit_test::framework::run(unsigned long, bool) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/framework.ipp:1722:29
#32 0x5818d7 in boost::unit_test::unit_test_main(boost::unit_test::test_suite* (*)(int, char**), int, char**) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/unit_test_main.ipp:250:9
#33 0x5821ee in main /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/unit_test_main.ipp:306:12
#34 0x7eff57a28082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082)
#35 0x4c2afd in _start (/tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/test/test_navcoin+0x4c2afd)
Uninitialized value was stored to memory at
#0 0x316d217 in mcl::vint::FixedBuffer::operator=(mcl::vint::FixedBuffer const&) /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/include/mcl/vint.hpp:48:10
#1 0x316d217 in mcl::VintT<mcl::vint::FixedBuffer>::operator=(mcl::VintT<mcl::vint::FixedBuffer> const&) /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/include/mcl/vint.hpp:425:8
#2 0x316d217 in mcl::fp::Op::init(mcl::VintT<mcl::vint::FixedBuffer> const&, unsigned long, int, mcl::fp::Mode, unsigned long) /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/src/fp.cpp:423:5
Uninitialized value was stored to memory at
#0 0x30aa4c4 in mcl::vint::FixedBuffer::operator=(mcl::vint::FixedBuffer const&) /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/include/mcl/vint.hpp:48:10
#1 0x30aa4c4 in mcl::VintT<mcl::vint::FixedBuffer>::operator=(mcl::VintT<mcl::vint::FixedBuffer>&&) /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/include/mcl/vint.hpp:439:8
#2 0x30aa4c4 in mcl::bn::local::Param::init(bool*, mcl::CurveParam const&, mcl::fp::Mode) /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/include/mcl/bn.hpp:862:6
#3 0x3339d80809a1d804 (<unknown module>)
Uninitialized value was stored to memory at
#0 0x308205d in void mcl::bint::copyN<unsigned long>(unsigned long*, unsigned long const*, unsigned long) /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/include/mcl/bint.hpp:166:38
#1 0x308205d in mcl::VintT<mcl::vint::FixedBuffer>::uadd1(mcl::VintT<mcl::vint::FixedBuffer>&, mcl::vint::FixedBuffer const&, unsigned long, unsigned long) /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/include/mcl/vint.hpp:172:28
#2 0x308205d in mcl::VintT<mcl::vint::FixedBuffer>::_adds1(mcl::VintT<mcl::vint::FixedBuffer>&, mcl::VintT<mcl::vint::FixedBuffer> const&, int, bool) /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/include/mcl/vint.hpp:237:4
Uninitialized value was created by an allocation of 'ref.tmp25' in the stack frame of function '_ZN3mcl2bn5local5Param4initEPbRKNS_10CurveParamENS_2fp4ModeE'
#0 0x30a8ef0 in mcl::bn::local::Param::init(bool*, mcl::CurveParam const&, mcl::fp::Mode) /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/include/mcl/bn.hpp:841
SUMMARY: MemorySanitizer: use-of-uninitialized-value /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/include/mcl/bint.hpp:326:9 in int mcl::bint::cmpN<unsigned long>(unsigned long const*, unsigned long const*, unsigned long)
Main pieces of code that are causing are the following:
@herumi do you have any idea on how I would mitigate this issue?
What CPU/OS/compiler options do you use? And because I don't know test/blsct/arith/g1point_tests.cpp(72)
, I can't check it.
If the problem occurs only if using a libbls384_256.a built by https://github.com/herumi/bls/blob/dev/Makefile.onelib , then please specify -DMCL_MAX_BIT_SIZE=384 to your project.
All tests of mcl/bls run with -fsanitize=address. The constructor of mcl/bls does not clear the value.
Does your code correctly initialize a value?
We are seeing the following error when building with -fsanitize=memory
:
==65875==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x311dad1 in bool mcl::fp::isEqualArray<unsigned long>(unsigned long const*, unsigned long const*, unsigned long) /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/include/mcl/util.hpp:122:7
#1 0x311dad1 in mcl::FpT<mcl::bn::local::FpTag, 384ul>::operator==(mcl::FpT<mcl::bn::local::FpTag, 384ul> const&) const /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/include/mcl/fp.hpp:688:49
#2 0x311dad1 in mcl::Fp2T<mcl::FpT<mcl::bn::local::FpTag, 384ul> >::operator==(mcl::Fp2T<mcl::FpT<mcl::bn::local::FpTag, 384ul> > const&) const /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/include/mcl/fp_tower.hpp:355:52
#3 0x311dad1 in mcl::bn::local::Param::init(bool*, mcl::CurveParam const&, mcl::fp::Mode) /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/include/mcl/bn.hpp:916:15
#4 0x30caa01 in mcl::bn::BN::init(bool*, mcl::CurveParam const&, mcl::fp::Mode) /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/include/mcl/bn.hpp:2268:20
#5 0x30caa01 in mcl::bn::initPairing(bool*, mcl::CurveParam const&, mcl::fp::Mode) /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/include/mcl/bn.hpp:2297:2
#6 0x30bbc8f in mclBn_init /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/include/mcl/impl/bn_c_impl.hpp:83:2
#7 0x19c5393 in MclInitializer::Init() src/blsct/arith/mcl_initializer.cpp:13:9
#8 0x19e7e58 in MclTestingSetup::MclTestingSetup() src/test/util/setup_common.cpp:451:5
#9 0xa5f268 in elements_tests::test_elements_mulvec_elements::test_elements_mulvec_elements() src/test/blsct/arith/elements_tests.cpp:469:1
#10 0xa54418 in elements_tests::test_elements_mulvec_elements_invoker() src/test/blsct/arith/elements_tests.cpp:469:1
#11 0x84f133 in boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/function/function_template.hpp:117:11
#12 0x6377e5 in boost::function0<void>::operator()() const /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/function/function_template.hpp:763:14
#13 0x726d37 in boost::detail::forward::operator()() /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1388:32
#14 0x726836 in boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/function/function_template.hpp:137:18
#15 0x71c5ad in boost::function0<int>::operator()() const /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/function/function_template.hpp:763:14
#16 0x5e02a3 in int boost::detail::do_invoke<boost::shared_ptr<boost::detail::translator_holder_base>, boost::function<int ()> >(boost::shared_ptr<boost::detail::translator_holder_base> const&, boost::function<int ()> const&) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:301:30
#17 0x567c2a in boost::execution_monitor::catch_signals(boost::function<int ()> const&) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:903:16
#18 0x567fa6 in boost::execution_monitor::execute(boost::function<int ()> const&) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1301:16
#19 0x55dd48 in boost::execution_monitor::vexecute(boost::function<void ()> const&) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1397:5
#20 0x5627d3 in boost::unit_test::unit_test_monitor_t::execute_and_translate(boost::function<void ()> const&, unsigned long) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/unit_test_monitor.ipp:49:9
#21 0x5dc848 in boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/framework.ipp:815:44
#22 0x5daf25 in boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/framework.ipp:784:58
#23 0x5daf25 in boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/framework.ipp:784:58
#24 0x560db7 in boost::unit_test::framework::run(unsigned long, bool) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/framework.ipp:1722:29
#25 0x587c07 in boost::unit_test::unit_test_main(boost::unit_test::test_suite* (*)(int, char**), int, char**) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/unit_test_main.ipp:250:9
#26 0x58851e in main /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/unit_test_main.ipp:306:12
#27 0x7ff2cefa3082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082)
#28 0x4c8e2d in _start (/tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/test/test_navcoin+0x4c8e2d)
Uninitialized value was stored to memory at
#0 0x33ff37c in void mcl::fp::copyArray<unsigned long>(unsigned long*, unsigned long const*, unsigned long) /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/include/mcl/util.hpp:145:38
#1 0x33ff37c in void mcl::fp::copyC<6ul>(unsigned long*, unsigned long const*) /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/src/low_func.hpp:58:2
Uninitialized value was created by an allocation of 'ref.tmp125' in the stack frame of function '_ZN3mcl2bn5local5Param4initEPbRKNS_10CurveParamENS_2fp4ModeE'
#0 0x3117850 in mcl::bn::local::Param::init(bool*, mcl::CurveParam const&, mcl::fp::Mode) /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/include/mcl/bn.hpp:860
SUMMARY: MemorySanitizer: use-of-uninitialized-value /tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/include/mcl/util.hpp:122:7 in bool mcl::fp::isEqualArray<unsigned long>(unsigned long const*, unsigned long const*, unsigned long)
Compiling with the following flags:
/usr/bin/ccache clang++ -std=c++17 -pipe -std=c++17 -O2 -fsanitize=memory -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer -g -O1 -fno-optimize-sibling-calls -nostdinc++ -stdlib=libc++ -L/tmp/cirrus-ci-build/ci/scratch/msan/build/lib -lc++abi -I/tmp/cirrus-ci-build/ci/scratch/msan/build/include -I/tmp/cirrus-ci-build/ci/scratch/msan/build/include/c++/v1 -lpthread -Wl,-rpath,/tmp/cirrus-ci-build/ci/scratch/msan/build/lib -Wno-unused-command-line-argument -g3 -Wall -Wextra -Wformat=2 -Wcast-qual -Wcast-align -Wwrite-strings -Wfloat-equal -Wpointer-arith -Wundef -m64 -I include -I test -fomit-frame-pointer -DNDEBUG -fno-stack-protector -O3 -DMCL_USE_VINT -DMCL_DONT_USE_OPENSSL -fPIC -std=c++11 -I/tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl/include -c src/bls_c384_256.cpp -o obj/bls_c384_256.o -MMD -MP -MF obj/bls_c384_256.d
make[3]: Entering directory '/tmp/cirrus-ci-build/ci/scratch/build/navcoin-x86_64-pc-linux-gnu/src/bls/mcl'
/usr/bin/ccache clang++ -std=c++17 -pipe -std=c++17 -O2 -fsanitize=memory -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer -g -O1 -fno-optimize-sibling-calls -nostdinc++ -stdlib=libc++ -L/tmp/cirrus-ci-build/ci/scratch/msan/build/lib -lc++abi -I/tmp/cirrus-ci-build/ci/scratch/msan/build/include -I/tmp/cirrus-ci-build/ci/scratch/msan/build/include/c++/v1 -lpthread -Wl,-rpath,/tmp/cirrus-ci-build/ci/scratch/msan/build/lib -Wno-unused-command-line-argument -g3 -Wall -Wextra -Wformat=2 -Wcast-qual -Wcast-align -Wwrite-strings -Wfloat-equal -Wpointer-arith -Wundef -m64 -I include -I test -fomit-frame-pointer -DNDEBUG -fno-stack-protector -O3 -DMCL_USE_VINT -DMCL_DONT_USE_OPENSSL -fPIC -c src/fp.cpp -o obj/fp.o -MMD -MP -MF obj/fp.d
Adding -DMCL_MAX_BIT_SIZE=384
does not fix the issue.
mcl_initializer.cpp:
#include <blsct/arith/mcl_initializer.h>
void MclInitializer::Init()
{
boost::lock_guard<boost::mutex> lock(MclInitializer::m_init_mutex);
static bool is_initialized = false;
if (is_initialized) return;
if (mclBn_init(MCL_BLS12_381, MCLBN_COMPILED_TIME_VAR) != 0) {
throw std::runtime_error("blsInit failed");
}
mclBn_setETHserialization(1);
is_initialized = true;
}
mcl_initializer.h:
#include <mcl/bn_c384_256.h>
#include <boost/thread/lock_guard.hpp>
#include <boost/thread/mutex.hpp>
class MclInitializer
{
public:
static void Init();
private:
inline static boost::mutex m_init_mutex;
};
I think that this is the same reason at #167 (comment) .