dashpay / dash

Dash - Reinventing Cryptocurrency
https://www.dash.org
MIT License
1.49k stars 1.2k forks source link

backport: merge bitcoin#21727, #22371, #21526, #23174, #23785, #23581, #23974, #22932, #24050, #24515 (blockstorage backports) #6085

Closed kwvg closed 2 months ago

kwvg commented 3 months ago

Additional Information

Breaking Changes

None expected

Checklist:

knst commented 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.