Skip to content

Instantly share code, notes, and snippets.

WARNING: ThreadSanitizer: data race (pid=27432)
Write of size 8 at 0x7b240007eb20 by thread T39:
#0 nano::bulk_pull_client::received_block(boost::system::error_code const&, unsigned long, nano::block_type) /home/wezrule/nano/raiblocks/nano/node/bootstrap/bootstrap_bulk_pull.cpp:244 (nano_node+0x91ca43)
#1 operator() /home/wezrule/nano/raiblocks/nano/node/bootstrap/bootstrap_bulk_pull.cpp:185 (nano_node+0x921d90)
#2 std::_Function_handler<void (boost::system::error_code const&, unsigned long), nano::bulk_pull_client::received_type()::$_7>::_M_invoke(std::_Any_data const&, boost::system::error_code const&, unsigned long&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/std_function.h:316 (nano_node+0x921b61)
#3 std::function<void (boost::system::error_code const&, unsigned long)>::operator()(boost::system::error_code const&, unsigned long) const /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/std_function.h:706 (nano_node+0x64d164)
@wezrule
wezrule / gist:ab90069d569d43f6869af1d21c67ca48
Created February 18, 2020 12:37
1 million block batch add
TEST (block_processor, mass_add)
{
nano::system system;
nano::node_config node_config (nano::get_available_port (), system.logging);
node_config.frontiers_confirmation = nano::frontiers_confirmation_mode::disabled;
auto node = system.add_node (node_config);
nano::genesis genesis;
nano::keypair key;
system.wallet (0)->insert_adhoc (nano::test_genesis_key.prv);
auto const num_blocks = 1000000;
@wezrule
wezrule / gist:2fb14d1877b56c78623229ec939a7306
Created February 13, 2020 18:32
block_processor.mass_add
TEST (block_processor, mass_add)
{
nano::system system (1);
auto node = system.nodes.front ();
nano::genesis genesis;
nano::keypair key;
system.wallet (0)->insert_adhoc (nano::test_genesis_key.prv);
auto const num_blocks = 150000;
auto latest_genesis = node->latest (nano::test_genesis_key.pub);
std::vector<std::shared_ptr<nano::state_block>> state_blocks;
=================================================================
==15089==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 353517 byte(s) in 5277 object(s) allocated from:
__interceptor_malloc
??:?
build_absolute_url
/home/wezrule/nano/raiblocks/miniupnp/miniupnpc/miniupnpc.c:457
GetUPNPUrls
/home/wezrule/nano/raiblocks/miniupnp/miniupnpc/miniupnpc.c:499
[ RUN ] rpc.wallet_create_fail
==31225== Conditional jump or move depends on uninitialised value(s)
==31225== at 0xAE44BB: mdb_get (mdb.c:5826)
==31225== by 0x813BF8: nano::wallet_store::entry_get_raw(nano::transaction const&, nano::public_key const&) (wallet.cpp:433)
==31225== by 0x8173B8: nano::wallet_store::wallet_store(bool&, nano::kdf&, nano::transaction&, nano::public_key, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (wallet.cpp:361)
==31225== by 0x81884A: nano::wallet::wallet(bool&, nano::transaction&, nano::wallets&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (wallet.cpp:756)
==31225== by 0x82F281: construct<nano::wallet, bool &, nano::write_transaction &, nano::wallets &, std::__cxx11::basic_string<char> > (new_allocator.h:136)
==31225== by 0x82F281: construct<nano::wallet, bool &, nano::write_transaction &, nano::wallets &, std::__cxx11::basic_string<char> > (alloc_traits.h:47
==28904== Memcheck, a memory error detector
==28904== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==28904== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==28904== Command: ./core_test --gtest_filter=websocket.work
==28904==
Running main() from core_test_main.cc
Note: Google Test filter = websocket.work
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from websocket
==28904== Memcheck, a memory error detector
==28904== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==28904== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==28904== Command: ./core_test --gtest_filter=websocket.work
==28904==
Running main() from core_test_main.cc
Note: Google Test filter = websocket.work
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from websocket
==28904== Memcheck, a memory error detector
==28904== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==28904== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==28904== Command: ./core_test --gtest_filter=websocket.work
==28904==
Running main() from core_test_main.cc
Note: Google Test filter = websocket.work
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from websocket
[ RUN ] rpc.wallet_create_seed
==29950== Conditional jump or move depends on uninitialised value(s)
==29950== at 0x956624: assign_bits<boost::multiprecision::backends::cpp_int_backend<256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void>, unsigned char> (import_export.hpp:24)
==29950== by 0x956624: boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<256u, 256u, (boost::multiprecision::cpp_integer_type)0, (boost::multiprecision::cpp_int_check_type)0, void>, (boost::multiprecision::expression_template_option)0>& boost::multiprecision::detail::import_bits_generic<256u, 256u, (boost::multiprecision::cpp_integer_type)0, (boost::multiprecision::cpp_int_check_type)0, void, (boost::multiprecision::expression_template_option)0, unsigned char const*>(boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<256u, 256u, (boost::multiprecision::cpp_integer_type)0, (boost::multiprecision::cpp_int_check_type)0, void>, (boost::
==28904== Memcheck, a memory error detector
==28904== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==28904== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==28904== Command: ./core_test --gtest_filter=websocket.work
==28904==
Running main() from core_test_main.cc
Note: Google Test filter = websocket.work
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from websocket