[Storage] desktop ListenerInternal never initializes rest_operation_
Maintainer thường phản hồi trong vòng 3 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 88/100
Hướng nghiên cứu
Trong storage/src/desktop/listener_desktop.cc, hàm khởi tạo khởi tạo listener_, bytes_transferred_ và total_byte_count_; issue cho biết rest_operation_ không có giá trị khởi tạo trong header. Đọc phần khai báo và hàm khởi tạo của ListenerInternal, sau đó kiểm tra hành vi của hàm hủy đối với listener được dùng khi PutFile thất bại trước khi tạo RestOperation. Hoàn tất khi trường hợp đó không còn truy cập con trỏ chưa được khởi tạo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- C++
- Star
- 326
- Fork
- 137
- Merge trung bình
- 3 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 17
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của firebase/firebase-cpp-sdk
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
firebase/firebase-cpp-sdk#1954 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
[FR] Support desktop Linux on aarch64/arm (#error Unknown Linux architecture in app_common.cc)Đang mởnew type: question
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
firebase/firebase-cpp-sdk#1926 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
firebase/firebase-cpp-sdk#1905 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Windows: sign-in fails behind TLS inspection because the Schannel revocation check is strict (CRYPT_E_NO_REVOCATION_CHECK)Có thể đã có người làm @AustinBenoit đã nhận 5 ngày trước. Đang mởneeds-triage
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
firebase/firebase-cpp-sdk#1963 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 3 ngày
-
[Database][Android] SIGSEGV in Database::DeleteInternal when embedded bridge-class init fails; FindClassInFiles passes JNI-form names to loadClass on AndroidCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 55/100
firebase/firebase-cpp-sdk#1936 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của firebase/firebase-cpp-sdk
Issue tương tự
-
sec_touch: a corrupted panel ACK ends a GET as malformed while its data frame is still comingĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
distante/esphome-components#50 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Windows] Match files ≥ 2 GiB fail to load: stlplus is_file() uses 32-bit stat() (EOVERFLOW)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
-
feat
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày