Skip to content

bvar, bvar::LatencyRecorder coredump  #1256

@yqynju

Description

@yqynju

Describe the bug (描述bug)

bvar::LatencyRecorder 使用时,记录时延:
g_latency_recorder << cntl.latency_us();

多线程并发,会coredump。
堆栈如下:
2020-09-25 10:28:03|kr_server|FATAL|/bvar/detail/agent_group.h:133] Check failed: false. Invalid id=-1
#0 0x55d30b5f6ffb bvar::detail::AgentGroup<>::get_or_create_tls_agent()
#1 0x55d30b5f727f bvar::IntRecorder::operator<<()
#2 0x55d30b5f3eac bvar::LatencyRecorder::operator<<()
#3 0x55d30b54317e xxWrapper::xxx() //代码为: g_latency_recorder << cntl.latency_us(); 未加锁
#4 0x55d30b543803 xxWrapper::xxx()
#5 0x55d30b5460b5 std::_Function_handler<>::_M_invoke()
#6 0x55d30b53e478 segment::ThreadPool::runInThread()
#7 0x7ffa39b50900
#8 0x7ffa39daae45 start_thread
#9 0x7ffa392b7add __clone

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions