This is a well known (long standing) issue. Documented in the code base in commit eea02be70ee37b845f2719b3c08e5baf4b6f51f6.

Countless intermittent sanitizer warnings can be attributed to it.
{
    FastRandomContext rng;
    std::vector<std::string> seeds = Params().DNSSeeds();
    Shuffle(seeds.begin(), seeds.end(), rng);
    int seeds_right_now = 0; 
    int found = 0;
    if (gArgs.GetBoolArg("-forcednsseed", DEFAULT_FORCEDNSSEED)) {
        
        seeds_right_now = seeds.size();
    }
    for (const std::string& seed : seeds) {
        
        
        
        
        if (addrman.size() > 0 && seeds_right_now == 0) {
            if (!interruptNet.sleep_for(std::chrono::seconds(11))) return;
            LOCK(cs_vNodes);
            int nRelevant = 0;
            for (const CNode* pnode : vNodes) {
                nRelevant += pnode->fSuccessfullyConnected && !pnode->fFeeler && !pnode->fOneShot && !pnode->m_manual_connection && !pnode->fInbound;
            }
            if (nRelevant >= 2) {
                LogPrintf("P2P peers available. Skipped DNS seeding.\n");
                return;
            }
            seeds_right_now += DNSSEEDS_TO_QUERY_AT_ONCE;
        }