[rdma] occasional crash in butil::IOBuf::clear()

未关闭
#3,252 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
冷清
技术栈
cpp
领域
networking

调研方向

首先跟踪 RdmaEndpoint::HandleCompletion() 和 PollCq(),然后检查 Socket::Address() 以及 WaitAndReset() 与 _sq_sent 之间的交互。调查竞争条件如何到达 butil::IOBuf::clear(); 完成标准是识别并复现生命周期问题,并防止在并发处理 RDMA 完成事件时发生 SIGSEGV。

由索引模型根据 Issue 内容生成。

描述

Describe the bug

Spotted from log, as shown below:

PC: @               Ox0(unknown)
*** SIGSEGV(@0x4) received by PID 7(TID Ox7f45f57bd6c0) from PID 4; stack trace: ***
    0x561a2f021526 google::Canonymousnamespace)::FailureSignaLHandler()
    0x7f45f8254050 (unknown)
    0x561a2ef11e9f butil::IOBuf::clear()
    0x561aZed92a2e brpc::rdma::RdmaEndpoint::HandleCompletion()
    0x561a2ed92f33 brpc::rdma::RdmaEndpoint::PollCq()
    0x561a2ed56290 brpc::Socket::ProcessEvent()
    0x561a2eecffcf bthread::TaskGroup::task_runner()
    0x561a2eeea901 bthread_make_fcontext

In theory, we have ref-counting in Socket::Address() that protects racing against _sq_sent between WaitAndReset() and RdmaEndpoint::PollCq(), but ... @yanglimingcn @chenBright Any clue?

To Reproduce

unknown

Expected behavior

No crash.

Versions
OS: Debian 12
Compiler: g++ (Debian 14.2.0-19) 14.2.0
brpc: 1.14
protobuf:

Additional context/screenshots

n/a

主要语言
C++
星标
17.6k
派生
4.2k
平均合并
3 天 17 小时
30 天内合并 PR
72

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/brpc 的其他 Issue

查看 apache/brpc 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。