apache / apache/brpc

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

Open
#2,729 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
17.6k
Forks
4.1k
Avg merge
2d 12h
Merged PRs (30d)
69

Description

堆栈如下,环境运行正常,网络良好,感觉是个老问题,和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 , 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 , 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 , 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](https://github.com/user-attachments/assets/0c0e3100-6b92-47e7-bf37-9cfbf865b825)

**Describe the bug (描述bug)**

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

**Expected behavior (期望行为)**

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

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

Contributor guide

Open the contributing guide

Research direction

Start with the stack locations in src/bthread/timer_thread.cpp, src/butil/resource_pool_inl.h, and src/brpc/channel.cpp, then compare the report with bug #1188. Investigate the null block group and resource ID handling during task-thread release, using the reported network-delay condition if reproduction is possible; done means the long-running client no longer crashes.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.