apache / brpc

brpc is an Industrial-grade RPC framework using C++ Language, which is often used in high performance system such as Search, Storage, Machine learning, Advertisement, Recommendation etc. "brpc" means "better RPC".
https://brpc.apache.org
Apache License 2.0
16.56k stars 3.98k forks source link

客户端core,正常运行,时间久了就崩溃 #2729

Open helloworld0xff opened 3 months ago

helloworld0xff commented 3 months ago

堆栈如下,环境运行正常,网络良好,感觉是个老问题,和bug#1188有点相似,bug#1188这种问题,做网络延时就会频繁发生

gdb看,是id错误,得到block grop的为NULL,流程上是否在task thread中释放该资源时的id不对???释放资源时的id没有校验

0 0x00007fb1e176d6fa in bthread::TimerThread::Bucket::schedule(void ()(void), void*, timespec const&) (__m=std::memory_order_consume, this=0x14008) at /usr/include/c++/4.8.2/bits/atomic_base.h:805

1 0x00007fb1e176d6fa in bthread::TimerThread::Bucket::schedule(void ()(void), void*, timespec const&) (__m=std::memory_order_consume, this=0x14008) at /usr/include/c++/4.8.2/atomic:386

2 0x00007fb1e176d6fa in bthread::TimerThread::Bucket::schedule(void ()(void), void*, timespec const&) (id=...) at ./src/butil/resource_pool_inl.h:255

3 0x00007fb1e176d6fa in bthread::TimerThread::Bucket::schedule(void ()(void), void*, timespec const&) (id=, this=0x7fb140619a00) at ./src/butil/resource_pool_inl.h:210

4 0x00007fb1e176d6fa in bthread::TimerThread::Bucket::schedule(void ()(void), void*, timespec const&) (id=, this=) at ./src/butil/resource_pool_inl.h:283

5 0x00007fb1e176d6fa in bthread::TimerThread::Bucket::schedule(void ()(void), void*, timespec const&) (id=) at ./src/butil/resource_pool.h:97

6 0x00007fb1e176d6fa in bthread::TimerThread::Bucket::schedule(void ()(void), void, timespec const&) (this=0x7fb17ecaf100, fn=fn@entry=0x7fb1e17b0200 <brpc::HandleTimeout(void)>, arg=arg@entry=0x725e00002bd1, abstime=...) at src/bthread/timer_thread.cpp:189

7 0x00007fb1e176db1b in bthread::TimerThread::schedule(void ()(void), void, timespec const&) (this=0x7fb17ebff340, fn=fn@entry=0x7fb1e17b0200 <brpc::HandleTimeout(void)>, arg=arg@entry=0x725e00002bd1, abstime=...) at src/bthread/timer_thread.cpp:228

8 0x00007fb1e1770a22 in bthread_timer_add(bthread_timer_t, timespec, void ()(void), void) (id=0x7fb17b5e6f30, abstime=..., on_timer=0x7fb1e17b0200 <brpc::HandleTimeout(void*)>, arg=0x725e00002bd1) at src/bthread/bthread.cpp:435

9 0x00007fb1e17b1bac in brpc::Channel::CallMethod(google::protobuf::MethodDescriptor const, google::protobuf::RpcController, google::protobuf::Message const, google::protobuf::Message, google::protobuf::Closure*) (this=

0x7fb17ec2e0f8, method=0x7fb17ec4c670, controller_base=0x7fb17b5e6e90, request=0x7fb17b5e6e50, response=0x7fb17b5e6e10, done=0x0) at src/brpc/channel.cpp:571

mmexport1723106754175

Describe the bug (描述bug)

**To Reproduce (复现方法) 正常环境

Expected behavior (期望行为)

**Versions (各种版本) 1.10.0 OS: Compiler: brpc: protobuf:

Additional context/screenshots (更多上下文/截图)

helloworld0xff commented 3 months ago

几个core都指向ResourcePool,看了之前的一些提问,这是个很老的问题了