-
Notifications
You must be signed in to change notification settings - Fork 11
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
approved these changes
Dec 14, 2020
gautvenk
added a commit
that referenced
this pull request
Dec 15, 2020
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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