lkkey80 opened a new issue, #2937: URL: https://github.com/apache/brpc/issues/2937
**Describe the bug (描述bug)** bvar combiner.h中的AgentCombiner这里的是实现,看上去好像有一个竞争条件,可能导致程序崩溃。比如,使用bvar::Adder的时候,bvar::Adder对象析构了,但是对应Agent所在线程退出析构Agent的时候,可能访问已经析构了的AgentCombiner。 struct Agent : public butil::LinkNode<Agent> { Agent() : combiner(NULL) {} ~Agent() { if (combiner) { combiner->commit_and_erase(this); combiner = NULL; } } ... } if 判断combiner指针是否为NULL可能为真,但是在调用combiner->commit_and_erase(this);的时候,combiner可能被~AgentCombiner()析构函数置为NULL了,也可能combiner此时已经析构了。 **To Reproduce (复现方法)** **Expected behavior (期望行为)** **Versions (各种版本)** OS: Compiler: brpc: protobuf: **Additional context/screenshots (更多上下文/截图)** -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For additional commands, e-mail: dev-h...@brpc.apache.org