HostDBContinuation::init memsets a polymorphic Action
维护者通常 2 天内回复
@ANMOLSCRIPT 已经在做这个了。
开始于 2026年12月5日。
评估
调研方向
阅读 src/iocore/hostdb/HostDB.cc 中 HostDBContinuation::init 附近的代码(第 376–382 行)以及刷新过期记录的调用(第 515–520 行),然后检查头文件中的 Action,了解它的成员。将整个对象清零替换为安全重置,并运行相关的 HostDB 测试;完成标准是保留默认 action 状态,同时不覆盖多态存储或智能指针存储。
由索引模型根据 Issue 内容生成。
描述
When HostDBContinuation::init is called without a continuation, it clears action with ink_zero(action) (HostDB.cc#L376-L382). ink_zero is a memset over the whole object (ink_memory.h#L210-L215). Action is not trivially copyable: it has a virtual cancel() and a Ptr<ProxyMutex> member. So the memset overwrites the vtable pointer and the smart pointer's storage, which is undefined behavior. Any later virtual call through action would jump through a null vtable.
This path runs whenever a stale HostDB record is served while a background refresh starts, because that refresh calls init with default options (HostDB.cc#L515-L520).
Assigning a default-constructed Action (action = Action{}), or resetting the fields individually, gives the intended result without the undefined behavior.
generated with Claude Opus 5.5 by Josiah VanderZee
- 主要语言
- C++
- 星标
- 2k
- 派生
- 903
- 平均合并
- 4 天 4 小时
- 30 天内合并 PR
- 135
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/trafficserver 的其他 Issue
-
UnixNetVConnection::do_io_write with a null reader leaves the previous reader in the write VIO可能已有人在做 @NginxL 今天认领。 未关闭Bug Good First Issue IOBuffer Network
难度 2/5 1-3 小时 新手友好度 78/100
apache/trafficserver#14220 ·
维护者通常 2 天内回复
-
MallocAllocator does not check for allocation failure可能已有人在做 @umrndem 今天认领。 未关闭Bug Core Good First Issue
难度 2/5 1-3 小时 新手友好度 78/100
apache/trafficserver#14218 · 2 条评论 ·
维护者通常 2 天内回复
-
Bug Event System Threads
难度 2/5 1-3 小时 新手友好度 78/100
apache/trafficserver#14217 ·
维护者通常 2 天内回复
-
TSContScheduleEveryOnPool and TSContScheduleEveryOnThread accept a zero or negative period可能已有人在做 @rajeetvk 于 1 天前认领。 未关闭Bug Event System Good First Issue TS API
难度 2/5 1-3 小时 新手友好度 75/100
apache/trafficserver#14214 · 1 条评论 ·
维护者通常 2 天内回复
-
Bug Core Event System Logging Startup
难度 2/5 1-3 小时 新手友好度 72/100
apache/trafficserver#14201 ·
维护者通常 2 天内回复
查看 apache/trafficserver 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 2 天内回复
-
bug data-types
难度 2/5 1-3 小时 新手友好度 76/100
ClickHouse/clickhouse-cpp#645 ·
维护者通常 1 天内回复
-
bug compatibility difficulty:easy prio:normal
难度 2/5 1-3 小时 新手友好度 74/100
NatronGitHub/openfx-misc#524 ·
维护者通常 1 天内回复
-
documentation enhancement help wanted P0
难度 2/5 1-3 小时 新手友好度 68/100
Awesome-Embedded-Learning-Studio/Tutorial_AwesomeModernCPP#359 ·
维护者通常 1 天内回复
-
Type: Bug
难度 2/5 1-3 小时 新手友好度 82/100
openscad/openscad#7360 · 2 条评论 ·
维护者通常 1 天内回复