Closed kwvg closed 2 months ago
Sanitizer tsan crashes like that in CI:
SUMMARY: ThreadSanitizer: heap-use-after-free /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/unique_ptr.h:154:42 in _M_ptr
I guess, this crash happens due to re-creation of g_txindex inside TestChainSetup::mineBlocks
g_txindex = std::make_unique<TxIndex>(1 << 20, true);
assert(g_txindex->Start(m_node.chainman->ActiveChainstate()));
// Allow tx index to catch up with the block index.
IndexWaitSynced(*g_txindex);
so, g_txindex can be re-created several times, but there are async calls of g_txindex and they can be using g_txindex, when it called to re-create it.
I guess some guard code is needed for it.
Additional Information
Dependent on https://github.com/dashpay/dash/pull/6078
Dependent on https://github.com/dashpay/dash/pull/6074
Dependent on https://github.com/dashpay/dash/pull/6083
Dependent on https://github.com/dashpay/dash/pull/6119
Dependency for https://github.com/dashpay/dash/pull/6138
In bitcoin#24050,
BlockMap
is given ownership of theCBlockIndex
instance contained within theunordered_map
. The same has not been done forPrevBlockMap
asPrevBlockMap
is populated withpprev
pointers and doing so seems to break validation logic.Dash has a specific linter for all Dash-specific code present in Core. The introduction of
util/translation.h
intovalidation.h
has caused the linter to trigger shadowing warnings due to a conflict between the common use of_
as a placeholder/throwaway name (source) and upstream's usage of it to process translatable strings (source).Neither C++17 nor C++20 have an official placeholder/throwaway term or annotation for structured bindings (which cannot use
[[maybe_unused]
orstd::ignore
) but P2169 is a proposal put forth to make it the official placeholder, in that light, the linter will silence shadowing warnings involving an underscore.Breaking Changes
None expected
Checklist: