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

Protecting few deadline timers with mutex #241

Merged
merged 1 commit into from
Sep 11, 2020
Merged

Protecting few deadline timers with mutex #241

merged 1 commit into from
Sep 11, 2020

Conversation

gautvenk
Copy link
Contributor

WARNING: ThreadSanitizer: data race (pid=18054)
Read of size 1 at 0x7b1000014d90 by thread T11:
#8 opflexagent::InterfaceStatsManager::on_timer(boost::system::error_code const&) ovs/InterfaceStatsManager.cpp:105 (libopflex_agent_renderer_openvswitch.so+0x1e74e1)
#14 operator() lib/Agent.cpp:605 (libopflex_agent.so.0+0x275439)
#15 __invoke_impl<void, opflexagent::Agent::start()::<lambda()> > /usr/include/c++/9/bits/invoke.h:60 (libopflex_agent.so.0+0x275439)
#16 __invoke<opflexagent::Agent::start()::<lambda()> > /usr/include/c++/9/bits/invoke.h:95 (libopflex_agent.so.0+0x275439)
#17 _M_invoke<0> /usr/include/c++/9/thread:244 (libopflex_agent.so.0+0x275439)
#18 operator() /usr/include/c++/9/thread:251 (libopflex_agent.so.0+0x275439)
#19 _M_run /usr/include/c++/9/thread:195 (libopflex_agent.so.0+0x275439)
#20 (libstdc++.so.6+0xd086f)

Previous write of size 1 at 0x7b1000014d90 by main thread (mutexes: write M180):
#4 opflexagent::InterfaceStatsManager::stop() ovs/InterfaceStatsManager.cpp:91 (libopflex_agent_renderer_openvswitch.so+0x1e81af)
#5 opflexagent::OVSRenderer::stop() ovs/OVSRenderer.cpp:259 (libopflex_agent_renderer_openvswitch.so+0xcb92b)
#6 opflexagent::Agent::stop() lib/Agent.cpp:718 (libopflex_agent.so.0+0x273368)
#7 AgentLauncher::run() cmd/opflex_agent.cpp:128 (opflex_agent+0x3a4a7)
#8 main cmd/opflex_agent.cpp:322 (opflex_agent+0x16dc2)

Location is heap block of size 64 at 0x7b1000014d80 allocated by main thread:
#0 operator new(unsigned long) (libtsan.so.0+0x77cf2)
#1 opflexagent::InterfaceStatsManager::start() ovs/InterfaceStatsManager.cpp:73 (libopflex_agent_renderer_openvswitch.so+0x1e9646)
#2 opflexagent::OVSRenderer::start() ovs/OVSRenderer.cpp:187 (libopflex_agent_renderer_openvswitch.so+0xd5508)
#3 opflexagent::Agent::start() lib/Agent.cpp:601 (libopflex_agent.so.0+0x27937a)
#4 AgentLauncher::run() cmd/opflex_agent.cpp:120 (opflex_agent+0x3a438)
#5 main cmd/opflex_agent.cpp:322 (opflex_agent+0x16dc2)

Mutex M180 (0x7ffc4bcb7548) created at:
#0 pthread_mutex_lock (libtsan.so.0+0x41d5b)
#1 __gthread_mutex_lock /usr/include/x86_64-linux-gnu/c++/9/bits/gthr-default.h:749 (opflex_agent+0x3a3f0)
#2 std::mutex::lock() /usr/include/c++/9/bits/std_mutex.h:100 (opflex_agent+0x3a3f0)
#3 std::unique_lockstd::mutex::lock() /usr/include/c++/9/bits/unique_lock.h:141 (opflex_agent+0x3a3f0)
#4 std::unique_lockstd::mutex::unique_lock(std::mutex&) /usr/include/c++/9/bits/unique_lock.h:71 (opflex_agent+0x3a3f0)
#5 AgentLauncher::run() cmd/opflex_agent.cpp:115 (opflex_agent+0x3a3f0)
#6 main cmd/opflex_agent.cpp:322 (opflex_agent+0x16dc2)

Thread T11 (tid=18066, running) created by main thread at:
#0 pthread_create (libtsan.so.0+0x2d3be)
#1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_deletestd::thread::_State >, void (*)()) (libstdc++.so.6+0xd0b04)
#2 AgentLauncher::run() cmd/opflex_agent.cpp:120 (opflex_agent+0x3a438)
#3 main cmd/opflex_agent.cpp:322 (opflex_agent+0x16dc2)

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

WARNING: ThreadSanitizer: data race (pid=18054)
  Read of size 1 at 0x7b1000014d90 by thread T11:
    #8 opflexagent::InterfaceStatsManager::on_timer(boost::system::error_code const&) ovs/InterfaceStatsManager.cpp:105 (libopflex_agent_renderer_openvswitch.so+0x1e74e1)
    #14 operator() lib/Agent.cpp:605 (libopflex_agent.so.0+0x275439)
    #15 __invoke_impl<void, opflexagent::Agent::start()::<lambda()> > /usr/include/c++/9/bits/invoke.h:60 (libopflex_agent.so.0+0x275439)
    #16 __invoke<opflexagent::Agent::start()::<lambda()> > /usr/include/c++/9/bits/invoke.h:95 (libopflex_agent.so.0+0x275439)
    #17 _M_invoke<0> /usr/include/c++/9/thread:244 (libopflex_agent.so.0+0x275439)
    #18 operator() /usr/include/c++/9/thread:251 (libopflex_agent.so.0+0x275439)
    #19 _M_run /usr/include/c++/9/thread:195 (libopflex_agent.so.0+0x275439)
    #20 <null> <null> (libstdc++.so.6+0xd086f)

  Previous write of size 1 at 0x7b1000014d90 by main thread (mutexes: write M180):
    #4 opflexagent::InterfaceStatsManager::stop() ovs/InterfaceStatsManager.cpp:91 (libopflex_agent_renderer_openvswitch.so+0x1e81af)
    #5 opflexagent::OVSRenderer::stop() ovs/OVSRenderer.cpp:259 (libopflex_agent_renderer_openvswitch.so+0xcb92b)
    #6 opflexagent::Agent::stop() lib/Agent.cpp:718 (libopflex_agent.so.0+0x273368)
    #7 AgentLauncher::run() cmd/opflex_agent.cpp:128 (opflex_agent+0x3a4a7)
    #8 main cmd/opflex_agent.cpp:322 (opflex_agent+0x16dc2)

  Location is heap block of size 64 at 0x7b1000014d80 allocated by main thread:
    #0 operator new(unsigned long) <null> (libtsan.so.0+0x77cf2)
    #1 opflexagent::InterfaceStatsManager::start() ovs/InterfaceStatsManager.cpp:73 (libopflex_agent_renderer_openvswitch.so+0x1e9646)
    #2 opflexagent::OVSRenderer::start() ovs/OVSRenderer.cpp:187 (libopflex_agent_renderer_openvswitch.so+0xd5508)
    #3 opflexagent::Agent::start() lib/Agent.cpp:601 (libopflex_agent.so.0+0x27937a)
    #4 AgentLauncher::run() cmd/opflex_agent.cpp:120 (opflex_agent+0x3a438)
    #5 main cmd/opflex_agent.cpp:322 (opflex_agent+0x16dc2)

  Mutex M180 (0x7ffc4bcb7548) created at:
    #0 pthread_mutex_lock <null> (libtsan.so.0+0x41d5b)
    #1 __gthread_mutex_lock /usr/include/x86_64-linux-gnu/c++/9/bits/gthr-default.h:749 (opflex_agent+0x3a3f0)
    #2 std::mutex::lock() /usr/include/c++/9/bits/std_mutex.h:100 (opflex_agent+0x3a3f0)
    #3 std::unique_lock<std::mutex>::lock() /usr/include/c++/9/bits/unique_lock.h:141 (opflex_agent+0x3a3f0)
    #4 std::unique_lock<std::mutex>::unique_lock(std::mutex&) /usr/include/c++/9/bits/unique_lock.h:71 (opflex_agent+0x3a3f0)
    #5 AgentLauncher::run() cmd/opflex_agent.cpp:115 (opflex_agent+0x3a3f0)
    #6 main cmd/opflex_agent.cpp:322 (opflex_agent+0x16dc2)

  Thread T11 (tid=18066, running) created by main thread at:
    #0 pthread_create <null> (libtsan.so.0+0x2d3be)
    #1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) <null> (libstdc++.so.6+0xd0b04)
    #2 AgentLauncher::run() cmd/opflex_agent.cpp:120 (opflex_agent+0x3a438)
    #3 main cmd/opflex_agent.cpp:322 (opflex_agent+0x16dc2)

Signed-off-by: Gautam Venkataramanan <gautam.chennai@gmail.com>
@tomflynn tomflynn merged commit 8e2da26 into master Sep 11, 2020
@tomflynn tomflynn deleted the timer-protect branch September 11, 2020 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants