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.
{
    if(g_upnp_thread.joinable()) {
        g_upnp_interrupt();
    }
}
void StopMapPort()
{
    if(g_upnp_thread.joinable()) {
        g_upnp_thread.join();
        g_upnp_interrupt.reset();
    }
}
#else
void StartMapPort()
{
    
}
void InterruptMapPort()
{
    
}
void StopMapPort()
{
    
}
#endif
void CConnman::ThreadDNSAddressSeed()