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

is bcc object initialization thread-safe #4500

Open
zongjiangU opened this issue Feb 28, 2023 · 4 comments
Open

is bcc object initialization thread-safe #4500

zongjiangU opened this issue Feb 28, 2023 · 4 comments
Labels

Comments

@zongjiangU
Copy link

Different errors occur when a process compiles ebpf concurrently using bcc。
e.g.

/virtual/include/bcc/helpers.h:50:10: fatal error: 'uapi/linux/bpf.h' file not found
#include <uapi/linux/bpf.h>
         ^~~~~~~~~~~~~~~~~~
In file included from /virtual/main.c:4:
include/net/sock.h:64:10: fatal error: 'linux/filter.h' file not found
#include <linux/filter.h>

Sometimes a coredump occurs.
demo.cpp

#include <string>
#include <vector>
#include <future>
#include <iostream>
#include <bcc/BPF.h>
#include <cstdint>
#include <thread>
std::string strBPFCode = R"(

#include <uapi/linux/ptrace.h>
#include <net/sock.h>
#include <bcc/proto.h>

struct ipv4_key_t {
    u32 pid;
    u16 type;
};

BPF_HASH(ipv4_map, struct ipv4_key_t,u64);

int kprobe__tcp_sendmsg(struct pt_regs *ctx, struct sock *sk,
    struct msghdr *msg, size_t size)
{

    u32 pid = bpf_get_current_pid_tgid() >> 32;

    struct ipv4_key_t ipv4_key= {};
    ipv4_key.pid = pid;
    ipv4_key.type = 1;
    ipv4_map.increment(ipv4_key, size);
    return 0;
}

int kprobe__tcp_cleanup_rbuf(struct pt_regs *ctx, struct sock *sk, int copied)
{
    u32 pid = bpf_get_current_pid_tgid() >> 32;

    u64 *val, zero =0;
    if (copied <= 0)
        return 0;
    struct ipv4_key_t ipv4_key = {};
    ipv4_key.pid = pid;
    ipv4_key.type = 2;
    ipv4_map.increment(ipv4_key, copied);
    return 0;
}
)";
struct ipv4_key_t {
    uint32_t pid;
    uint16_t type;
    size_t size;
};
void initBPF(){
    ebpf::BPF bpf;
    auto init_res = bpf.init(strBPFCode);
    if(!init_res.ok()) {
        std::cout << "init error"<<std::endl;
        return;
    }
    std::cout << "init OK" << std::endl;
    std::this_thread::sleep_for(std::chrono::seconds(1000));
    auto attach_res = bpf.attach_kprobe("tcp_sendmsg", "kprobe__tcp_sendmsg");
    if(!attach_res.ok()) {
        std::cout <<"attach_kprobe tcp_sendmsg failed" << std::endl;
        return;
    }
    attach_res = bpf.attach_kprobe("tcp_cleanup_rbuf", "kprobe__tcp_cleanup_rbuf");
    if(!attach_res.ok()) {
        std::cout <<"attach_kprobe tcp_cleanup_rbuf failed"<<std::endl;
        return;
    }
    std::cout << "init success"<<std::endl;
    while (true){
        std::this_thread::sleep_for(std::chrono::seconds(1));
        auto ipv4_map = bpf.get_hash_table<ipv4_key_t, uint64_t>("ipv4_map");
        auto table = ipv4_map.get_table_offline();
        for (auto &item : table) {
            std::cout << item.first.pid<<std::endl;
        }
    }
}
int main(){
    std::future<void> tmp1 = std::async(initBPF);
    std::future<void> tmp2 = std::async(initBPF);
   /* std::future<void> tmp3 = std::async(initBPF);
    std::future<void> tmp4 = std::async(initBPF);
    std::future<void> tmp5 = std::async(initBPF);
    std::future<void> tmp6 = std::async(initBPF);
    std::future<void> tmp7 = std::async(initBPF);
    std::future<void> tmp8 = std::async(initBPF);
    std::future<void> tmp9 = std::async(initBPF);
    std::future<void> tmp10 = std::async(initBPF);
    std::future<void> tmp11 = std::async(initBPF);*/
    pause();
}
@zongjiangU
Copy link
Author

clang -fsanitize=thread -lbcc -pthread -lstdc++ test.cpp -o test

# ./test
==================
WARNING: ThreadSanitizer: data race (pid=560713)
  Atomic read of size 1 at 0x7b0c00012d20 by thread T1:
    #0 pthread_mutex_lock <null> (tt+0x47ada8)
    #1 llvm::TrackingStatistic::RegisterStatistic() <null> (libLLVM-13.so+0xa71055)
    #2 void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) <null> (tt+0x50338a)
    #3 std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) <null> (tt+0x5032cd)
    #4 decltype(std::__invoke(_S_declval<0ul>())) std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (tt+0x503275)
    #5 std::thread::_Invoker<std::tuple<void (*)()> >::operator()() <null> (tt+0x5030e5)
    #6 std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<void (*)()> >, void>::operator()() const <null> (tt+0x502f3a)
    #7 std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<void (*)()> >, void> >::_M_invoke(std::_Any_data const&) <null> (tt+0x502cbb)
    #8 std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>::operator()() const <null> (tt+0x50295b)
    #9 std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) <null> (tt+0x502459)
    #10 void std::__invoke_impl<void, void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::__invoke_memfun_deref, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x5028bd)
    #11 std::__invoke_result<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>::type std::__invoke<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x502704)
    #12 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda'()::operator()() const <null> (tt+0x502653)
    #13 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda0'()::operator()() const <null> (tt+0x502585)
    #14 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda0'()::__invoke() <null> (tt+0x502515)
    #15 pthread_once <null> (tt+0x4a3713)
    #16 __gthread_once(int*, void (*)()) tt.cpp (tt+0x4f7a93)
    #17 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x5023c4)
    #18 std::__future_base::_State_baseV2::_M_set_result(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool) <null> (tt+0x501cbd)
    #19 std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()::operator()() const <null> (tt+0x501a76)
    #20 void std::__invoke_impl<void, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>(std::__invoke_other, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()&&) <null> (tt+0x5019bd)
    #21 std::__invoke_result<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>::type std::__invoke<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()&&) <null> (tt+0x50190d)
    #22 decltype(std::__invoke(_S_declval<0ul>())) std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (tt+0x5018b5)
    #23 std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> >::operator()() <null> (tt+0x501855)
    #24 std::thread::_State_impl<std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> > >::_M_run() <null> (tt+0x501699)
    #25 <null> <null> (libstdc++.so.6+0xc2ba2)

  Previous write of size 8 at 0x7b0c00012d20 by thread T2 (mutexes: write M7):
    #0 malloc <null> (tt+0x49be9c)
    #1 operator new(unsigned long) <null> (libstdc++.so.6+0x96d6b)
    #2 void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) <null> (tt+0x50338a)
    #3 std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) <null> (tt+0x5032cd)
    #4 decltype(std::__invoke(_S_declval<0ul>())) std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (tt+0x503275)
    #5 std::thread::_Invoker<std::tuple<void (*)()> >::operator()() <null> (tt+0x5030e5)
    #6 std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<void (*)()> >, void>::operator()() const <null> (tt+0x502f3a)
    #7 std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<void (*)()> >, void> >::_M_invoke(std::_Any_data const&) <null> (tt+0x502cbb)
    #8 std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>::operator()() const <null> (tt+0x50295b)
    #9 std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) <null> (tt+0x502459)
    #10 void std::__invoke_impl<void, void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::__invoke_memfun_deref, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x5028bd)
    #11 std::__invoke_result<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>::type std::__invoke<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x502704)
    #12 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda'()::operator()() const <null> (tt+0x502653)
    #13 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda0'()::operator()() const <null> (tt+0x502585)
    #14 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda0'()::__invoke() <null> (tt+0x502515)
    #15 pthread_once <null> (tt+0x4a3713)
    #16 __gthread_once(int*, void (*)()) tt.cpp (tt+0x4f7a93)
    #17 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x5023c4)
    #18 std::__future_base::_State_baseV2::_M_set_result(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool) <null> (tt+0x501cbd)
    #19 std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()::operator()() const <null> (tt+0x501a76)
    #20 void std::__invoke_impl<void, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>(std::__invoke_other, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()&&) <null> (tt+0x5019bd)
    #21 std::__invoke_result<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>::type std::__invoke<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()&&) <null> (tt+0x50190d)
    #22 decltype(std::__invoke(_S_declval<0ul>())) std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (tt+0x5018b5)
    #23 std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> >::operator()() <null> (tt+0x501855)
    #24 std::thread::_State_impl<std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> > >::_M_run() <null> (tt+0x501699)
    #25 <null> <null> (libstdc++.so.6+0xc2ba2)

  Location is heap block of size 48 at 0x7b0c00012d20 allocated by thread T2:
    #0 malloc <null> (tt+0x49be9c)
    #1 operator new(unsigned long) <null> (libstdc++.so.6+0x96d6b)
    #2 void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) <null> (tt+0x50338a)
    #3 std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) <null> (tt+0x5032cd)
    #4 decltype(std::__invoke(_S_declval<0ul>())) std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (tt+0x503275)
    #5 std::thread::_Invoker<std::tuple<void (*)()> >::operator()() <null> (tt+0x5030e5)
    #6 std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<void (*)()> >, void>::operator()() const <null> (tt+0x502f3a)
    #7 std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<void (*)()> >, void> >::_M_invoke(std::_Any_data const&) <null> (tt+0x502cbb)
    #8 std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>::operator()() const <null> (tt+0x50295b)
    #9 std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) <null> (tt+0x502459)
    #10 void std::__invoke_impl<void, void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::__invoke_memfun_deref, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x5028bd)
    #11 std::__invoke_result<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>::type std::__invoke<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x502704)
    #12 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda'()::operator()() const <null> (tt+0x502653)
    #13 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda0'()::operator()() const <null> (tt+0x502585)
    #14 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda0'()::__invoke() <null> (tt+0x502515)
    #15 pthread_once <null> (tt+0x4a3713)
    #16 __gthread_once(int*, void (*)()) tt.cpp (tt+0x4f7a93)
    #17 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x5023c4)
    #18 std::__future_base::_State_baseV2::_M_set_result(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool) <null> (tt+0x501cbd)
    #19 std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()::operator()() const <null> (tt+0x501a76)
    #20 void std::__invoke_impl<void, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>(std::__invoke_other, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()&&) <null> (tt+0x5019bd)
    #21 std::__invoke_result<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>::type std::__invoke<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()&&) <null> (tt+0x50190d)
    #22 decltype(std::__invoke(_S_declval<0ul>())) std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (tt+0x5018b5)
    #23 std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> >::operator()() <null> (tt+0x501855)
    #24 std::thread::_State_impl<std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> > >::_M_run() <null> (tt+0x501699)
    #25 <null> <null> (libstdc++.so.6+0xc2ba2)

  Mutex M7 (0x7f46ceae8580) created at:
    #0 pthread_mutex_lock <null> (tt+0x47ada8)
    #1 llvm::ManagedStaticBase::RegisterManagedStatic(void* (*)(), void (*)(void*)) const <null> (libLLVM-13.so+0xa54687)

  Thread T1 (tid=560715, running) created by main thread at:
    #0 pthread_create <null> (tt+0x471f07)
    #1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) <null> (libstdc++.so.6+0xc2e88)
    #2 std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ffd91)
    #3 void __gnu_cxx::new_allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >::construct<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::thread::_Invoker<std::tuple<void (*)()> > >(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>*, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ffc91)
    #4 void std::allocator_traits<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >::construct<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::thread::_Invoker<std::tuple<void (*)()> > >(std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >&, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>*, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ff8dd)
    #5 std::_Sp_counted_ptr_inplace<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<std::thread::_Invoker<std::tuple<void (*)()> > >(std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ff3e7)
    #6 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>*&, std::_Sp_alloc_shared_tag<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ff0c8)
    #7 std::__shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::_Sp_alloc_shared_tag<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fefb3)
    #8 std::shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >::shared_ptr<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::_Sp_alloc_shared_tag<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fef07)
    #9 std::shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > std::allocate_shared<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > const&, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fede9)
    #10 std::shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > std::make_shared<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::thread::_Invoker<std::tuple<void (*)()> > >(std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fec92)
    #11 std::shared_ptr<std::__future_base::_State_baseV2> std::__future_base::_S_make_async_state<std::thread::_Invoker<std::tuple<void (*)()> > >(std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fe881)
    #12 std::future<std::result_of<std::decay<void (&)()>::type ()>::type> std::async<void (&)()>(std::launch, void (&)()) <null> (tt+0x4fe5d4)
    #13 std::future<std::result_of<std::decay<void (&)()>::type ()>::type> std::async<void (&)()>(void (&)()) <null> (tt+0x4f8b36)
    #14 main <null> (tt+0x4f783e)

  Thread T2 (tid=560716, running) created by main thread at:
    #0 pthread_create <null> (tt+0x471f07)
    #1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) <null> (libstdc++.so.6+0xc2e88)
    #2 std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ffd91)
    #3 void __gnu_cxx::new_allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >::construct<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::thread::_Invoker<std::tuple<void (*)()> > >(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>*, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ffc91)
    #4 void std::allocator_traits<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >::construct<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::thread::_Invoker<std::tuple<void (*)()> > >(std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >&, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>*, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ff8dd)
    #5 std::_Sp_counted_ptr_inplace<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<std::thread::_Invoker<std::tuple<void (*)()> > >(std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ff3e7)
    #6 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>*&, std::_Sp_alloc_shared_tag<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ff0c8)
    #7 std::__shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::_Sp_alloc_shared_tag<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fefb3)
    #8 std::shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >::shared_ptr<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::_Sp_alloc_shared_tag<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fef07)
    #9 std::shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > std::allocate_shared<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > const&, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fede9)
    #10 std::shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > std::make_shared<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::thread::_Invoker<std::tuple<void (*)()> > >(std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fec92)
    #11 std::shared_ptr<std::__future_base::_State_baseV2> std::__future_base::_S_make_async_state<std::thread::_Invoker<std::tuple<void (*)()> > >(std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fe881)
    #12 std::future<std::result_of<std::decay<void (&)()>::type ()>::type> std::async<void (&)()>(std::launch, void (&)()) <null> (tt+0x4fe5d4)
    #13 std::future<std::result_of<std::decay<void (&)()>::type ()>::type> std::async<void (&)()>(void (&)()) <null> (tt+0x4f8b36)
    #14 main <null> (tt+0x4f7851)

SUMMARY: ThreadSanitizer: data race (/home/youzongjiang/gerrit/DBdoctor/dra-agent/src/test/tt+0x47ada8) in __interceptor_pthread_mutex_lock
==================
==================
WARNING: ThreadSanitizer: data race (pid=560713)
  Read of size 8 at 0x7b08000088a0 by thread T1:
    #0 memcmp <null> (tt+0x4aa462)
    #1 std::_Rb_tree<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, ebpf::TableDesc>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, ebpf::TableDesc> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, ebpf::TableDesc> > >::find(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) <null> (libbcc.so.0+0x1118d7)
    #2 void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) <null> (tt+0x50338a)
    #3 std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) <null> (tt+0x5032cd)
    #4 decltype(std::__invoke(_S_declval<0ul>())) std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (tt+0x503275)
    #5 std::thread::_Invoker<std::tuple<void (*)()> >::operator()() <null> (tt+0x5030e5)
    #6 std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<void (*)()> >, void>::operator()() const <null> (tt+0x502f3a)
    #7 std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<void (*)()> >, void> >::_M_invoke(std::_Any_data const&) <null> (tt+0x502cbb)
    #8 std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>::operator()() const <null> (tt+0x50295b)
    #9 std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) <null> (tt+0x502459)
    #10 void std::__invoke_impl<void, void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::__invoke_memfun_deref, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x5028bd)
    #11 std::__invoke_result<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>::type std::__invoke<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x502704)
    #12 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda'()::operator()() const <null> (tt+0x502653)
    #13 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda0'()::operator()() const <null> (tt+0x502585)
    #14 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda0'()::__invoke() <null> (tt+0x502515)
    #15 pthread_once <null> (tt+0x4a3713)
    #16 __gthread_once(int*, void (*)()) tt.cpp (tt+0x4f7a93)
    #17 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x5023c4)
    #18 std::__future_base::_State_baseV2::_M_set_result(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool) <null> (tt+0x501cbd)
    #19 std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()::operator()() const <null> (tt+0x501a76)
    #20 void std::__invoke_impl<void, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>(std::__invoke_other, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()&&) <null> (tt+0x5019bd)
    #21 std::__invoke_result<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>::type std::__invoke<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()&&) <null> (tt+0x50190d)
    #22 decltype(std::__invoke(_S_declval<0ul>())) std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (tt+0x5018b5)
    #23 std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> >::operator()() <null> (tt+0x501855)
    #24 std::thread::_State_impl<std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> > >::_M_run() <null> (tt+0x501699)
    #25 <null> <null> (libstdc++.so.6+0xc2ba2)

  Previous write of size 8 at 0x7b08000088a0 by thread T2:
    #0 malloc <null> (tt+0x49be9c)
    #1 operator new(unsigned long) <null> (libstdc++.so.6+0x96d6b)
    #2 void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) <null> (tt+0x50338a)
    #3 std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) <null> (tt+0x5032cd)
    #4 decltype(std::__invoke(_S_declval<0ul>())) std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (tt+0x503275)
    #5 std::thread::_Invoker<std::tuple<void (*)()> >::operator()() <null> (tt+0x5030e5)
    #6 std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<void (*)()> >, void>::operator()() const <null> (tt+0x502f3a)
    #7 std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<void (*)()> >, void> >::_M_invoke(std::_Any_data const&) <null> (tt+0x502cbb)
    #8 std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>::operator()() const <null> (tt+0x50295b)
    #9 std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) <null> (tt+0x502459)
    #10 void std::__invoke_impl<void, void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::__invoke_memfun_deref, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x5028bd)
    #11 std::__invoke_result<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>::type std::__invoke<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x502704)
    #12 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda'()::operator()() const <null> (tt+0x502653)
    #13 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda0'()::operator()() const <null> (tt+0x502585)
    #14 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda0'()::__invoke() <null> (tt+0x502515)
    #15 pthread_once <null> (tt+0x4a3713)
    #16 __gthread_once(int*, void (*)()) tt.cpp (tt+0x4f7a93)
    #17 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x5023c4)
    #18 std::__future_base::_State_baseV2::_M_set_result(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool) <null> (tt+0x501cbd)
    #19 std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()::operator()() const <null> (tt+0x501a76)
    #20 void std::__invoke_impl<void, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>(std::__invoke_other, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()&&) <null> (tt+0x5019bd)
    #21 std::__invoke_result<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>::type std::__invoke<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()&&) <null> (tt+0x50190d)
    #22 decltype(std::__invoke(_S_declval<0ul>())) std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (tt+0x5018b5)
    #23 std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> >::operator()() <null> (tt+0x501855)
    #24 std::thread::_State_impl<std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> > >::_M_run() <null> (tt+0x501699)
    #25 <null> <null> (libstdc++.so.6+0xc2ba2)

  Location is heap block of size 26 at 0x7b08000088a0 allocated by thread T2:
    #0 malloc <null> (tt+0x49be9c)
    #1 operator new(unsigned long) <null> (libstdc++.so.6+0x96d6b)
    #2 void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) <null> (tt+0x50338a)
    #3 std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) <null> (tt+0x5032cd)
    #4 decltype(std::__invoke(_S_declval<0ul>())) std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (tt+0x503275)
    #5 std::thread::_Invoker<std::tuple<void (*)()> >::operator()() <null> (tt+0x5030e5)
    #6 std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<void (*)()> >, void>::operator()() const <null> (tt+0x502f3a)
    #7 std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<void (*)()> >, void> >::_M_invoke(std::_Any_data const&) <null> (tt+0x502cbb)
    #8 std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>::operator()() const <null> (tt+0x50295b)
    #9 std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) <null> (tt+0x502459)
    #10 void std::__invoke_impl<void, void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::__invoke_memfun_deref, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x5028bd)
    #11 std::__invoke_result<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>::type std::__invoke<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x502704)
    #12 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda'()::operator()() const <null> (tt+0x502653)
    #13 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda0'()::operator()() const <null> (tt+0x502585)
    #14 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda0'()::__invoke() <null> (tt+0x502515)
    #15 pthread_once <null> (tt+0x4a3713)
    #16 __gthread_once(int*, void (*)()) tt.cpp (tt+0x4f7a93)
    #17 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x5023c4)
    #18 std::__future_base::_State_baseV2::_M_set_result(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool) <null> (tt+0x501cbd)
    #19 std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()::operator()() const <null> (tt+0x501a76)
    #20 void std::__invoke_impl<void, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>(std::__invoke_other, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()&&) <null> (tt+0x5019bd)
    #21 std::__invoke_result<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>::type std::__invoke<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()&&) <null> (tt+0x50190d)
    #22 decltype(std::__invoke(_S_declval<0ul>())) std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (tt+0x5018b5)
    #23 std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> >::operator()() <null> (tt+0x501855)
    #24 std::thread::_State_impl<std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> > >::_M_run() <null> (tt+0x501699)
    #25 <null> <null> (libstdc++.so.6+0xc2ba2)

  Thread T1 (tid=560715, running) created by main thread at:
    #0 pthread_create <null> (tt+0x471f07)
    #1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) <null> (libstdc++.so.6+0xc2e88)
    #2 std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ffd91)
    #3 void __gnu_cxx::new_allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >::construct<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::thread::_Invoker<std::tuple<void (*)()> > >(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>*, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ffc91)
    #4 void std::allocator_traits<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >::construct<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::thread::_Invoker<std::tuple<void (*)()> > >(std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >&, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>*, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ff8dd)
    #5 std::_Sp_counted_ptr_inplace<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<std::thread::_Invoker<std::tuple<void (*)()> > >(std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ff3e7)
    #6 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>*&, std::_Sp_alloc_shared_tag<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ff0c8)
    #7 std::__shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::_Sp_alloc_shared_tag<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fefb3)
    #8 std::shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >::shared_ptr<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::_Sp_alloc_shared_tag<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fef07)
    #9 std::shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > std::allocate_shared<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > const&, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fede9)
    #10 std::shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > std::make_shared<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::thread::_Invoker<std::tuple<void (*)()> > >(std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fec92)
    #11 std::shared_ptr<std::__future_base::_State_baseV2> std::__future_base::_S_make_async_state<std::thread::_Invoker<std::tuple<void (*)()> > >(std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fe881)
    #12 std::future<std::result_of<std::decay<void (&)()>::type ()>::type> std::async<void (&)()>(std::launch, void (&)()) <null> (tt+0x4fe5d4)
    #13 std::future<std::result_of<std::decay<void (&)()>::type ()>::type> std::async<void (&)()>(void (&)()) <null> (tt+0x4f8b36)
    #14 main <null> (tt+0x4f783e)

  Thread T2 (tid=560716, running) created by main thread at:
    #0 pthread_create <null> (tt+0x471f07)
    #1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) <null> (libstdc++.so.6+0xc2e88)
    #2 std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ffd91)
    #3 void __gnu_cxx::new_allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >::construct<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::thread::_Invoker<std::tuple<void (*)()> > >(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>*, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ffc91)
    #4 void std::allocator_traits<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >::construct<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::thread::_Invoker<std::tuple<void (*)()> > >(std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >&, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>*, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ff8dd)
    #5 std::_Sp_counted_ptr_inplace<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<std::thread::_Invoker<std::tuple<void (*)()> > >(std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ff3e7)
    #6 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>*&, std::_Sp_alloc_shared_tag<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ff0c8)
    #7 std::__shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::_Sp_alloc_shared_tag<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fefb3)
    #8 std::shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >::shared_ptr<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::_Sp_alloc_shared_tag<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fef07)
    #9 std::shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > std::allocate_shared<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > const&, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fede9)
    #10 std::shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > std::make_shared<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::thread::_Invoker<std::tuple<void (*)()> > >(std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fec92)
    #11 std::shared_ptr<std::__future_base::_State_baseV2> std::__future_base::_S_make_async_state<std::thread::_Invoker<std::tuple<void (*)()> > >(std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fe881)
    #12 std::future<std::result_of<std::decay<void (&)()>::type ()>::type> std::async<void (&)()>(std::launch, void (&)()) <null> (tt+0x4fe5d4)
    #13 std::future<std::result_of<std::decay<void (&)()>::type ()>::type> std::async<void (&)()>(void (&)()) <null> (tt+0x4f8b36)
    #14 main <null> (tt+0x4f7851)

SUMMARY: ThreadSanitizer: data race (/home/youzongjiang/gerrit/DBdoctor/dra-agent/src/test/tt+0x4aa462) in __interceptor_memcmp
==================
==================
WARNING: ThreadSanitizer: data race (pid=560713)
  Read of size 8 at 0x7b08000088a8 by thread T1:
    #0 memcmp <null> (tt+0x4aa462)
    #1 std::_Rb_tree<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, ebpf::TableDesc>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, ebpf::TableDesc> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, ebpf::TableDesc> > >::find(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) <null> (libbcc.so.0+0x1118d7)
    #2 void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) <null> (tt+0x50338a)
    #3 std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) <null> (tt+0x5032cd)
    #4 decltype(std::__invoke(_S_declval<0ul>())) std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (tt+0x503275)
    #5 std::thread::_Invoker<std::tuple<void (*)()> >::operator()() <null> (tt+0x5030e5)
    #6 std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<void (*)()> >, void>::operator()() const <null> (tt+0x502f3a)
    #7 std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<void (*)()> >, void> >::_M_invoke(std::_Any_data const&) <null> (tt+0x502cbb)
    #8 std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>::operator()() const <null> (tt+0x50295b)
    #9 std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) <null> (tt+0x502459)
    #10 void std::__invoke_impl<void, void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::__invoke_memfun_deref, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x5028bd)
    #11 std::__invoke_result<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>::type std::__invoke<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x502704)
    #12 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda'()::operator()() const <null> (tt+0x502653)
    #13 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda0'()::operator()() const <null> (tt+0x502585)
    #14 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda0'()::__invoke() <null> (tt+0x502515)
    #15 pthread_once <null> (tt+0x4a3713)
    #16 __gthread_once(int*, void (*)()) tt.cpp (tt+0x4f7a93)
    #17 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x5023c4)
    #18 std::__future_base::_State_baseV2::_M_set_result(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool) <null> (tt+0x501cbd)
    #19 std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()::operator()() const <null> (tt+0x501a76)
    #20 void std::__invoke_impl<void, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>(std::__invoke_other, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()&&) <null> (tt+0x5019bd)
    #21 std::__invoke_result<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>::type std::__invoke<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()&&) <null> (tt+0x50190d)
    #22 decltype(std::__invoke(_S_declval<0ul>())) std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (tt+0x5018b5)
    #23 std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> >::operator()() <null> (tt+0x501855)
    #24 std::thread::_State_impl<std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> > >::_M_run() <null> (tt+0x501699)
    #25 <null> <null> (libstdc++.so.6+0xc2ba2)

  Previous write of size 8 at 0x7b08000088a8 by thread T2:
    [failed to restore the stack]

  Location is heap block of size 26 at 0x7b08000088a0 allocated by thread T2:
    #0 malloc <null> (tt+0x49be9c)
    #1 operator new(unsigned long) <null> (libstdc++.so.6+0x96d6b)
    #2 void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) <null> (tt+0x50338a)
    #3 std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) <null> (tt+0x5032cd)
    #4 decltype(std::__invoke(_S_declval<0ul>())) std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (tt+0x503275)
    #5 std::thread::_Invoker<std::tuple<void (*)()> >::operator()() <null> (tt+0x5030e5)
    #6 std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<void (*)()> >, void>::operator()() const <null> (tt+0x502f3a)
    #7 std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<void (*)()> >, void> >::_M_invoke(std::_Any_data const&) <null> (tt+0x502cbb)
    #8 std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>::operator()() const <null> (tt+0x50295b)
    #9 std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) <null> (tt+0x502459)
    #10 void std::__invoke_impl<void, void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::__invoke_memfun_deref, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x5028bd)
    #11 std::__invoke_result<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>::type std::__invoke<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x502704)
    #12 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda'()::operator()() const <null> (tt+0x502653)
    #13 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda0'()::operator()() const <null> (tt+0x502585)
    #14 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda0'()::__invoke() <null> (tt+0x502515)
    #15 pthread_once <null> (tt+0x4a3713)
    #16 __gthread_once(int*, void (*)()) tt.cpp (tt+0x4f7a93)
    #17 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x5023c4)
    #18 std::__future_base::_State_baseV2::_M_set_result(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool) <null> (tt+0x501cbd)
    #19 std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()::operator()() const <null> (tt+0x501a76)
    #20 void std::__invoke_impl<void, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>(std::__invoke_other, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()&&) <null> (tt+0x5019bd)
    #21 std::__invoke_result<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>::type std::__invoke<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()&&) <null> (tt+0x50190d)
    #22 decltype(std::__invoke(_S_declval<0ul>())) std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (tt+0x5018b5)
    #23 std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> >::operator()() <null> (tt+0x501855)
    #24 std::thread::_State_impl<std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> > >::_M_run() <null> (tt+0x501699)
    #25 <null> <null> (libstdc++.so.6+0xc2ba2)

  Thread T1 (tid=560715, running) created by main thread at:
    #0 pthread_create <null> (tt+0x471f07)
    #1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) <null> (libstdc++.so.6+0xc2e88)
    #2 std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ffd91)
    #3 void __gnu_cxx::new_allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >::construct<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::thread::_Invoker<std::tuple<void (*)()> > >(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>*, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ffc91)
    #4 void std::allocator_traits<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >::construct<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::thread::_Invoker<std::tuple<void (*)()> > >(std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >&, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>*, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ff8dd)
    #5 std::_Sp_counted_ptr_inplace<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<std::thread::_Invoker<std::tuple<void (*)()> > >(std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ff3e7)
    #6 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>*&, std::_Sp_alloc_shared_tag<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ff0c8)
    #7 std::__shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::_Sp_alloc_shared_tag<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fefb3)
    #8 std::shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >::shared_ptr<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::_Sp_alloc_shared_tag<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fef07)
    #9 std::shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > std::allocate_shared<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > const&, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fede9)
    #10 std::shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > std::make_shared<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::thread::_Invoker<std::tuple<void (*)()> > >(std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fec92)
    #11 std::shared_ptr<std::__future_base::_State_baseV2> std::__future_base::_S_make_async_state<std::thread::_Invoker<std::tuple<void (*)()> > >(std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fe881)
    #12 std::future<std::result_of<std::decay<void (&)()>::type ()>::type> std::async<void (&)()>(std::launch, void (&)()) <null> (tt+0x4fe5d4)
    #13 std::future<std::result_of<std::decay<void (&)()>::type ()>::type> std::async<void (&)()>(void (&)()) <null> (tt+0x4f8b36)
    #14 main <null> (tt+0x4f783e)

  Thread T2 (tid=560716, running) created by main thread at:
    #0 pthread_create <null> (tt+0x471f07)
    #1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) <null> (libstdc++.so.6+0xc2e88)
    #2 std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ffd91)
    #3 void __gnu_cxx::new_allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >::construct<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::thread::_Invoker<std::tuple<void (*)()> > >(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>*, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ffc91)
    #4 void std::allocator_traits<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >::construct<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::thread::_Invoker<std::tuple<void (*)()> > >(std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >&, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>*, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ff8dd)
    #5 std::_Sp_counted_ptr_inplace<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<std::thread::_Invoker<std::tuple<void (*)()> > >(std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ff3e7)
    #6 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>*&, std::_Sp_alloc_shared_tag<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ff0c8)
    #7 std::__shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::_Sp_alloc_shared_tag<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fefb3)
    #8 std::shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >::shared_ptr<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::_Sp_alloc_shared_tag<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fef07)
    #9 std::shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > std::allocate_shared<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > const&, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fede9)
    #10 std::shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > std::make_shared<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::thread::_Invoker<std::tuple<void (*)()> > >(std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fec92)
    #11 std::shared_ptr<std::__future_base::_State_baseV2> std::__future_base::_S_make_async_state<std::thread::_Invoker<std::tuple<void (*)()> > >(std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fe881)
    #12 std::future<std::result_of<std::decay<void (&)()>::type ()>::type> std::async<void (&)()>(std::launch, void (&)()) <null> (tt+0x4fe5d4)
    #13 std::future<std::result_of<std::decay<void (&)()>::type ()>::type> std::async<void (&)()>(void (&)()) <null> (tt+0x4f8b36)
    #14 main <null> (tt+0x4f7851)

SUMMARY: ThreadSanitizer: data race (/home/youzongjiang/gerrit/DBdoctor/dra-agent/src/test/tt+0x4aa462) in __interceptor_memcmp
==================
==================
WARNING: ThreadSanitizer: data race (pid=560713)
  Write of size 8 at 0x7b18000086f0 by thread T1:
    #0 memset <null> (tt+0x4a39f7)
    #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, unsigned long>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, unsigned long> >, 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> >::clear() <null> (libbcc.so.0+0x1345b4)
    #2 void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) <null> (tt+0x50338a)
    #3 std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) <null> (tt+0x5032cd)
    #4 decltype(std::__invoke(_S_declval<0ul>())) std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (tt+0x503275)
    #5 std::thread::_Invoker<std::tuple<void (*)()> >::operator()() <null> (tt+0x5030e5)
    #6 std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<void (*)()> >, void>::operator()() const <null> (tt+0x502f3a)
    #7 std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<void (*)()> >, void> >::_M_invoke(std::_Any_data const&) <null> (tt+0x502cbb)
    #8 std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>::operator()() const <null> (tt+0x50295b)
    #9 std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) <null> (tt+0x502459)
    #10 void std::__invoke_impl<void, void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::__invoke_memfun_deref, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x5028bd)
    #11 std::__invoke_result<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>::type std::__invoke<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x502704)
    #12 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda'()::operator()() const <null> (tt+0x502653)
    #13 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda0'()::operator()() const <null> (tt+0x502585)
    #14 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda0'()::__invoke() <null> (tt+0x502515)
    #15 pthread_once <null> (tt+0x4a3713)
    #16 __gthread_once(int*, void (*)()) tt.cpp (tt+0x4f7a93)
    #17 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x5023c4)
    #18 std::__future_base::_State_baseV2::_M_set_result(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool) <null> (tt+0x501cbd)
    #19 std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()::operator()() const <null> (tt+0x501a76)
    #20 void std::__invoke_impl<void, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>(std::__invoke_other, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()&&) <null> (tt+0x5019bd)
    #21 std::__invoke_result<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>::type std::__invoke<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()&&) <null> (tt+0x50190d)
    #22 decltype(std::__invoke(_S_declval<0ul>())) std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (tt+0x5018b5)
    #23 std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> >::operator()() <null> (tt+0x501855)
    #24 std::thread::_State_impl<std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> > >::_M_run() <null> (tt+0x501699)
    #25 <null> <null> (libstdc++.so.6+0xc2ba2)

  Previous write of size 8 at 0x7b18000086f0 by thread T2:
    [failed to restore the stack]

  Location is heap block of size 88 at 0x7b18000086a0 allocated by thread T2:
    #0 malloc <null> (tt+0x49be9c)
    #1 operator new(unsigned long) <null> (libstdc++.so.6+0x96d6b)
    #2 void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) <null> (tt+0x50338a)
    #3 std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) <null> (tt+0x5032cd)
    #4 decltype(std::__invoke(_S_declval<0ul>())) std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (tt+0x503275)
    #5 std::thread::_Invoker<std::tuple<void (*)()> >::operator()() <null> (tt+0x5030e5)
    #6 std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<void (*)()> >, void>::operator()() const <null> (tt+0x502f3a)
    #7 std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<void (*)()> >, void> >::_M_invoke(std::_Any_data const&) <null> (tt+0x502cbb)
    #8 std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>::operator()() const <null> (tt+0x50295b)
    #9 std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) <null> (tt+0x502459)
    #10 void std::__invoke_impl<void, void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::__invoke_memfun_deref, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x5028bd)
    #11 std::__invoke_result<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>::type std::__invoke<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x502704)
    #12 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda'()::operator()() const <null> (tt+0x502653)
    #13 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda0'()::operator()() const <null> (tt+0x502585)
    #14 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda0'()::__invoke() <null> (tt+0x502515)
    #15 pthread_once <null> (tt+0x4a3713)
    #16 __gthread_once(int*, void (*)()) tt.cpp (tt+0x4f7a93)
    #17 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x5023c4)
    #18 std::__future_base::_State_baseV2::_M_set_result(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool) <null> (tt+0x501cbd)
    #19 std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()::operator()() const <null> (tt+0x501a76)
    #20 void std::__invoke_impl<void, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>(std::__invoke_other, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()&&) <null> (tt+0x5019bd)
    #21 std::__invoke_result<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>::type std::__invoke<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()&&) <null> (tt+0x50190d)
    #22 decltype(std::__invoke(_S_declval<0ul>())) std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (tt+0x5018b5)
    #23 std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> >::operator()() <null> (tt+0x501855)
    #24 std::thread::_State_impl<std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> > >::_M_run() <null> (tt+0x501699)
    #25 <null> <null> (libstdc++.so.6+0xc2ba2)

  Thread T1 (tid=560715, running) created by main thread at:
    #0 pthread_create <null> (tt+0x471f07)
    #1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) <null> (libstdc++.so.6+0xc2e88)
    #2 std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ffd91)
    #3 void __gnu_cxx::new_allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >::construct<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::thread::_Invoker<std::tuple<void (*)()> > >(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>*, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ffc91)
    #4 void std::allocator_traits<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >::construct<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::thread::_Invoker<std::tuple<void (*)()> > >(std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >&, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>*, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ff8dd)
    #5 std::_Sp_counted_ptr_inplace<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<std::thread::_Invoker<std::tuple<void (*)()> > >(std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ff3e7)
    #6 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>*&, std::_Sp_alloc_shared_tag<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ff0c8)
    #7 std::__shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::_Sp_alloc_shared_tag<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fefb3)
    #8 std::shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >::shared_ptr<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::_Sp_alloc_shared_tag<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fef07)
    #9 std::shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > std::allocate_shared<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > const&, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fede9)
    #10 std::shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > std::make_shared<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::thread::_Invoker<std::tuple<void (*)()> > >(std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fec92)
    #11 std::shared_ptr<std::__future_base::_State_baseV2> std::__future_base::_S_make_async_state<std::thread::_Invoker<std::tuple<void (*)()> > >(std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fe881)
    #12 std::future<std::result_of<std::decay<void (&)()>::type ()>::type> std::async<void (&)()>(std::launch, void (&)()) <null> (tt+0x4fe5d4)
    #13 std::future<std::result_of<std::decay<void (&)()>::type ()>::type> std::async<void (&)()>(void (&)()) <null> (tt+0x4f8b36)
    #14 main <null> (tt+0x4f783e)

  Thread T2 (tid=560716, running) created by main thread at:
    #0 pthread_create <null> (tt+0x471f07)
    #1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) <null> (libstdc++.so.6+0xc2e88)
    #2 std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ffd91)
    #3 void __gnu_cxx::new_allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >::construct<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::thread::_Invoker<std::tuple<void (*)()> > >(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>*, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ffc91)
    #4 void std::allocator_traits<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >::construct<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::thread::_Invoker<std::tuple<void (*)()> > >(std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >&, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>*, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ff8dd)
    #5 std::_Sp_counted_ptr_inplace<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<std::thread::_Invoker<std::tuple<void (*)()> > >(std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ff3e7)
    #6 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>*&, std::_Sp_alloc_shared_tag<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ff0c8)
    #7 std::__shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::_Sp_alloc_shared_tag<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fefb3)
    #8 std::shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >::shared_ptr<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::_Sp_alloc_shared_tag<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fef07)
    #9 std::shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > std::allocate_shared<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > const&, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fede9)
    #10 std::shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > std::make_shared<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::thread::_Invoker<std::tuple<void (*)()> > >(std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fec92)
    #11 std::shared_ptr<std::__future_base::_State_baseV2> std::__future_base::_S_make_async_state<std::thread::_Invoker<std::tuple<void (*)()> > >(std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fe881)
    #12 std::future<std::result_of<std::decay<void (&)()>::type ()>::type> std::async<void (&)()>(std::launch, void (&)()) <null> (tt+0x4fe5d4)
    #13 std::future<std::result_of<std::decay<void (&)()>::type ()>::type> std::async<void (&)()>(void (&)()) <null> (tt+0x4f8b36)
    #14 main <null> (tt+0x4f7851)

SUMMARY: ThreadSanitizer: data race (/home/youzongjiang/gerrit/DBdoctor/dra-agent/src/test/tt+0x4a39f7) in __interceptor_memset
==================
==================
WARNING: ThreadSanitizer: data race (pid=560713)
  Read of size 8 at 0x7f46c255d010 by thread T1:
    #0 memcpy <null> (tt+0x4a3d83)
    #1 void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*>(char*, char*, std::forward_iterator_tag) <null> (libbcc.so.0+0xfe863)
    #2 void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) <null> (tt+0x50338a)
    #3 std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) <null> (tt+0x5032cd)
    #4 decltype(std::__invoke(_S_declval<0ul>())) std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (tt+0x503275)
    #5 std::thread::_Invoker<std::tuple<void (*)()> >::operator()() <null> (tt+0x5030e5)
    #6 std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<void (*)()> >, void>::operator()() const <null> (tt+0x502f3a)
    #7 std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<void (*)()> >, void> >::_M_invoke(std::_Any_data const&) <null> (tt+0x502cbb)
    #8 std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>::operator()() const <null> (tt+0x50295b)
    #9 std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) <null> (tt+0x502459)
    #10 void std::__invoke_impl<void, void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::__invoke_memfun_deref, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x5028bd)
    #11 std::__invoke_result<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>::type std::__invoke<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x502704)
    #12 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda'()::operator()() const <null> (tt+0x502653)
    #13 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda0'()::operator()() const <null> (tt+0x502585)
    #14 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda0'()::__invoke() <null> (tt+0x502515)
    #15 pthread_once <null> (tt+0x4a3713)
    #16 __gthread_once(int*, void (*)()) tt.cpp (tt+0x4f7a93)
    #17 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x5023c4)
    #18 std::__future_base::_State_baseV2::_M_set_result(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool) <null> (tt+0x501cbd)
    #19 std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()::operator()() const <null> (tt+0x501a76)
    #20 void std::__invoke_impl<void, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>(std::__invoke_other, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()&&) <null> (tt+0x5019bd)
    #21 std::__invoke_result<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>::type std::__invoke<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()&&) <null> (tt+0x50190d)
    #22 decltype(std::__invoke(_S_declval<0ul>())) std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (tt+0x5018b5)
    #23 std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> >::operator()() <null> (tt+0x501855)
    #24 std::thread::_State_impl<std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> > >::_M_run() <null> (tt+0x501699)
    #25 <null> <null> (libstdc++.so.6+0xc2ba2)

  Previous write of size 8 at 0x7f46c255d010 by thread T2:
    #0 malloc <null> (tt+0x49be9c)
    #1 operator new(unsigned long) <null> (libstdc++.so.6+0x96d6b)
    #2 void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) <null> (tt+0x50338a)
    #3 std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) <null> (tt+0x5032cd)
    #4 decltype(std::__invoke(_S_declval<0ul>())) std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (tt+0x503275)
    #5 std::thread::_Invoker<std::tuple<void (*)()> >::operator()() <null> (tt+0x5030e5)
    #6 std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<void (*)()> >, void>::operator()() const <null> (tt+0x502f3a)
    #7 std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<void (*)()> >, void> >::_M_invoke(std::_Any_data const&) <null> (tt+0x502cbb)
    #8 std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>::operator()() const <null> (tt+0x50295b)
    #9 std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) <null> (tt+0x502459)
    #10 void std::__invoke_impl<void, void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::__invoke_memfun_deref, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x5028bd)
    #11 std::__invoke_result<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>::type std::__invoke<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x502704)
    #12 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda'()::operator()() const <null> (tt+0x502653)
    #13 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda0'()::operator()() const <null> (tt+0x502585)
    #14 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda0'()::__invoke() <null> (tt+0x502515)
    #15 pthread_once <null> (tt+0x4a3713)
    #16 __gthread_once(int*, void (*)()) tt.cpp (tt+0x4f7a93)
    #17 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x5023c4)
    #18 std::__future_base::_State_baseV2::_M_set_result(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool) <null> (tt+0x501cbd)
    #19 std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()::operator()() const <null> (tt+0x501a76)
    #20 void std::__invoke_impl<void, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>(std::__invoke_other, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()&&) <null> (tt+0x5019bd)
    #21 std::__invoke_result<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>::type std::__invoke<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()&&) <null> (tt+0x50190d)
    #22 decltype(std::__invoke(_S_declval<0ul>())) std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (tt+0x5018b5)
    #23 std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> >::operator()() <null> (tt+0x501855)
    #24 std::thread::_State_impl<std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> > >::_M_run() <null> (tt+0x501699)
    #25 <null> <null> (libstdc++.so.6+0xc2ba2)

  Location is heap block of size 1179648 at 0x7f46c255d000 allocated by thread T2:
    #0 malloc <null> (tt+0x49be9c)
    #1 operator new(unsigned long) <null> (libstdc++.so.6+0x96d6b)
    #2 void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) <null> (tt+0x50338a)
    #3 std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) <null> (tt+0x5032cd)
    #4 decltype(std::__invoke(_S_declval<0ul>())) std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (tt+0x503275)
    #5 std::thread::_Invoker<std::tuple<void (*)()> >::operator()() <null> (tt+0x5030e5)
    #6 std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<void (*)()> >, void>::operator()() const <null> (tt+0x502f3a)
    #7 std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<void (*)()> >, void> >::_M_invoke(std::_Any_data const&) <null> (tt+0x502cbb)
    #8 std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>::operator()() const <null> (tt+0x50295b)
    #9 std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) <null> (tt+0x502459)
    #10 void std::__invoke_impl<void, void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::__invoke_memfun_deref, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x5028bd)
    #11 std::__invoke_result<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>::type std::__invoke<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x502704)
    #12 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda'()::operator()() const <null> (tt+0x502653)
    #13 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda0'()::operator()() const <null> (tt+0x502585)
    #14 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda0'()::__invoke() <null> (tt+0x502515)
    #15 pthread_once <null> (tt+0x4a3713)
    #16 __gthread_once(int*, void (*)()) tt.cpp (tt+0x4f7a93)
    #17 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x5023c4)
    #18 std::__future_base::_State_baseV2::_M_set_result(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool) <null> (tt+0x501cbd)
    #19 std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()::operator()() const <null> (tt+0x501a76)
    #20 void std::__invoke_impl<void, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>(std::__invoke_other, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()&&) <null> (tt+0x5019bd)
    #21 std::__invoke_result<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>::type std::__invoke<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()&&) <null> (tt+0x50190d)
    #22 decltype(std::__invoke(_S_declval<0ul>())) std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (tt+0x5018b5)
    #23 std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> >::operator()() <null> (tt+0x501855)
    #24 std::thread::_State_impl<std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> > >::_M_run() <null> (tt+0x501699)
    #25 <null> <null> (libstdc++.so.6+0xc2ba2)

  Thread T1 (tid=560715, running) created by main thread at:
    #0 pthread_create <null> (tt+0x471f07)
    #1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) <null> (libstdc++.so.6+0xc2e88)
    #2 std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ffd91)
    #3 void __gnu_cxx::new_allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >::construct<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::thread::_Invoker<std::tuple<void (*)()> > >(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>*, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ffc91)
    #4 void std::allocator_traits<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >::construct<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::thread::_Invoker<std::tuple<void (*)()> > >(std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >&, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>*, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ff8dd)
    #5 std::_Sp_counted_ptr_inplace<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<std::thread::_Invoker<std::tuple<void (*)()> > >(std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ff3e7)
    #6 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>*&, std::_Sp_alloc_shared_tag<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ff0c8)
    #7 std::__shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::_Sp_alloc_shared_tag<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fefb3)
    #8 std::shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >::shared_ptr<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::_Sp_alloc_shared_tag<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fef07)
    #9 std::shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > std::allocate_shared<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > const&, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fede9)
    #10 std::shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > std::make_shared<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::thread::_Invoker<std::tuple<void (*)()> > >(std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fec92)
    #11 std::shared_ptr<std::__future_base::_State_baseV2> std::__future_base::_S_make_async_state<std::thread::_Invoker<std::tuple<void (*)()> > >(std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fe881)
    #12 std::future<std::result_of<std::decay<void (&)()>::type ()>::type> std::async<void (&)()>(std::launch, void (&)()) <null> (tt+0x4fe5d4)
    #13 std::future<std::result_of<std::decay<void (&)()>::type ()>::type> std::async<void (&)()>(void (&)()) <null> (tt+0x4f8b36)
    #14 main <null> (tt+0x4f783e)

  Thread T2 (tid=560716, running) created by main thread at:
    #0 pthread_create <null> (tt+0x471f07)
    #1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) <null> (libstdc++.so.6+0xc2e88)
    #2 std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ffd91)
    #3 void __gnu_cxx::new_allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >::construct<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::thread::_Invoker<std::tuple<void (*)()> > >(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>*, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ffc91)
    #4 void std::allocator_traits<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >::construct<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::thread::_Invoker<std::tuple<void (*)()> > >(std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >&, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>*, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ff8dd)
    #5 std::_Sp_counted_ptr_inplace<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<std::thread::_Invoker<std::tuple<void (*)()> > >(std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ff3e7)
    #6 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>*&, std::_Sp_alloc_shared_tag<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4ff0c8)
    #7 std::__shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::_Sp_alloc_shared_tag<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fefb3)
    #8 std::shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >::shared_ptr<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::_Sp_alloc_shared_tag<std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > >, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fef07)
    #9 std::shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > std::allocate_shared<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> >, std::thread::_Invoker<std::tuple<void (*)()> > >(std::allocator<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > const&, std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fede9)
    #10 std::shared_ptr<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void> > std::make_shared<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>, std::thread::_Invoker<std::tuple<void (*)()> > >(std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fec92)
    #11 std::shared_ptr<std::__future_base::_State_baseV2> std::__future_base::_S_make_async_state<std::thread::_Invoker<std::tuple<void (*)()> > >(std::thread::_Invoker<std::tuple<void (*)()> >&&) <null> (tt+0x4fe881)
    #12 std::future<std::result_of<std::decay<void (&)()>::type ()>::type> std::async<void (&)()>(std::launch, void (&)()) <null> (tt+0x4fe5d4)
    #13 std::future<std::result_of<std::decay<void (&)()>::type ()>::type> std::async<void (&)()>(void (&)()) <null> (tt+0x4f8b36)
    #14 main <null> (tt+0x4f7851)

SUMMARY: ThreadSanitizer: data race (/home/youzongjiang/gerrit/DBdoctor/dra-agent/src/test/tt+0x4a3d83) in __interceptor_memcpy
==================
ThreadSanitizer:DEADLYSIGNAL
==560713==ERROR: ThreadSanitizer: SEGV on unknown address 0x7f46c255d012 (pc 0x7f46d277fe52 bp 0x00000000000a sp 0x7f46c5dbb3f8 T560715)
==560713==The signal is caused by a READ memory access.
    #0 __memmove_sse2_unaligned_erms <null> (libc.so.6+0x36e52)
    #1 __interceptor_memcpy <null> (tt+0x4a3db6)
    #2 void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*>(char*, char*, std::forward_iterator_tag) <null> (libbcc.so.0+0xfe863)
    #3 KSyms::resolve_name(char const*, char const*, unsigned long*) <null> (libbcc.so.0+0x12fba3)
    #4 bcc_symcache_resolve_name <null> (libbcc.so.0+0x12ebfd)
    #5 ebpf::BFrontendAction::DoMiscWorkAround() <null> (libbcc.so.0+0x1817cc)
    #6 ebpf::BFrontendAction::EndSourceFileAction() <null> (libbcc.so.0+0x1876ff)
    #7 clang::FrontendAction::EndSourceFile() <null> (libclang-cpp.so.13+0x2562d7d)
    #8 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) <null> (libclang-cpp.so.13+0x24ff307)
    #9 ebpf::ClangLoader::do_compile(std::unique_ptr<llvm::Module, std::default_delete<llvm::Module> >*, ebpf::TableStorage&, bool, std::vector<char const*, std::allocator<char const*> > const&, std::vector<char const*, std::allocator<char const*> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ebpf::FuncSource&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::map<int, std::tuple<int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, int, int, int, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::less<int>, std::allocator<std::pair<int const, std::tuple<int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, int, int, int, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > > >&) <null> (libbcc.so.0+0x178370)
    #10 ebpf::ClangLoader::parse(std::unique_ptr<llvm::Module, std::default_delete<llvm::Module> >*, ebpf::TableStorage&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, char const**, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ebpf::FuncSource&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::map<int, std::tuple<int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, int, int, int, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::less<int>, std::allocator<std::pair<int const, std::tuple<int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, int, int, int, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > > >&) <null> (libbcc.so.0+0x17a7ee)
    #11 ebpf::BPFModule::load_cfile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, char const**, int) <null> (libbcc.so.0+0xf704c)
    #12 ebpf::BPFModule::load_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char const**, int) <null> (libbcc.so.0+0xfd181)
    #13 ebpf::BPF::init(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::vector<ebpf::USDT, std::allocator<ebpf::USDT> > const&) <null> (libbcc.so.0+0x238faf)
    #14 initBPF() <null> (tt+0x4f7015)
    #15 void std::__invoke_impl<void, void (*)()>(std::__invoke_other, void (*&&)()) <null> (tt+0x50338a)
    #16 std::__invoke_result<void (*)()>::type std::__invoke<void (*)()>(void (*&&)()) <null> (tt+0x5032cd)
    #17 decltype(std::__invoke(_S_declval<0ul>())) std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (tt+0x503275)
    #18 std::thread::_Invoker<std::tuple<void (*)()> >::operator()() <null> (tt+0x5030e5)
    #19 std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<void (*)()> >, void>::operator()() const <null> (tt+0x502f3a)
    #20 std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<void (*)()> >, void> >::_M_invoke(std::_Any_data const&) <null> (tt+0x502cbb)
    #21 std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>::operator()() const <null> (tt+0x50295b)
    #22 std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) <null> (tt+0x502459)
    #23 void std::__invoke_impl<void, void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::__invoke_memfun_deref, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x5028bd)
    #24 std::__invoke_result<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>::type std::__invoke<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x502704)
    #25 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda'()::operator()() const <null> (tt+0x502653)
    #26 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda0'()::operator()() const <null> (tt+0x502585)
    #27 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::'lambda0'()::__invoke() <null> (tt+0x502515)
    #28 __interceptor_pthread_once <null> (tt+0x4a3713)
    #29 __gthread_once(int*, void (*)()) tt.cpp (tt+0x4f7a93)
    #30 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) <null> (tt+0x5023c4)
    #31 std::__future_base::_State_baseV2::_M_set_result(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool) <null> (tt+0x501cbd)
    #32 std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()::operator()() const <null> (tt+0x501a76)
    #33 void std::__invoke_impl<void, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>(std::__invoke_other, std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()&&) <null> (tt+0x5019bd)
    #34 std::__invoke_result<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>::type std::__invoke<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()>(std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()&&) <null> (tt+0x50190d)
    #35 decltype(std::__invoke(_S_declval<0ul>())) std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) <null> (tt+0x5018b5)
    #36 std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> >::operator()() <null> (tt+0x501855)
    #37 std::thread::_State_impl<std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<void (*)()> >, void>::_Async_state_impl(std::thread::_Invoker<std::tuple<void (*)()> >&&)::'lambda'()> > >::_M_run() <null> (tt+0x501699)
    #38 <null> <null> (libstdc++.so.6+0xc2ba2)
    #39 __tsan_thread_start_func <null> (tt+0x46ec0f)
    #40 start_thread <null> (libpthread.so.0+0x81ce)
    #41 clone <null> (libc.so.6+0x39d82)

ThreadSanitizer can not provide additional info.
SUMMARY: ThreadSanitizer: SEGV (/lib64/libc.so.6+0x36e52) in __memmove_sse2_unaligned_erms
==560713==ABORTING

@chenhengqi chenhengqi added the bug label Mar 1, 2023
@chenhengqi
Copy link
Collaborator

Could you try the following diff ?

diff --git a/src/cc/frontends/clang/b_frontend_action.cc b/src/cc/frontends/clang/b_frontend_action.cc
index e9c83a96..0e27753f 100644
--- a/src/cc/frontends/clang/b_frontend_action.cc
+++ b/src/cc/frontends/clang/b_frontend_action.cc
@@ -123,17 +123,8 @@ const char *pt_regs_syscall_regs(void) {
   return calling_conv_regs[0];
 }
 
-/* Use resolver only once per translation */
-static void *kresolver = NULL;
-static void *get_symbol_resolver(void) {
-  if (!kresolver)
-    kresolver = bcc_symcache_new(-1, nullptr);
-  return kresolver;
-}
-
-static std::string check_bpf_probe_read_kernel(void) {
+static std::string check_bpf_probe_read_kernel(void *resolver) {
   bool is_probe_read_kernel;
-  void *resolver = get_symbol_resolver();
   uint64_t addr = 0;
   is_probe_read_kernel = bcc_symcache_resolve_name(resolver, nullptr,
                           "bpf_probe_read_kernel", &addr) >= 0 ? true: false;
@@ -147,11 +138,10 @@ static std::string check_bpf_probe_read_kernel(void) {
 }
 
 static std::string check_bpf_probe_read_user(llvm::StringRef probe,
-        bool& overlap_addr) {
+        bool& overlap_addr, void *resolver) {
   if (probe.str() == "bpf_probe_read_user" ||
       probe.str() == "bpf_probe_read_user_str") {
     // Check for probe_user symbols in backported kernel before fallback
-    void *resolver = get_symbol_resolver();
     uint64_t addr = 0;
     bool found = bcc_symcache_resolve_name(resolver, nullptr,
                   "bpf_probe_read_user", &addr) >= 0 ? true: false;
@@ -1176,7 +1166,7 @@ bool BTypeVisitor::VisitCallExpr(CallExpr *Call) {
     // space arch.
     bool overlap_addr = false;
     std::string probe = check_bpf_probe_read_user(Decl->getName(),
-                          overlap_addr);
+                          overlap_addr, fe_.get_resolver());
     if (overlap_addr) {
       error(GET_BEGINLOC(Call), "bpf_probe_read_user not found. Use latest kernel");
       return false;
@@ -1232,7 +1222,7 @@ bool BTypeVisitor::VisitCallExpr(CallExpr *Call) {
 
           bool overlap_addr = false;
           text += check_bpf_probe_read_user(StringRef("bpf_probe_read_user"),
-                  overlap_addr);
+                  overlap_addr, fe_.get_resolver());
           if (overlap_addr) {
             error(GET_BEGINLOC(Call), "bpf_probe_read_user not found. Use latest kernel");
             return false;
@@ -1751,7 +1741,20 @@ BFrontendAction::BFrontendAction(
       mod_src_(mod_src),
       next_fake_fd_(-1),
       fake_fd_map_(fake_fd_map),
-      perf_events_(perf_events) {}
+      perf_events_(perf_events),
+      resolver(nullptr) {}
+
+void *BFrontendAction::get_resolver() {
+  if (!resolver)
+    resolver = bcc_symcache_new(-1, nullptr);
+  return resolver;
+}
+
+BFrontendAction::~BFrontendAction() {
+  if (resolver) {
+    bcc_free_symcache(resolver, -1);
+  }
+}
 
 bool BFrontendAction::is_rewritable_ext_func(FunctionDecl *D) {
   StringRef file_name = rewriter_->getSourceMgr().getFilename(GET_BEGINLOC(D));
@@ -1766,11 +1769,7 @@ void BFrontendAction::DoMiscWorkAround() {
   // to guard certain fields. The workaround here intends to define
   // CONFIG_CC_STACKPROTECTOR properly based on other configs, so it relieved any bpf
   // program (using task_struct, etc.) of patching the below code.
-  std::string probefunc = check_bpf_probe_read_kernel();
-  if (kresolver) {
-    bcc_free_symcache(kresolver, -1);
-    kresolver = NULL;
-  }
+  std::string probefunc = check_bpf_probe_read_kernel(resolver);
   if (probefunc == "bpf_probe_read") {
     probefunc = "#define bpf_probe_read_kernel bpf_probe_read\n"
       "#define bpf_probe_read_kernel_str bpf_probe_read_str\n"
diff --git a/src/cc/frontends/clang/b_frontend_action.h b/src/cc/frontends/clang/b_frontend_action.h
index c2881d60..48fa583a 100644
--- a/src/cc/frontends/clang/b_frontend_action.h
+++ b/src/cc/frontends/clang/b_frontend_action.h
@@ -159,6 +159,7 @@ class BFrontendAction : public clang::ASTFrontendAction {
                   ProgFuncInfo &prog_func_info, std::string &mod_src,
                   const std::string &maps_ns, fake_fd_map_def &fake_fd_map,
                   std::map<std::string, std::vector<std::string>> &perf_events);
+  ~BFrontendAction();
 
   // Called by clang when the AST has been completed, here the output stream
   // will be flushed.
@@ -180,6 +181,7 @@ class BFrontendAction : public clang::ASTFrontendAction {
                std::string> map_def) {
     fake_fd_map_[fd] = move(map_def);
   }
+  void *get_resolver();
 
  private:
   llvm::raw_ostream &os_;
@@ -197,6 +199,7 @@ class BFrontendAction : public clang::ASTFrontendAction {
   int next_fake_fd_;
   fake_fd_map_def &fake_fd_map_;
   std::map<std::string, std::vector<std::string>> &perf_events_;
+  void *resolver;
 };
 
 }  // namespace visitor

@zongjiangU
Copy link
Author

I imported the diff file into the local code, recompiled and installed bcc, and tested it again without any core dump. However, there is still a problem with header file not found when multiple ebpf::BPF objects are initialized concurrently.Partial initialization will result in an error.

[root@localhost test]# ./tt
In file included from /virtual/main.c:14:
include/net/sock.h:72:10: fatal error: 'net/tcp_states.h' file not found
#include <net/tcp_states.h>
         ^~~~~~~~~~~~~~~~~~
In file included from /virtual/main.c:14:
In file included from include/net/sock.h:43:
include/linux/hardirq.h:6:10: fatal error: 'linux/lockdep.h' file not found
#include <linux/lockdep.h>
         ^~~~~~~~~~~~~~~~~
In file included from /virtual/main.c:14:
In file included from include/net/sock.h:64:
include/linux/filter.h:30:10: fatal error: 'uapi/linux/filter.h' file not found
#include <uapi/linux/filter.h>
         ^~~~~~~~~~~~~~~~~~~~~
In file included from /virtual/main.c:14:
In file included from include/net/sock.h:43:
In file included from include/linux/hardirq.h:5:
In file included from include/linux/preempt.h:78:
In file included from arch/x86/include/asm/preempt.h:7:
In file included from include/linux/thread_info.h:38:
In file included from arch/x86/include/asm/thread_info.h:53:
In file included from arch/x86/include/asm/cpufeature.h:5:
arch/x86/include/asm/processor.h:24:10: fatal error: 'asm/special_insns.h' file not found
#include <asm/special_insns.h>
         ^~~~~~~~~~~~~~~~~~~~~
init OK
1 error generated.
In file included from /virtual/main.c:14:
In file included from include/net/sock.h:64:
include/linux/filter.h:30:10: fatal error: 'uapi/linux/filter.h' file not found
#include <uapi/linux/filter.h>
         ^~~~~~~~~~~~~~~~~~~~~
1 error generated.
init OK
init error
init OK
1 error generated.
1 error generated.
init OK
init error
init error
init error
1 error generated.
init OK
init erro

@chenhengqi
Copy link
Collaborator

cc @yonghong-song

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants