init.cpp:1635 prints mapBlockIndex.size() without cs_main. This is technically a race (though it is rather inconsequential). At some point someone should fix this so tsan stops complaining.
{
    LOCK(cs_main);
    CCoinsViewCache cache(view);
    std::vector<uint256> hashHeads = view->GetHeadBlocks();
    if (hashHeads.empty()) return true; 
    if (hashHeads.size() != 2) return error("ReplayBlocks(): unknown inconsistent state");
    uiInterface.ShowProgress(_("Replaying blocks..."), 0);
    LogPrintf("Replaying blocks\n");
    const CBlockIndex* pindexOld = nullptr;  
    const CBlockIndex* pindexNew;            
    const CBlockIndex* pindexFork = nullptr; 
    if (mapBlockIndex.count(hashHeads[0]) == 0) {
        return error("ReplayBlocks(): reorganization to unknown block requested");
    }
    pindexNew = mapBlockIndex[hashHeads[0]];
    if (!hashHeads[1].IsNull()) { 
        if (mapBlockIndex.count(hashHeads[1]) == 0) {
            return error("ReplayBlocks(): reorganization from unknown block requested");
        }
        pindexOld = mapBlockIndex[hashHeads[1]];
        pindexFork = LastCommonAncestor(pindexOld, pindexNew);
        assert(pindexFork != nullptr);
    }
    
    while (pindexOld != pindexFork) {