[Storage] desktop ListenerInternal never initializes rest_operation_
维护者通常 3 天内回复
还没有人认领这个 Issue。
评估
调研方向
在 storage/src/desktop/listener_desktop.cc 中,构造函数初始化 listener_、bytes_transferred_ 和 total_byte_count_;issue 指出 rest_operation_ 没有头文件初始化器。阅读 ListenerInternal 的声明和构造函数,然后检查在创建 RestOperation 之前 PutFile 失败时所用 listener 的析构函数行为。完成的标准是该情况不再访问未初始化的指针。
由索引模型根据 Issue 内容生成。
描述
storage/src/desktop/listener_desktop.cc:
ListenerInternal::ListenerInternal(Listener *listener)
: listener_(listener), bytes_transferred_(-1), total_byte_count_(-1) {}
ListenerInternal::~ListenerInternal() {
MutexLock lock(mutex_);
if (rest_operation_) {
rest_operation_->cleanup().UnregisterObject(this);
rest_operation_->set_listener(nullptr);
}
}
rest_operation_ has no initializer in the header either. It only gets set in set_rest_operation(), which runs when a RestOperation is created.
So a Listener passed to a call that never creates one gets destroyed with garbage in it. PutFile() on a path that can't be opened does this. PutFileInternal completes with "Could not read file." and returns before RestCall.
class L : public firebase::storage::Listener {
void OnPaused(firebase::storage::Controller*) override {}
void OnProgress(firebase::storage::Controller*) override {}
};
auto* l = new L();
auto f = ref.PutFile("/no/such/file", l);
// wait for f, it fails with kErrorUnknown
delete l;
- Windows x64, MSVC release: access violation in the destructor
- Linux and macOS: passes, the allocation happened to be zeroed
13.12.0, and main is the same.
Fix is rest_operation_(nullptr) in the constructor.
- 主要语言
- C++
- 星标
- 326
- 派生
- 137
- 平均合并
- 3 天 8 小时
- 30 天内合并 PR
- 17
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
firebase/firebase-cpp-sdk 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
firebase/firebase-cpp-sdk#1954 ·
维护者通常 3 天内回复
-
new type: question
难度 2/5 1-3 小时 新手友好度 85/100
firebase/firebase-cpp-sdk#1926 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
firebase/firebase-cpp-sdk#1905 · 2 条评论 ·
维护者通常 3 天内回复
-
Windows: sign-in fails behind TLS inspection because the Schannel revocation check is strict (CRYPT_E_NO_REVOCATION_CHECK)可能已有人在做 @AustinBenoit 于 5 天前认领。 未关闭needs-triage
难度 3/5 1-2 天 新手友好度 42/100
firebase/firebase-cpp-sdk#1963 · 已指派 1 人 ·
维护者通常 3 天内回复
-
[Database][Android] SIGSEGV in Database::DeleteInternal when embedded bridge-class init fails; FindClassInFiles passes JNI-form names to loadClass on Android可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 3/5 半天 新手友好度 55/100
firebase/firebase-cpp-sdk#1936 · 4 条评论 ·
维护者通常 3 天内回复
查看 firebase/firebase-cpp-sdk 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 77/100
distante/esphome-components#50 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
-
feat
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 1/5 1 小时以内 新手友好度 76/100
维护者通常 1 天内回复