Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protect ep_map while updating ep counters #312

Merged
merged 1 commit into from
Dec 14, 2020
Merged

Conversation

gautvenk
Copy link
Contributor

WARNING: ThreadSanitizer: data race (pid=29448)
Write of size 8 at 0x7b4400040100 by thread T16 (mutexes: write M1154):
#0 operator delete(void*) (libtsan.so.0+0x75b31)
#1 std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator > const, opflexagent::EndpointManager::EndpointState>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator > const, opflexagent::EndpointManager::EndpointState> >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::hash<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_rehash(unsigned long, unsigned long const&) (libopflex_agent.so.0+0x1b7d2f)
#2 std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator > const, opflexagent::EndpointManager::EndpointState>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator > const, opflexagent::EndpointManager::EndpointState> >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::hash<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_insert_unique_node(unsigned long, unsigned long, std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator > const, opflexagent::EndpointManager::EndpointState>, true>*, unsigned long) (libopflex_agent.so.0+0x1bd4d6)
#3 std::__detail::_Map_base<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator > const, opflexagent::EndpointManager::EndpointState>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator > const, opflexagent::EndpointManager::EndpointState> >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::hash<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true>, true>::operator[](std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) (libopflex_agent.so.0+0x1bd77f)
#4 opflexagent::EndpointManager::updateEndpoint(opflexagent::Endpoint const&) (libopflex_agent.so.0+0x1a6a48)
#5 opflexagent::EndpointSource::updateEndpoint(opflexagent::Endpoint const&) (libopflex_agent.so.0+0x1d9f2a)
#6 opflexagent::FSEndpointSource::updated(boost::filesystem::path const&) (libopflex_agent.so.0+0x1e2467)

Previous read of size 8 at 0x7b4400040100 by thread T12 (mutexes: write M402926635977816456):
#2 opflexagent::EndpointManager::updateEndpointCounters(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, opflexagent::EpCounters&) (libopflex_agent.so.0+0x19b594)
#3 opflexagent::InterfaceStatsManager::updateEndpointCounters(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, opflexagent::SwitchConnection*, opflexagent::EpCounters&) (libopflex_agent_renderer_openvswitch.so+0x1c99eb)
#4 opflexagent::InterfaceStatsManager::Handle(opflexagent::SwitchConnection*, int, ofpbuf*, ofputil_flow_removed*) (libopflex_agent_renderer_openvswitch.so+0x1c9fd5)
#5 opflexagent::SwitchConnection::receiveOFMessage() (libopflex_agent_renderer_openvswitch.so+0x1a121b)
#6 opflexagent::SwitchConnection::Monitor() (libopflex_agent_renderer_openvswitch.so+0x1a40d8)
#7 opflexagent::SwitchConnection::operator()() (libopflex_agent_renderer_openvswitch.so+0x1a5bf5)

Signed-off-by: Gautam Venkataramanan gautam.chennai@gmail.com

WARNING: ThreadSanitizer: data race (pid=29448)
  Write of size 8 at 0x7b4400040100 by thread T16 (mutexes: write M1154):
    #0 operator delete(void*) <null> (libtsan.so.0+0x75b31)
    #1 std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, opflexagent::EndpointManager::EndpointState>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, opflexagent::EndpointManager::EndpointState> >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_rehash(unsigned long, unsigned long const&) <null> (libopflex_agent.so.0+0x1b7d2f)
    #2 std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, opflexagent::EndpointManager::EndpointState>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, opflexagent::EndpointManager::EndpointState> >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_insert_unique_node(unsigned long, unsigned long, std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, opflexagent::EndpointManager::EndpointState>, true>*, unsigned long) <null> (libopflex_agent.so.0+0x1bd4d6)
    #3 std::__detail::_Map_base<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, opflexagent::EndpointManager::EndpointState>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, opflexagent::EndpointManager::EndpointState> >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true>, true>::operator[](std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) <null> (libopflex_agent.so.0+0x1bd77f)
    #4 opflexagent::EndpointManager::updateEndpoint(opflexagent::Endpoint const&) <null> (libopflex_agent.so.0+0x1a6a48)
    #5 opflexagent::EndpointSource::updateEndpoint(opflexagent::Endpoint const&) <null> (libopflex_agent.so.0+0x1d9f2a)
    #6 opflexagent::FSEndpointSource::updated(boost::filesystem::path const&) <null> (libopflex_agent.so.0+0x1e2467)

  Previous read of size 8 at 0x7b4400040100 by thread T12 (mutexes: write M402926635977816456):
    #2 opflexagent::EndpointManager::updateEndpointCounters(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, opflexagent::EpCounters&) <null> (libopflex_agent.so.0+0x19b594)
    #3 opflexagent::InterfaceStatsManager::updateEndpointCounters(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, opflexagent::SwitchConnection*, opflexagent::EpCounters&) <null> (libopflex_agent_renderer_openvswitch.so+0x1c99eb)
    #4 opflexagent::InterfaceStatsManager::Handle(opflexagent::SwitchConnection*, int, ofpbuf*, ofputil_flow_removed*) <null> (libopflex_agent_renderer_openvswitch.so+0x1c9fd5)
    #5 opflexagent::SwitchConnection::receiveOFMessage() <null> (libopflex_agent_renderer_openvswitch.so+0x1a121b)
    #6 opflexagent::SwitchConnection::Monitor() <null> (libopflex_agent_renderer_openvswitch.so+0x1a40d8)
    #7 opflexagent::SwitchConnection::operator()() <null> (libopflex_agent_renderer_openvswitch.so+0x1a5bf5)

Signed-off-by: Gautam Venkataramanan <gautam.chennai@gmail.com>
@tomflynn tomflynn merged commit 787d983 into master Dec 14, 2020
@tomflynn tomflynn deleted the tsan-epcounter branch December 14, 2020 07:23
gautvenk added a commit that referenced this pull request Dec 15, 2020
#297
#305
#310
#312

Signed-off-by: Gautam Venkataramanan <gautam.chennai@gmail.com>
ansao-aci pushed a commit to ansao-aci/opflex that referenced this pull request Feb 10, 2021
WARNING: ThreadSanitizer: data race (pid=29448)
  Write of size 8 at 0x7b4400040100 by thread T16 (mutexes: write M1154):
    #0 operator delete(void*) <null> (libtsan.so.0+0x75b31)
    noironetworks#1 std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, opflexagent::EndpointManager::EndpointState>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, opflexagent::EndpointManager::EndpointState> >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_rehash(unsigned long, unsigned long const&) <null> (libopflex_agent.so.0+0x1b7d2f)
    noironetworks#2 std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, opflexagent::EndpointManager::EndpointState>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, opflexagent::EndpointManager::EndpointState> >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_insert_unique_node(unsigned long, unsigned long, std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, opflexagent::EndpointManager::EndpointState>, true>*, unsigned long) <null> (libopflex_agent.so.0+0x1bd4d6)
    noironetworks#3 std::__detail::_Map_base<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, opflexagent::EndpointManager::EndpointState>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, opflexagent::EndpointManager::EndpointState> >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true>, true>::operator[](std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) <null> (libopflex_agent.so.0+0x1bd77f)
    noironetworks#4 opflexagent::EndpointManager::updateEndpoint(opflexagent::Endpoint const&) <null> (libopflex_agent.so.0+0x1a6a48)
    noironetworks#5 opflexagent::EndpointSource::updateEndpoint(opflexagent::Endpoint const&) <null> (libopflex_agent.so.0+0x1d9f2a)
    noironetworks#6 opflexagent::FSEndpointSource::updated(boost::filesystem::path const&) <null> (libopflex_agent.so.0+0x1e2467)

  Previous read of size 8 at 0x7b4400040100 by thread T12 (mutexes: write M402926635977816456):
    noironetworks#2 opflexagent::EndpointManager::updateEndpointCounters(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, opflexagent::EpCounters&) <null> (libopflex_agent.so.0+0x19b594)
    noironetworks#3 opflexagent::InterfaceStatsManager::updateEndpointCounters(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, opflexagent::SwitchConnection*, opflexagent::EpCounters&) <null> (libopflex_agent_renderer_openvswitch.so+0x1c99eb)
    noironetworks#4 opflexagent::InterfaceStatsManager::Handle(opflexagent::SwitchConnection*, int, ofpbuf*, ofputil_flow_removed*) <null> (libopflex_agent_renderer_openvswitch.so+0x1c9fd5)
    noironetworks#5 opflexagent::SwitchConnection::receiveOFMessage() <null> (libopflex_agent_renderer_openvswitch.so+0x1a121b)
    noironetworks#6 opflexagent::SwitchConnection::Monitor() <null> (libopflex_agent_renderer_openvswitch.so+0x1a40d8)
    noironetworks#7 opflexagent::SwitchConnection::operator()() <null> (libopflex_agent_renderer_openvswitch.so+0x1a5bf5)

Signed-off-by: Gautam Venkataramanan <gautam.chennai@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants